Browse Source

Fix git_common_test.py: git checkout -tb -> git checkout -t -b

git now takes an optional parameter for -t

Bug: 1288010
Change-Id: I0b7b212229f8df846a2d80a1632387982fd7358e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3395441
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Andrew Grieve 3 năm trước cách đây
mục cha
commit
cb340f5b7b
1 tập tin đã thay đổi với 7 bổ sung7 xóa
  1. 7 7
      tests/git_common_test.py

+ 7 - 7
tests/git_common_test.py

@@ -472,7 +472,7 @@ class GitMutableFunctionsTest(git_test_utils.GitRepoReadWriteTestBase,
     self.repo.git('commit', '--allow-empty', '-am', 'foooooo')
     self.assertEqual(self.repo.run(self.gc.upstream, 'bobly'), None)
     self.assertEqual(self.repo.run(self.gc.upstream, 'main'), None)
-    self.repo.git('checkout', '-tb', 'happybranch', 'main')
+    self.repo.git('checkout', '-t', '-b', 'happybranch', 'main')
     self.assertEqual(self.repo.run(self.gc.upstream, 'happybranch'),
                      'main')
 
@@ -482,12 +482,12 @@ class GitMutableFunctionsTest(git_test_utils.GitRepoReadWriteTestBase,
 
   def testGetBranchesInfo(self):
     self.repo.git('commit', '--allow-empty', '-am', 'foooooo')
-    self.repo.git('checkout', '-tb', 'happybranch', 'main')
+    self.repo.git('checkout', '-t', '-b', 'happybranch', 'main')
     self.repo.git('commit', '--allow-empty', '-am', 'foooooo')
-    self.repo.git('checkout', '-tb', 'child', 'happybranch')
+    self.repo.git('checkout', '-t', '-b', 'child', 'happybranch')
 
-    self.repo.git('checkout', '-tb', 'to_delete', 'main')
-    self.repo.git('checkout', '-tb', 'parent_gone', 'to_delete')
+    self.repo.git('checkout', '-t', '-b', 'to_delete', 'main')
+    self.repo.git('checkout', '-t', '-b', 'parent_gone', 'to_delete')
     self.repo.git('branch', '-D', 'to_delete')
 
     supports_track = (
@@ -527,7 +527,7 @@ class GitMutableFunctionsTest(git_test_utils.GitRepoReadWriteTestBase,
 
   def testGetBranchesInfoWithReset(self):
     self.repo.git('commit', '--allow-empty', '-am', 'foooooo')
-    self.repo.git('checkout','-tb', 'foobarA', 'main')
+    self.repo.git('checkout','-t', '-b', 'foobarA', 'main')
     self.repo.git('config', 'branch.foobarA.base',
       self.repo.run(self.gc.hash_one, 'main'))
     self.repo.git('config', 'branch.foobarA.base-upstream', 'main')
@@ -542,7 +542,7 @@ class GitMutableFunctionsTest(git_test_utils.GitRepoReadWriteTestBase,
     self.repo.git('add', 'foobar2')
     self.repo.git_commit('commit2')
 
-    self.repo.git('checkout','-tb', 'foobarB', 'foobarA')
+    self.repo.git('checkout','-t', '-b', 'foobarB', 'foobarA')
     self.repo.git('config', 'branch.foobarB.base',
       self.repo.run(self.gc.hash_one, 'foobarA'))
     self.repo.git('config', 'branch.foobarB.base-upstream', 'foobarA')