File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,7 +23,10 @@ def get_root():
2323
2424
2525def is_in_merge_conflict ():
26- return os .path .exists (os .path .join ('.git' , 'MERGE_MSG' ))
26+ return (
27+ os .path .exists (os .path .join ('.git' , 'MERGE_MSG' )) and
28+ os .path .exists (os .path .join ('.git' , 'MERGE_HEAD' ))
29+ )
2730
2831
2932def parse_merge_msg_for_conflicts (merge_msg ):
Original file line number Diff line number Diff line change @@ -14,14 +14,21 @@ def test_get_root(empty_git_dir):
1414 assert git .get_root () == empty_git_dir
1515
1616
17- def test_is_in_merge_conflict (empty_git_dir ):
17+ def test_is_not_in_merge_conflict (empty_git_dir ):
1818 assert git .is_in_merge_conflict () is False
1919
2020
21- def test_is_not_in_merge_conflict (in_merge_conflict ):
21+ def test_is_in_merge_conflict (in_merge_conflict ):
2222 assert git .is_in_merge_conflict () is True
2323
2424
25+ def test_cherry_pick_conflict (in_merge_conflict ):
26+ local ['git' ]('merge' , '--abort' )
27+ foo_ref = local ['git' ]('rev-parse' , 'foo' ).strip ()
28+ local ['git' ]('cherry-pick' , foo_ref , retcode = None )
29+ assert git .is_in_merge_conflict () is False
30+
31+
2532@pytest .fixture
2633def get_files_matching_func ():
2734 def get_filenames ():
You can’t perform that action at this time.
0 commit comments