Skip to content

Commit 65c9b1c

Browse files
committed
Manually marshal file path in status callback
1 parent 5704973 commit 65c9b1c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

LibGit2Sharp/Core/NativeMethods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ public static extern int git_status_file(
614614
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(FilePathMarshaler))] FilePath filepath);
615615

616616
internal delegate int status_callback(
617-
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(FilePathMarshaler))] FilePath statuspath,
617+
IntPtr statuspath,
618618
uint statusflags,
619619
IntPtr payload);
620620

LibGit2Sharp/RepositoryStatus.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ internal RepositoryStatus(Repository repo)
4444
isDirty = statusEntries.Any(entry => entry.State != FileStatus.Ignored);
4545
}
4646

47-
private int StateChanged(FilePath filePath, uint state, IntPtr payload)
47+
private int StateChanged(IntPtr filePathPtr, uint state, IntPtr payload)
4848
{
49+
var filePath = FilePathMarshaler.FromNative(filePathPtr);
4950
var gitStatus = (FileStatus)state;
5051
statusEntries.Add(new StatusEntry(filePath.Native, gitStatus));
5152

0 commit comments

Comments
 (0)