Index: third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py |
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py |
index dc790442463defccbd0b90f9f4ab79a8fd9d93aa..1f8effd8d9d03f9957efce860a00aa0c98980d77 100644 |
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py |
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py |
@@ -121,9 +121,12 @@ class Git(SCM): |
""" |
# `git status -z` is a version of `git status -s`, that's recommended |
# for machine parsing. Lines are terminated with NUL rather than LF. |
+ change_lines = self._run_git(['status', '-z']).rstrip('\x00') |
+ if not change_lines: |
+ return {} # No changes. |
unstaged_changes = {} |
qyearsley
2016/12/28 18:47:20
Here, if there are no changes, then change_lines i
|
- change_lines = self._run_git(['status', '-z']).rstrip('\x00').split('\x00') |
- for line in change_lines: |
+ for line in change_lines.split('\x00'): |
+ assert len(line) > 4, 'Unexpected change line format %s' % line |
if line[1] == ' ': |
continue # Already staged for commit. |
path = line[3:] |