Ignore git submodules when calculating dirty files.

This is in keeping with git's default behavior for other porcelain
commands. It also makes it more tenable for projects to introduce
submodules instead of repo manifests without breaking git-cl upload
and similar tools.

Bug: 958499
Test: Run locally
Change-Id: Id9595271bf89aa8ba928026501a4c9487e5abf8e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1592572
Reviewed-by: Aaron Gable <agable@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Eli Ribble <eliribble@chromium.org>
changes/72/1592572/2
Eli Ribble 6 years ago committed by Commit Bot
parent a541b28d4e
commit 54434e7e1d

@ -777,7 +777,7 @@ def set_config(option, value, scope='local'):
def get_dirty_files(): def get_dirty_files():
# Make sure index is up-to-date before running diff-index. # Make sure index is up-to-date before running diff-index.
run_with_retcode('update-index', '--refresh', '-q') run_with_retcode('update-index', '--refresh', '-q')
return run('diff-index', '--name-status', 'HEAD') return run('diff-index', '--ignore-submodules', '--name-status', 'HEAD')
def is_dirty_git_tree(cmd): def is_dirty_git_tree(cmd):

Loading…
Cancel
Save