Commit c3fe99d8 authored by clemensh@chromium.org's avatar clemensh@chromium.org

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'.

R=iannucci@chromium.org, tandrii@chromium.org
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
parent 0b2d7072
......@@ -437,7 +437,7 @@ def get_or_create_merge_base(branch, parent=None):
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
......
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