@@ -355,15 +355,17 @@ async def test_status(tmp_path, output, diff_output, expected):
355355
356356 # Determine if this is a first commit scenario
357357 is_first_commit = expected .get ("branch" ) == "(initial)"
358-
358+
359359 # Build mock_execute.side_effect list
360360 # First: git status call
361361 # Second: git rev-parse --verify HEAD (for _is_first_commit)
362362 # Third: git diff call (with or without empty tree SHA based on is_first_commit)
363363 # Then: state detection calls (cherry pick, merge, rebase)
364364 mock_execute .side_effect = [
365365 maybe_future ((0 , "\x00 " .join (output ) + "\x00 " , "" )), # git status
366- maybe_future ((128 if is_first_commit else 0 , "" , "" )), # git rev-parse --verify HEAD
366+ maybe_future (
367+ (128 if is_first_commit else 0 , "" , "" )
368+ ), # git rev-parse --verify HEAD
367369 maybe_future ((0 , "\x00 " .join (diff_output ) + "\x00 " , "" )), # git diff
368370 maybe_future ((0 if expected ["state" ] == 4 else 128 , "" , "cherry pick" )),
369371 maybe_future ((0 if expected ["state" ] == 2 else 128 , "" , "merge" )),
@@ -399,7 +401,7 @@ async def test_status(tmp_path, output, diff_output, expected):
399401 is_binary = False ,
400402 ),
401403 ]
402-
404+
403405 # Add diff command based on whether it's first commit
404406 if is_first_commit :
405407 expected_calls .append (
@@ -438,46 +440,48 @@ async def test_status(tmp_path, output, diff_output, expected):
438440 is_binary = False ,
439441 )
440442 )
441-
443+
442444 # Add state detection calls
443- expected_calls .extend ([
444- call (
445- ["git" , "show" , "--quiet" , "CHERRY_PICK_HEAD" ],
446- cwd = str (repository ),
447- timeout = 20 ,
448- env = None ,
449- username = None ,
450- password = None ,
451- is_binary = False ,
452- ),
453- call (
454- ["git" , "show" , "--quiet" , "MERGE_HEAD" ],
455- cwd = str (repository ),
456- timeout = 20 ,
457- env = None ,
458- username = None ,
459- password = None ,
460- is_binary = False ,
461- ),
462- call (
463- ["git" , "rev-parse" , "--git-path" , "rebase-merge" ],
464- cwd = str (repository ),
465- timeout = 20 ,
466- env = None ,
467- username = None ,
468- password = None ,
469- is_binary = False ,
470- ),
471- call (
472- ["git" , "rev-parse" , "--git-path" , "rebase-apply" ],
473- cwd = str (repository ),
474- timeout = 20 ,
475- env = None ,
476- username = None ,
477- password = None ,
478- is_binary = False ,
479- ),
480- ])
445+ expected_calls .extend (
446+ [
447+ call (
448+ ["git" , "show" , "--quiet" , "CHERRY_PICK_HEAD" ],
449+ cwd = str (repository ),
450+ timeout = 20 ,
451+ env = None ,
452+ username = None ,
453+ password = None ,
454+ is_binary = False ,
455+ ),
456+ call (
457+ ["git" , "show" , "--quiet" , "MERGE_HEAD" ],
458+ cwd = str (repository ),
459+ timeout = 20 ,
460+ env = None ,
461+ username = None ,
462+ password = None ,
463+ is_binary = False ,
464+ ),
465+ call (
466+ ["git" , "rev-parse" , "--git-path" , "rebase-merge" ],
467+ cwd = str (repository ),
468+ timeout = 20 ,
469+ env = None ,
470+ username = None ,
471+ password = None ,
472+ is_binary = False ,
473+ ),
474+ call (
475+ ["git" , "rev-parse" , "--git-path" , "rebase-apply" ],
476+ cwd = str (repository ),
477+ timeout = 20 ,
478+ env = None ,
479+ username = None ,
480+ password = None ,
481+ is_binary = False ,
482+ ),
483+ ]
484+ )
481485
482486 if expected ["state" ] == 4 :
483487 expected_calls = expected_calls [:- 3 ]
0 commit comments