Commit c76e675f authored by chase@chromium.org's avatar chase@chromium.org

Update the index in SendUpstream before tree check.

BUG=none
TEST=git cl dcommit/push performs an index update before
checking if the tree is dirty
Review URL: http://codereview.chromium.org/6172003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@70908 0039d316-1c4b-4281-b951-d872f2087c98
parent 5d0dc43e
......@@ -859,6 +859,8 @@ def SendUpstream(parser, args, cmd):
base_branch = args[0]
# Make sure index is up-to-date before running diff-index.
RunGit(['update-index', '--refresh', '-q'], error_ok=True)
if RunGit(['diff-index', 'HEAD']):
print 'Cannot %s with a dirty tree. You must commit locally first.' % cmd
return 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment