diff options
author | Gavin Mak <gavinmak@google.com> | 2023-08-22 01:24:46 +0000 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-08-22 17:18:13 +0000 |
commit | 16109a66b705211efd25f434201d113628aff04c (patch) | |
tree | fede640aae0b6a485cf71c2b9fd315a53673b613 /subcmds/upload.py | |
parent | 321b7934b5e8e316b7fa4dc306e055d3d6d351ff (diff) | |
download | git-repo-16109a66b705211efd25f434201d113628aff04c.tar.gz |
upload: Suggest full sync if hooks fail with partially synced tree
Pre-upload hooks may fail because of partial syncs.
Bug: b/271507654
Change-Id: I124cd386c5af2c34e1dcaa3e86916624e235b1e3
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/383474
Reviewed-by: Mike Frysinger <vapier@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Tested-by: Gavin Mak <gavinmak@google.com>
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r-- | subcmds/upload.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py index 040eaeb5..b89525ce 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -26,6 +26,7 @@ from git_command import GitCommand | |||
26 | from git_refs import R_HEADS | 26 | from git_refs import R_HEADS |
27 | from hooks import RepoHook | 27 | from hooks import RepoHook |
28 | from project import ReviewableBranch | 28 | from project import ReviewableBranch |
29 | from subcmds.sync import LocalSyncState | ||
29 | 30 | ||
30 | 31 | ||
31 | _DEFAULT_UNUSUAL_COMMIT_THRESHOLD = 5 | 32 | _DEFAULT_UNUSUAL_COMMIT_THRESHOLD = 5 |
@@ -804,6 +805,12 @@ Gerrit Code Review: https://www.gerritcodereview.com/ | |||
804 | if not hook.Run( | 805 | if not hook.Run( |
805 | project_list=pending_proj_names, worktree_list=pending_worktrees | 806 | project_list=pending_proj_names, worktree_list=pending_worktrees |
806 | ): | 807 | ): |
808 | if LocalSyncState(manifest).IsPartiallySynced(): | ||
809 | print( | ||
810 | "Partially synced tree detected. Syncing all projects " | ||
811 | "may resolve issues you're seeing.", | ||
812 | file=sys.stderr, | ||
813 | ) | ||
807 | ret = 1 | 814 | ret = 1 |
808 | if ret: | 815 | if ret: |
809 | return ret | 816 | return ret |