@@ -604,6 +604,26 @@ def test_uncommitted_changes(self):
604604 self .assertEqual ('uncommitted' , utils .read_file (self .MASTER_FILE ))
605605 self .assertEqual ('uncommitted' , utils .read_file ('master_untracked' ))
606606
607+ def test_uncommitted_tracked_changes_that_conflict (self ):
608+ gl .branch (c = 'tmp' , divergent_point = 'HEAD~1' )
609+ gl .switch ('tmp' )
610+ utils .write_file (self .MASTER_FILE , contents = 'uncommitted' )
611+ self .assertRaisesRegexp (
612+ ErrorReturnCode , 'failed to apply' , gl .merge , 'master' )
613+ contents = utils .read_file (self .MASTER_FILE )
614+ self .assertTrue ('uncommitted' in contents )
615+ self .assertTrue ('contents 2' in contents )
616+
617+ def test_uncommitted_tracked_changes_that_conflict_append (self ):
618+ gl .branch (c = 'tmp' , divergent_point = 'HEAD~1' )
619+ gl .switch ('tmp' )
620+ utils .append_to_file (self .MASTER_FILE , contents = 'uncommitted' )
621+ self .assertRaisesRegexp (
622+ ErrorReturnCode , 'failed to apply' , gl .merge , 'master' )
623+ contents = utils .read_file (self .MASTER_FILE )
624+ self .assertTrue ('uncommitted' in contents )
625+ self .assertTrue ('contents 2' in contents )
626+
607627
608628class TestPerformance (TestEndToEnd ):
609629
0 commit comments