summaryrefslogtreecommitdiffstats
path: root/subcmds/upload.py
diff options
context:
space:
mode:
authorGavin Mak <gavinmak@google.com>2023-08-22 01:24:46 +0000
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-08-22 17:18:13 +0000
commit16109a66b705211efd25f434201d113628aff04c (patch)
treefede640aae0b6a485cf71c2b9fd315a53673b613 /subcmds/upload.py
parent321b7934b5e8e316b7fa4dc306e055d3d6d351ff (diff)
downloadgit-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.py7
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
26from git_refs import R_HEADS 26from git_refs import R_HEADS
27from hooks import RepoHook 27from hooks import RepoHook
28from project import ReviewableBranch 28from project import ReviewableBranch
29from 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