From cb340f5b7bbdcaba0fad346b08db91538619a531 Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Tue, 18 Jan 2022 19:42:54 +0000 Subject: [PATCH] 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 Reviewed-by: Dirk Pranke Commit-Queue: Dirk Pranke --- tests/git_common_test.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/git_common_test.py b/tests/git_common_test.py index 99ea120eda..3d4d60ac8d 100755 --- a/tests/git_common_test.py +++ b/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')