mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Return early when no merge base commit
This commit is contained in:
parent
90449ae147
commit
1d2e618e5b
1 changed files with 4 additions and 6 deletions
|
@ -143,12 +143,7 @@ class FileList(object):
|
|||
self.excluded = exclude_dirs
|
||||
self.generator = self._filter_excluded() if exclude_dirs else self._default_walk()
|
||||
if only_changed_files:
|
||||
try:
|
||||
# Fall back if git doesn't work
|
||||
self.generator = self._git_changed_files()
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
|
||||
self.generator = self._git_changed_files()
|
||||
if progress:
|
||||
self.generator = progress_wrapper(self.generator)
|
||||
|
||||
|
@ -160,6 +155,9 @@ class FileList(object):
|
|||
def _git_changed_files(self):
|
||||
args = ["git", "log", "-n1", "--merges", "--format=%H"]
|
||||
last_merge = subprocess.check_output(args, universal_newlines=True).strip()
|
||||
if not last_merge:
|
||||
return
|
||||
|
||||
args = ["git", "diff", "--name-only", last_merge, self.directory]
|
||||
file_list = normilize_paths(subprocess.check_output(args, universal_newlines=True).splitlines())
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue