Bug 1475649 - Always use --untracked-files; r=ahal

a35b188d0e44 inadvertently regressed behavior in the case where
the Git status.showUntrackedFiles config option was set and
we want to purge untracked files.

Differential Revision: https://phabricator.services.mozilla.com/D2141

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gregory Szorc 2018-07-16 13:19:09 +00:00
Родитель 1f2e5ca9b2
Коммит 4a88e570a0
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -430,8 +430,15 @@ class GitRepository(Repository):
def working_directory_clean(self, untracked=False, ignored=False):
args = ['status', '--porcelain']
if not untracked:
# Even in --porcelain mode, behavior is affected by the
# ``status.showUntrackedFiles`` option, which means we need to be
# explicit about how to treat untracked files.
if untracked:
args.append('--untracked-files=all')
else:
args.append('--untracked-files=no')
if ignored:
args.append('--ignored')