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
diff --git a/git_cl/git_cl.py b/git_cl/git_cl.py
index ea12382..b88f27c 100644
--- a/git_cl/git_cl.py
+++ b/git_cl/git_cl.py
@@ -859,6 +859,8 @@
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