mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
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>
This commit is contained in:
parent
12f6dc49e9
commit
2c5fb84d35
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user