From c76e675fb5b32f4baf9ee41b3f8cd68aba72bc07 Mon Sep 17 00:00:00 2001 From: "chase@chromium.org" Date: Mon, 10 Jan 2011 18:17:12 +0000 Subject: [PATCH] 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 --- git_cl/git_cl.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git_cl/git_cl.py b/git_cl/git_cl.py index ea1238261d..b88f27cecf 100644 --- a/git_cl/git_cl.py +++ b/git_cl/git_cl.py @@ -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