-
Notifications
You must be signed in to change notification settings - Fork 896
/
Copy pathGitMergeDriver.cs
57 lines (49 loc) · 1.91 KB
/
GitMergeDriver.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Runtime.InteropServices;
namespace LibGit2Sharp.Core
{
[StructLayout(LayoutKind.Sequential)]
internal struct GitMergeDriver
{
/** The `version` should be set to `GIT_MERGE_DRIVER_VERSION`. */
public uint version;
/** Called when the merge driver is first used for any file. */
[MarshalAs(UnmanagedType.FunctionPtr)]
public git_merge_driver_init_fn initialize;
/** Called when the merge driver is unregistered from the system. */
[MarshalAs(UnmanagedType.FunctionPtr)]
public git_merge_driver_shutdown_fn shutdown;
/**
* Called to merge the contents of a conflict. If this function
* returns `GIT_PASSTHROUGH` then the default (`text`) merge driver
* will instead be invoked. If this function returns
* `GIT_EMERGECONFLICT` then the file will remain conflicted.
*/
[MarshalAs(UnmanagedType.FunctionPtr)]
public git_merge_driver_apply_fn apply;
internal delegate int git_merge_driver_init_fn(IntPtr merge_driver);
internal delegate void git_merge_driver_shutdown_fn(IntPtr merge_driver);
/** Called when the merge driver is invoked due to a file level merge conflict. */
internal delegate int git_merge_driver_apply_fn(
IntPtr merge_driver,
IntPtr path_out,
UIntPtr mode_out,
IntPtr merged_out,
IntPtr driver_name,
IntPtr merge_driver_source
);
}
/// <summary>
/// The file source being merged
/// </summary>
[StructLayout(LayoutKind.Sequential)]
internal unsafe struct git_merge_driver_source
{
public git_repository* repository;
readonly char *default_driver;
readonly IntPtr file_opts;
public git_index_entry* ancestor;
public git_index_entry* ours;
public git_index_entry* theirs;
}
}