зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1334556 - make GitRepository.get_modified_files slightly more idiomatic; r=gps
Having to munge the output of `git status --porcelain` is unseemly when there are approaches that will give us what we want directly.
This commit is contained in:
Родитель
3317135d5c
Коммит
deb4dfaf07
|
@ -87,8 +87,7 @@ class GitRepository(Repository):
|
|||
super(GitRepository, self).__init__(path, 'git')
|
||||
|
||||
def get_modified_files(self):
|
||||
# This is a little wonky, but it's good enough for this purpose.
|
||||
return [bits[1] for bits in map(lambda line: line.strip().split(), self._run('status', '--porcelain').splitlines()) if 'M' in bits[0]]
|
||||
return self._run('diff', '--diff-filter=M', '--name-only').splitlines()
|
||||
|
||||
def add_remove_files(self, path):
|
||||
self._run('add', path)
|
||||
|
|
Загрузка…
Ссылка в новой задаче