From 58d05b08925249b5b18c5cccfedbf71f8f1d0b3e Mon Sep 17 00:00:00 2001 From: "raphael.kubo.da.costa@intel.com" Date: Wed, 24 Jun 2015 08:54:41 +0000 Subject: [PATCH] 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 --- git_common.py | 7 ++++--- tests/git_common_test.py | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/git_common.py b/git_common.py index 9d9f46415a..2b7d258f60 100644 --- a/git_common.py +++ b/git_common.py @@ -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): diff --git a/tests/git_common_test.py b/tests/git_common_test.py index ff5348c191..e7ec3b425f 100755 --- a/tests/git_common_test.py +++ b/tests/git_common_test.py @@ -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