From 8199bccb81a85678d731941c1ac5130a72014834 Mon Sep 17 00:00:00 2001 From: Will Cassella Date: Wed, 8 Jun 2022 19:08:03 +0000 Subject: [PATCH] Warn when depot_tools is not a git directory It's sometimes possible to end up with a depot_tools checkout that isn't a git repository, which breaks the update mechanism. Rather than allowing the updater to silently fail and have things break several weeks/months later, we should emit a warning. Bug: 1333997 Change-Id: I70ae4f3b479e24b87987847927184687caf08b33 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3692864 Reviewed-by: Bruce Dawson Reviewed-by: Aravind Vasudevan Commit-Queue: Will Cassella Reviewed-by: Brian Sheedy --- update_depot_tools | 3 +++ 1 file changed, 3 insertions(+) diff --git a/update_depot_tools b/update_depot_tools index ce95e8857..76ebf191a 100755 --- a/update_depot_tools +++ b/update_depot_tools @@ -130,6 +130,9 @@ if [ "X$DEPOT_TOOLS_UPDATE" != "X0" ]; then cd "$base_dir" update_git_repo cd - > /dev/null + else + echo "Warning: Your depot_tools directory does not appear to be a git repository, and cannot be updated." 1>&2 + echo "Consider deleting your depot_tools directory and following the instructions at https://www.chromium.org/developers/how-tos/install-depot-tools/ to reinstall it." 1>&2 fi # Sync CIPD-boostrapped packages.