Bug 1658626 - When listing files from git in mozversioncontrol, ignore empty paths r=froydnj,mhentges
Without this patch, the last "path" in this list will always be the empty string due to how the `-z` option to `git` works. This mirrors what we already do in the `get_files_in_working_directory` implementation for `hg`. Differential Revision: https://phabricator.services.mozilla.com/D86752
This commit is contained in:
@@ -550,7 +550,7 @@ class GitRepository(Repository):
|
||||
self._run('reset', *paths)
|
||||
|
||||
def get_files_in_working_directory(self):
|
||||
return self._run('ls-files', '-z').split('\0')
|
||||
return [p for p in self._run('ls-files', '-z').split('\0') if p]
|
||||
|
||||
def working_directory_clean(self, untracked=False, ignored=False):
|
||||
args = ['status', '--porcelain']
|
||||
|
||||
Reference in New Issue
Block a user