Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions LibGit2Sharp/Core/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,11 @@ internal static extern int git_index_remove(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(FilePathMarshaler))] FilePath path,
int stage);

[DllImport(libgit2)]
internal static extern int git_index_remove_bypath(
IndexSafeHandle index,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(FilePathMarshaler))] FilePath path);

[DllImport(libgit2)]
internal static extern int git_index_write(IndexSafeHandle index);

Expand Down
9 changes: 9 additions & 0 deletions LibGit2Sharp/Core/Proxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,15 @@ public static void git_index_remove(IndexSafeHandle index, FilePath path, int st
}
}

public static void git_index_remove_bypath(IndexSafeHandle index, FilePath path)
{
using (ThreadAffinity())
{
int res = NativeMethods.git_index_remove_bypath(index, path);
Ensure.ZeroResult(res);
}
}

public static void git_index_write(IndexSafeHandle index)
{
using (ThreadAffinity())
Expand Down
2 changes: 1 addition & 1 deletion LibGit2Sharp/Index.cs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ private void AddToIndex(string relativePath)

private void RemoveFromIndex(string relativePath)
{
Proxy.git_index_remove(handle, relativePath, 0);
Proxy.git_index_remove_bypath(handle, relativePath);
}

private void UpdatePhysicalIndex()
Expand Down