@@ -313,7 +313,7 @@ async def test_git_push_fail():
313
313
314
314
# Then
315
315
mock_execute .assert_called_once_with (
316
- ["git" , "push" , "test_origin" , "HEAD:test_master" ],
316
+ ["git" , "push" , "--tags" , " test_origin" , "HEAD:test_master" ],
317
317
cwd = "test_curr_path" ,
318
318
timeout = 20 ,
319
319
env = {"TEST" : "test" , "GIT_TERMINAL_PROMPT" : "0" },
@@ -345,7 +345,7 @@ async def test_git_push_with_auth_fail():
345
345
346
346
# Then
347
347
mock_execute_with_authentication .assert_called_once_with (
348
- ["git" , "push" , "test_origin" , "HEAD:test_master" ],
348
+ ["git" , "push" , "--tags" , " test_origin" , "HEAD:test_master" ],
349
349
cwd = "test_curr_path" ,
350
350
timeout = 20 ,
351
351
env = {"TEST" : "test" , "GIT_TERMINAL_PROMPT" : "1" },
@@ -374,7 +374,7 @@ async def test_git_push_success():
374
374
375
375
# Then
376
376
mock_execute .assert_called_once_with (
377
- ["git" , "push" , "." , "HEAD:test_master" ],
377
+ ["git" , "push" , "--tags" , " ." , "HEAD:test_master" ],
378
378
cwd = "test_curr_path" ,
379
379
timeout = 20 ,
380
380
env = {"TEST" : "test" , "GIT_TERMINAL_PROMPT" : "0" },
@@ -403,7 +403,7 @@ async def test_git_push_with_auth_success():
403
403
404
404
# Then
405
405
mock_execute_with_authentication .assert_called_once_with (
406
- ["git" , "push" , "." , "HEAD:test_master" ],
406
+ ["git" , "push" , "--tags" , " ." , "HEAD:test_master" ],
407
407
cwd = "test_curr_path" ,
408
408
timeout = 20 ,
409
409
env = {"TEST" : "test" , "GIT_TERMINAL_PROMPT" : "1" },
@@ -466,7 +466,7 @@ async def test_git_push_with_auth_and_cache_credentials():
466
466
is_binary = False ,
467
467
),
468
468
call (
469
- ["git" , "push" , "." , "HEAD:test_master" ],
469
+ ["git" , "push" , "--tags" , " ." , "HEAD:test_master" ],
470
470
cwd = test_path ,
471
471
timeout = 20 ,
472
472
env = {** os .environ , "GIT_TERMINAL_PROMPT" : "1" },
@@ -511,7 +511,7 @@ async def test_git_push_with_auth_and_cache_credentials_and_existing_credential_
511
511
is_binary = False ,
512
512
),
513
513
call (
514
- ["git" , "push" , "." , "HEAD:test_master" ],
514
+ ["git" , "push" , "--tags" , " ." , "HEAD:test_master" ],
515
515
cwd = test_path ,
516
516
timeout = 20 ,
517
517
env = {** os .environ , "GIT_TERMINAL_PROMPT" : "1" },
@@ -522,3 +522,29 @@ async def test_git_push_with_auth_and_cache_credentials_and_existing_credential_
522
522
]
523
523
)
524
524
assert {"code" : 0 , "message" : "" } == actual_response
525
+
526
+
527
+ @pytest .mark .asyncio
528
+ async def test_git_push_no_tags_success ():
529
+ with patch ("os.environ" , {"TEST" : "test" }):
530
+ with patch ("jupyterlab_git.git.execute" ) as mock_execute :
531
+ # Given
532
+ output = "output"
533
+ mock_execute .return_value = maybe_future ((0 , output , "does not matter" ))
534
+
535
+ # When
536
+ actual_response = await Git ().push (
537
+ "." , "HEAD:test_master" , "test_curr_path" , tags = False
538
+ )
539
+
540
+ # Then
541
+ mock_execute .assert_called_once_with (
542
+ ["git" , "push" , "." , "HEAD:test_master" ],
543
+ cwd = "test_curr_path" ,
544
+ timeout = 20 ,
545
+ env = {"TEST" : "test" , "GIT_TERMINAL_PROMPT" : "0" },
546
+ username = None ,
547
+ password = None ,
548
+ is_binary = False ,
549
+ )
550
+ assert {"code" : 0 , "message" : output } == actual_response
0 commit comments