Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1290)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py

Issue 2397573002: Don't track SCM changes in rebaseline commands. (Closed)
Patch Set: Update message and docstring for has_working_directory_changes Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 29620fb700f71600e7601d9af6d89906750f27db..d212f00072479e8011c9ad4fa6d69c84b66261fd 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
@@ -99,8 +99,12 @@ class Git(SCM):
def _rebase_in_progress(self):
return self._filesystem.exists(self.absolute_path(self._filesystem.join('.git', 'rebase-apply')))
- def has_working_directory_changes(self):
- return self._run_git(['diff', 'HEAD', '--no-renames', '--name-only']) != ""
+ def has_working_directory_changes(self, pathspec=None):
+ """Checks whether there are uncommitted changes."""
+ command = ['diff', 'HEAD', '--no-renames', '--name-only']
+ if pathspec:
+ command.extend(['--', pathspec])
+ return self._run_git(command) != ''
def _discard_working_directory_changes(self):
# Could run git clean here too, but that wouldn't match subversion
@@ -117,6 +121,12 @@ class Git(SCM):
def _status_regexp(self, expected_types):
return '^(?P<status>[%s])\t(?P<filename>.+)$' % expected_types
+ def add_all(self, pathspec=None):
+ command = ['add', '--all']
+ if pathspec:
+ command.append(pathspec)
+ return self._run_git(command)
+
def add_list(self, paths, return_exit_code=False, recurse=True):
return self._run_git(["add"] + paths, return_exit_code=return_exit_code)

Powered by Google App Engine
This is Rietveld 408576698