diff options
author | Martin Geisler <mgeisler@google.com> | 2022-07-08 10:50:10 +0200 |
---|---|---|
committer | Martin Geisler <mgeisler@google.com> | 2022-07-11 17:57:43 +0000 |
commit | 9fb64ae29cb978f869de5ff11a47f86e070b4274 (patch) | |
tree | 91254b0a4dc779f1db2ed24a9a2f679539173b5c /project.py | |
parent | d47d9ff1cbb33da4b3e37bc524c58feef6866b7a (diff) | |
download | git-repo-9fb64ae29cb978f869de5ff11a47f86e070b4274.tar.gz |
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>
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -650,7 +650,7 @@ class Project(object): | |||
650 | return True | 650 | return True |
651 | if self.work_git.DiffZ('diff-files'): | 651 | if self.work_git.DiffZ('diff-files'): |
652 | return True | 652 | return True |
653 | if consider_untracked and self.work_git.LsOthers(): | 653 | if consider_untracked and self.UntrackedFiles(): |
654 | return True | 654 | return True |
655 | return False | 655 | return False |
656 | 656 | ||
@@ -779,12 +779,16 @@ class Project(object): | |||
779 | if not get_all: | 779 | if not get_all: |
780 | return details | 780 | return details |
781 | 781 | ||
782 | changes = self.work_git.LsOthers() | 782 | changes = self.UntrackedFiles() |
783 | if changes: | 783 | if changes: |
784 | details.extend(changes) | 784 | details.extend(changes) |
785 | 785 | ||
786 | return details | 786 | return details |
787 | 787 | ||
788 | def UntrackedFiles(self): | ||
789 | """Returns a list of strings, untracked files in the git tree.""" | ||
790 | return self.work_git.LsOthers() | ||
791 | |||
788 | def HasChanges(self): | 792 | def HasChanges(self): |
789 | """Returns true if there are uncommitted changes. | 793 | """Returns true if there are uncommitted changes. |
790 | """ | 794 | """ |