@@ -120,7 +120,8 @@ async def test_checkout_branch_noref_failure():
120
120
121
121
@pytest .mark .asyncio
122
122
async def test_checkout_branch_remoteref_success ():
123
- branch = "test-branch"
123
+ branch = "origin/test-branch"
124
+ local_branch = "test-branch"
124
125
curr_path = str (Path ("/bin/test_curr_path" ))
125
126
stdout_message = "checkout output from git"
126
127
stderr_message = ""
@@ -145,7 +146,7 @@ async def test_checkout_branch_remoteref_success():
145
146
# Then
146
147
mock__get_branch_reference .assert_has_calls ([call (branch , curr_path )])
147
148
148
- cmd = ["git" , "checkout" , "--track" , branch ]
149
+ cmd = ["git" , "checkout" , "-B" , local_branch , branch ]
149
150
mock_execute .assert_called_once_with (
150
151
cmd ,
151
152
cwd = str (Path ("/bin" ) / "test_curr_path" ),
@@ -229,7 +230,8 @@ async def test_checkout_branch_headsref_success():
229
230
230
231
@pytest .mark .asyncio
231
232
async def test_checkout_branch_remoteref_failure ():
232
- branch = "test-branch"
233
+ branch = "origin/test-branch"
234
+ local_branch = "test-branch"
233
235
stdout_message = ""
234
236
stderr_message = (
235
237
"error: pathspec '{}' did not match any file(s) known to git" .format (branch )
@@ -253,7 +255,7 @@ async def test_checkout_branch_remoteref_failure():
253
255
)
254
256
255
257
# Then
256
- cmd = ["git" , "checkout" , "--track" , branch ]
258
+ cmd = ["git" , "checkout" , "-B" , local_branch , branch ]
257
259
mock_execute .assert_called_once_with (
258
260
cmd ,
259
261
cwd = str (Path ("/bin" ) / "test_curr_path" ),
0 commit comments