Skip to content

Commit 4a1f035

Browse files
committed
fixup! Fix repo.Stage("*") behavior
1 parent 38e2107 commit 4a1f035

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

LibGit2Sharp/Repository.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,10 +1502,18 @@ public void Stage(IEnumerable<string> paths, StageOptions stageOptions)
15021502
RemoveFromIndex(treeEntryChanges.Path);
15031503
}
15041504

1505-
foreach (TreeEntryChanges treeEntryChanges in changes
1506-
.Where(tec => tec.Status == ChangeKind.Added || tec.Status == ChangeKind.Modified))
1505+
foreach (TreeEntryChanges treeEntryChanges in changes)
15071506
{
1508-
AddToIndex(treeEntryChanges.Path);
1507+
switch (treeEntryChanges.Status)
1508+
{
1509+
case ChangeKind.Added:
1510+
case ChangeKind.Modified:
1511+
AddToIndex(treeEntryChanges.Path);
1512+
break;
1513+
1514+
default:
1515+
continue;
1516+
}
15091517
}
15101518

15111519
UpdatePhysicalIndex();

0 commit comments

Comments
 (0)