From 2c5fb84d357d9df797b9186b4dc711cf723cb535 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 13 May 2024 14:27:12 -0400 Subject: [PATCH] upload: drop check for uncommitted local changes git push, like most git commands, does not warn or otherwise prompt users when there are local uncommitted changes. To simplify the upload logic, and to harmonize repo upload with git push as a more git-esque flow, stop checking/warning/prompting the user here too. Change-Id: Iee18132f0faad0881f1a796cb58821328e04b694 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/425337 Reviewed-by: Josip Sokcevic Tested-by: Mike Frysinger Commit-Queue: Mike Frysinger --- subcmds/upload.py | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/subcmds/upload.py b/subcmds/upload.py index 081f1afe..5b8c1a20 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py @@ -549,37 +549,6 @@ Gerrit Code Review: https://www.gerritcodereview.com/ people = copy.deepcopy(original_people) self._AppendAutoList(branch, people) - # Check if there are local changes that may have been forgotten. - changes = branch.project.UncommitedFiles() - if opt.ignore_untracked_files: - untracked = set(branch.project.UntrackedFiles()) - changes = [x for x in changes if x not in untracked] - - if changes: - key = "review.%s.autoupload" % branch.project.remote.review - answer = branch.project.config.GetBoolean(key) - - # If they want to auto upload, let's not ask because it - # could be automated. - if answer is None: - print() - print( - "Uncommitted changes in %s (did you forget to " - "amend?):" % branch.project.name - ) - print("\n".join(changes)) - print("Continue uploading? (y/N) ", end="", flush=True) - if opt.yes: - print("<--yes>") - a = "yes" - else: - a = sys.stdin.readline().strip().lower() - if a not in ("y", "yes", "t", "true", "on"): - print("skipping upload", file=sys.stderr) - branch.uploaded = False - branch.error = "User aborted" - return - # Check if topic branches should be sent to the server during # upload. if opt.auto_topic is not True: