upload: add ‘--ignore-untracked-files’ option
This option will suppress the
Uncommitted changes in ... (did you forget to amend?)
prompt when there are untracked (unknown) files in the working copy.
The prompt is still shown if tracked files are modified.
Change-Id: Ia3fcc82989b7fad09b69214eda31e2d0dfc14600
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/340456
Tested-by: Martin Geisler <mgeisler@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
diff --git a/project.py b/project.py
index 48cf08c..8274f02 100644
--- a/project.py
+++ b/project.py
@@ -650,7 +650,7 @@
return True
if self.work_git.DiffZ('diff-files'):
return True
- if consider_untracked and self.work_git.LsOthers():
+ if consider_untracked and self.UntrackedFiles():
return True
return False
@@ -779,12 +779,16 @@
if not get_all:
return details
- changes = self.work_git.LsOthers()
+ changes = self.UntrackedFiles()
if changes:
details.extend(changes)
return details
+ def UntrackedFiles(self):
+ """Returns a list of strings, untracked files in the git tree."""
+ return self.work_git.LsOthers()
+
def HasChanges(self):
"""Returns true if there are uncommitted changes.
"""