Skip to content

Instantly share code, notes, and snippets.

@vguerra
Created June 25, 2019 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vguerra/9f410398f84f3a9d04d4af519d01809f to your computer and use it in GitHub Desktop.
Save vguerra/9f410398f84f3a9d04d4af519d01809f to your computer and use it in GitHub Desktop.
diff --git a/utils/update_checkout/update_checkout/update_checkout.py b/utils/update_checkout/update_checkout/update_checkout.py
index 56e7ea24d4..54fcb18107 100755
--- a/utils/update_checkout/update_checkout/update_checkout.py
+++ b/utils/update_checkout/update_checkout/update_checkout.py
@@ -117,17 +117,17 @@ def update_single_repository(pool_args):
except Exception:
pass
- if checkout_target:
- shell.run(['git', 'status', '--porcelain', '-uno'],
- echo=False)
- shell.run(['git', 'checkout', checkout_target], echo=True)
-
# It's important that we checkout, fetch, and rebase, in order.
# .git/FETCH_HEAD updates the not-for-merge attributes based on
# which branch was checked out during the fetch.
shell.run(["git", "fetch", "--recurse-submodules=yes", "--tags"],
echo=True)
+ if checkout_target:
+ shell.run(['git', 'status', '--porcelain', '-uno'],
+ echo=False)
+ shell.run(['git', 'checkout', checkout_target], echo=True)
+
# If we were asked to reset to the specified branch, do the hard
# reset and return.
if checkout_target and reset_to_remote and not cross_repo:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment