Unskip testGetBranchesInfo().

It is not clear why it was skipped in r293502, but it was problematic
before that as it can be seen from CL 802403003.

The reason for the different results (and likely the reason why the test
was skipped) is that the handling of the %(upstream:track) and
%(upstream:trackhort) formatting tags was broken in git itself until
version 2.3.0. This was fixed in git commit b6160d95, and the fix shows
that the test expectations in testGetBranchesInfo() were actually wrong
in one of the cases.

Fix the expectations and make sure we only use %(upstream:track) in the
test when a suitable git version is present.

R=pgervais@chromium.org,iannucci@chromium.org

Review URL: https://codereview.chromium.org/1195933003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295814 0039d316-1c4b-4281-b951-d872f2087c98
changes/01/332501/1
raphael.kubo.da.costa@intel.com 10 years ago
parent 39a23508dc
commit 58d05b0892

@ -92,9 +92,10 @@ GIT_TRANSIENT_ERRORS = (
GIT_TRANSIENT_ERRORS_RE = re.compile('|'.join(GIT_TRANSIENT_ERRORS),
re.IGNORECASE)
# First version where the for-each-ref command's format string supported the
# upstream:track token.
MIN_UPSTREAM_TRACK_GIT_VERSION = (1, 9)
# git's for-each-ref command first supported the upstream:track token in its
# format string in version 1.9.0, but some usages were broken until 2.3.0.
# See git commit b6160d95 for more information.
MIN_UPSTREAM_TRACK_GIT_VERSION = (2, 3)
class BadCommitRefException(Exception):
def __init__(self, refs):

@ -391,7 +391,6 @@ class GitMutableFunctionsTest(git_test_utils.GitRepoReadWriteTestBase,
self.assertTrue(all(
isinstance(x, int) for x in self.repo.run(self.gc.get_git_version)))
@unittest.expectedFailure
def testGetBranchesInfo(self):
self.repo.git('commit', '--allow-empty', '-am', 'foooooo')
self.repo.git('checkout', '-tb', 'happybranch', 'master')
@ -430,7 +429,7 @@ class GitMutableFunctionsTest(git_test_utils.GitRepoReadWriteTestBase,
'parent_gone': (
self.repo.run(self.gc.hash_one, 'parent_gone', short=True),
'to_delete',
1 if supports_track else None,
None,
None
),
'to_delete': None

Loading…
Cancel
Save