@@ -29,19 +29,22 @@ def test_master_branch(temp_git_dir):
2929 assert is_on_branch ('master' ) is True
3030
3131
32- def test_main_b_call (temp_git_dir ):
33- with temp_git_dir .as_cwd ():
34- cmd_output ('git' , 'checkout' , '-b' , 'other' )
35- assert main (['-b' , 'other' ]) == 1
36-
37-
3832def test_main_branch_call (temp_git_dir ):
3933 with temp_git_dir .as_cwd ():
4034 cmd_output ('git' , 'checkout' , '-b' , 'other' )
41- assert main ([ '--branch' , 'other' ] ) == 1
35+ assert main (( '--branch' , 'other' ) ) == 1
4236
4337
4438def test_main_default_call (temp_git_dir ):
4539 with temp_git_dir .as_cwd ():
4640 cmd_output ('git' , 'checkout' , '-b' , 'anotherbranch' )
47- assert main () == 0
41+ assert main (()) == 0
42+
43+
44+ def test_not_on_a_branch (temp_git_dir ):
45+ with temp_git_dir .as_cwd ():
46+ cmd_output ('git' , 'commit' , '--no-gpg-sign' , '--allow-empty' , '-m1' )
47+ head = cmd_output ('git' , 'rev-parse' , 'HEAD' ).strip ()
48+ cmd_output ('git' , 'checkout' , head )
49+ # we're not on a branch!
50+ assert main (()) == 0
0 commit comments