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.


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
diff --git a/git_common.py b/git_common.py
index 9d9f464..2b7d258 100644
--- a/git_common.py
+++ b/git_common.py
@@ -92,9 +92,10 @@
-# First version where the for-each-ref command's format string supported the
-# upstream:track token.
+# 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.
 class BadCommitRefException(Exception):
   def __init__(self, refs):
diff --git a/tests/git_common_test.py b/tests/git_common_test.py
index ff5348c..e7ec3b4 100755
--- a/tests/git_common_test.py
+++ b/tests/git_common_test.py
@@ -391,7 +391,6 @@
         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 @@
         'parent_gone': (
             self.repo.run(self.gc.hash_one, 'parent_gone', short=True),
-            1 if supports_track else None,
+            None,
         'to_delete': None