Fix ancestor check
Before, for the common case that the actual_merge_base was already set
as base, the check for is_ancestor(base, actual_merge_base) would have
caused the base to be re-set.
This is a writing operation, which causes trouble e.g. for the parallel
operation of 'git cl status'.
[email protected], [email protected]
BUG=
Review URL: https://codereview.chromium.org/1888213004
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300003 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/git_common.py b/git_common.py
index bef628e..b7626e8 100644
--- a/git_common.py
+++ b/git_common.py
@@ -437,7 +437,7 @@
def is_ancestor(a, b):
return run_with_retcode('merge-base', '--is-ancestor', a, b) == 0
- if base:
+ if base and base != actual_merge_base:
if not is_ancestor(base, branch):
logging.debug('Found WRONG pre-set merge-base for %s: %s', branch, base)
base = None