gclient: Fix applying patches to branch heads.
Bug: 956807
Change-Id: I2eed6db1f338806812fca778986d51b0a007eddd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1592577
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
diff --git a/tests/gclient_scm_test.py b/tests/gclient_scm_test.py
index 6ae2ff9..d2305ff 100755
--- a/tests/gclient_scm_test.py
+++ b/tests/gclient_scm_test.py
@@ -1201,8 +1201,8 @@
scm = gclient_scm.GitWrapper(self.url, self.root_dir, '.')
file_list = []
- # Sync to origin/feature
- self.options.revision = 'origin/feature'
+ # Sync to remote's refs/heads/feature
+ self.options.revision = 'refs/heads/feature'
scm.update(self.options, None, file_list)
self.assertEqual(self.githash('repo_1', 9), self.gitrevparse(self.root_dir))
@@ -1219,7 +1219,7 @@
scm = gclient_scm.GitWrapper(self.url, self.root_dir, '.')
file_list = []
- # Sync to origin/feature on an old revision
+ # Sync to remote's refs/heads/feature on an old revision
self.options.revision = self.githash('repo_1', 7)
scm.update(self.options, None, file_list)
self.assertEqual(self.githash('repo_1', 7), self.gitrevparse(self.root_dir))
@@ -1229,8 +1229,8 @@
file_list)
# We shouldn't have rebased on top of 2 (which is the merge base between
- # origin/master and the change) but on top of 7 (which is the merge base
- # between origin/feature and the change).
+ # remote's master branch and the change) but on top of 7 (which is the
+ # merge base between remote's feature branch and the change).
self.assertCommits([1, 2, 7, 10])
self.assertEqual(self.githash('repo_1', 7), self.gitrevparse(self.root_dir))
@@ -1238,18 +1238,18 @@
scm = gclient_scm.GitWrapper(self.url, self.root_dir, '.')
file_list = []
- # Sync to the hash instead of 'origin/feature'
+ # Sync to the hash instead of remote's refs/heads/feature.
self.options.revision = self.githash('repo_1', 9)
scm.update(self.options, None, file_list)
self.assertEqual(self.githash('repo_1', 9), self.gitrevparse(self.root_dir))
- # Apply refs/changes/34/1234/1, created for branch 'origin/master' on top of
- # 'origin/feature'.
- scm.apply_patch_ref(self.url, 'refs/changes/35/1235/1', 'origin/master',
+ # Apply refs/changes/34/1234/1, created for remote's master branch on top of
+ # remote's feature branch.
+ scm.apply_patch_ref(self.url, 'refs/changes/35/1235/1', 'refs/heads/master',
self.options, file_list)
# Commits 5 and 6 are part of the patch, and commits 1, 2, 7, 8 and 9 are
- # part of 'origin/feature'.
+ # part of remote's feature branch.
self.assertCommits([1, 2, 5, 6, 7, 8, 9])
self.assertEqual(self.githash('repo_1', 9), self.gitrevparse(self.root_dir))