aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy/servo_tidy
diff options
context:
space:
mode:
authorKagami Sascha Rosylight <saschanaz@outlook.com>2020-06-21 05:00:49 +0200
committerKagami Sascha Rosylight <saschanaz@outlook.com>2020-06-21 05:26:55 +0200
commit1d2e618e5bc9ea3532a184d87789330a6761e4e4 (patch)
treecb9bb49d9f76baebd47e81f42ea5c0b616991c3a /python/tidy/servo_tidy
parent90449ae147620dc88b699a1fc5c16aaa90102022 (diff)
downloadservo-1d2e618e5bc9ea3532a184d87789330a6761e4e4.tar.gz
servo-1d2e618e5bc9ea3532a184d87789330a6761e4e4.zip
Return early when no merge base commit
Diffstat (limited to 'python/tidy/servo_tidy')
-rw-r--r--python/tidy/servo_tidy/tidy.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py
index 3e1806451c2..d77de5b9269 100644
--- a/python/tidy/servo_tidy/tidy.py
+++ b/python/tidy/servo_tidy/tidy.py
@@ -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())