diff options
author | Mike Frysinger <vapier@google.com> | 2024-05-13 14:27:12 -0400 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2024-05-14 02:32:27 +0000 |
commit | 2c5fb84d357d9df797b9186b4dc711cf723cb535 (patch) | |
tree | ca428cc0e90d2024c2b1e8674c7e1ff02b5e5426 /subcmds/upload.py | |
parent | 12f6dc49e9827e51f0deff5730e734ead52acf71 (diff) | |
download | git-repo-2c5fb84d357d9df797b9186b4dc711cf723cb535.tar.gz |
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 <sokcevic@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
Commit-Queue: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r-- | subcmds/upload.py | 31 |
1 files changed, 0 insertions, 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/ | |||
549 | people = copy.deepcopy(original_people) | 549 | people = copy.deepcopy(original_people) |
550 | self._AppendAutoList(branch, people) | 550 | self._AppendAutoList(branch, people) |
551 | 551 | ||
552 | # Check if there are local changes that may have been forgotten. | ||
553 | changes = branch.project.UncommitedFiles() | ||
554 | if opt.ignore_untracked_files: | ||
555 | untracked = set(branch.project.UntrackedFiles()) | ||
556 | changes = [x for x in changes if x not in untracked] | ||
557 | |||
558 | if changes: | ||
559 | key = "review.%s.autoupload" % branch.project.remote.review | ||
560 | answer = branch.project.config.GetBoolean(key) | ||
561 | |||
562 | # If they want to auto upload, let's not ask because it | ||
563 | # could be automated. | ||
564 | if answer is None: | ||
565 | print() | ||
566 | print( | ||
567 | "Uncommitted changes in %s (did you forget to " | ||
568 | "amend?):" % branch.project.name | ||
569 | ) | ||
570 | print("\n".join(changes)) | ||
571 | print("Continue uploading? (y/N) ", end="", flush=True) | ||
572 | if opt.yes: | ||
573 | print("<--yes>") | ||
574 | a = "yes" | ||
575 | else: | ||
576 | a = sys.stdin.readline().strip().lower() | ||
577 | if a not in ("y", "yes", "t", "true", "on"): | ||
578 | print("skipping upload", file=sys.stderr) | ||
579 | branch.uploaded = False | ||
580 | branch.error = "User aborted" | ||
581 | return | ||
582 | |||
583 | # Check if topic branches should be sent to the server during | 552 | # Check if topic branches should be sent to the server during |
584 | # upload. | 553 | # upload. |
585 | if opt.auto_topic is not True: | 554 | if opt.auto_topic is not True: |