From 16109a66b705211efd25f434201d113628aff04c Mon Sep 17 00:00:00 2001 From: Gavin Mak Date: Tue, 22 Aug 2023 01:24:46 +0000 Subject: 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 Commit-Queue: Gavin Mak Tested-by: Gavin Mak --- subcmds/upload.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'subcmds/upload.py') 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 from git_refs import R_HEADS from hooks import RepoHook from project import ReviewableBranch +from subcmds.sync import LocalSyncState _DEFAULT_UNUSUAL_COMMIT_THRESHOLD = 5 @@ -804,6 +805,12 @@ Gerrit Code Review: https://www.gerritcodereview.com/ if not hook.Run( project_list=pending_proj_names, worktree_list=pending_worktrees ): + if LocalSyncState(manifest).IsPartiallySynced(): + print( + "Partially synced tree detected. Syncing all projects " + "may resolve issues you're seeing.", + file=sys.stderr, + ) ret = 1 if ret: return ret -- cgit v1.2.3-54-g00ecf