@@ -1656,6 +1656,7 @@ public void Stage(IEnumerable<string> paths, StageOptions stageOptions)
1656
1656
. Where (
1657
1657
tec => tec . Status != ChangeKind . Added &&
1658
1658
tec . Status != ChangeKind . Modified &&
1659
+ tec . Status != ChangeKind . Conflicted &&
1659
1660
tec . Status != ChangeKind . Unmodified &&
1660
1661
tec . Status != ChangeKind . Deleted ) . ToList ( ) ;
1661
1662
@@ -1667,10 +1668,25 @@ public void Stage(IEnumerable<string> paths, StageOptions stageOptions)
1667
1668
unexpectedTypesOfChanges [ 0 ] . Path , unexpectedTypesOfChanges [ 0 ] . Status ) ) ;
1668
1669
}
1669
1670
1670
- foreach ( TreeEntryChanges treeEntryChanges in changes
1671
- . Where ( tec => tec . Status == ChangeKind . Deleted ) )
1671
+ /* Remove files from the index that don't exist on disk */
1672
+ foreach ( TreeEntryChanges treeEntryChanges in changes )
1672
1673
{
1673
- RemoveFromIndex ( treeEntryChanges . Path ) ;
1674
+ switch ( treeEntryChanges . Status )
1675
+ {
1676
+ case ChangeKind . Conflicted :
1677
+ if ( ! treeEntryChanges . Exists )
1678
+ {
1679
+ RemoveFromIndex ( treeEntryChanges . Path ) ;
1680
+ }
1681
+ break ;
1682
+
1683
+ case ChangeKind . Deleted :
1684
+ RemoveFromIndex ( treeEntryChanges . Path ) ;
1685
+ break ;
1686
+
1687
+ default :
1688
+ continue ;
1689
+ }
1674
1690
}
1675
1691
1676
1692
foreach ( TreeEntryChanges treeEntryChanges in changes )
@@ -1682,6 +1698,13 @@ public void Stage(IEnumerable<string> paths, StageOptions stageOptions)
1682
1698
AddToIndex ( treeEntryChanges . Path ) ;
1683
1699
break ;
1684
1700
1701
+ case ChangeKind . Conflicted :
1702
+ if ( treeEntryChanges . Exists )
1703
+ {
1704
+ AddToIndex ( treeEntryChanges . Path ) ;
1705
+ }
1706
+ break ;
1707
+
1685
1708
default :
1686
1709
continue ;
1687
1710
}
0 commit comments