Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3360)

Unified Diff: tests/gclient_scm_test.py

Issue 549733002: Fix gclient branch ref mangling and allow --force branch switches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: lint Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scm.py ('k') | tests/scm_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/gclient_scm_test.py
diff --git a/tests/gclient_scm_test.py b/tests/gclient_scm_test.py
index a14ae35ca0e440982701f2cfa38eaf148849ded0..60d688d2dde0e108e479e04b768fd1092cc108ac 100755
--- a/tests/gclient_scm_test.py
+++ b/tests/gclient_scm_test.py
@@ -1561,7 +1561,7 @@ class UnmanagedGitWrapperTestCase(BaseGitWrapperTestCase):
rmtree(origin_root_dir)
- def testUpdateCloneOnDetachedBranch(self):
+ def testUpdateCloneOnFetchedRemoteBranch(self):
if not self.enabled:
return
options = self.Options()
@@ -1593,7 +1593,7 @@ class UnmanagedGitWrapperTestCase(BaseGitWrapperTestCase):
rmtree(origin_root_dir)
- def testUpdateCloneOnBranchHead(self):
+ def testUpdateCloneOnTrueRemoteBranch(self):
if not self.enabled:
return
options = self.Options()
@@ -1618,9 +1618,17 @@ class UnmanagedGitWrapperTestCase(BaseGitWrapperTestCase):
self.assertEquals(file_list, expected_file_list)
self.assertEquals(scm.revinfo(options, (), None),
'9a51244740b25fa2ded5252ca00a3178d3f665a9')
- self.assertEquals(self.getCurrentBranch(), 'feature')
- self.checkNotInStdout(
- 'Checked out refs/heads/feature to a detached HEAD')
+ # @refs/heads/feature is AKA @refs/remotes/origin/feature in the clone, so
+ # should be treated as such by gclient.
+ # TODO(mmoss): Though really, we should only allow DEPS to specify branches
+ # as they are known in the upstream repo, since the mapping into the local
+ # repo can be modified by users (or we might even want to change the gclient
+ # defaults at some point). But that will take more work to stop using
+ # refs/remotes/ everywhere that we do (and to stop assuming a DEPS ref will
+ # always resolve locally, like when passing them to show-ref or rev-list).
+ self.assertEquals(self.getCurrentBranch(), None)
+ self.checkInStdout(
+ 'Checked out refs/remotes/origin/feature to a detached HEAD')
rmtree(origin_root_dir)
« no previous file with comments | « scm.py ('k') | tests/scm_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698