-
Notifications
You must be signed in to change notification settings - Fork 892
/
Copy pathMergeOptionsBase.cs
96 lines (85 loc) · 3.22 KB
/
MergeOptionsBase.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
namespace LibGit2Sharp
{
/// <summary>
/// Options controlling the behavior of actions that use merge (merge
/// proper, cherry-pick, revert)
/// </summary>
public abstract class MergeOptionsBase
{
/// <summary>
/// Initializes a new instance of the <see cref="MergeOptionsBase"/> class.
/// The default behavior is to attempt to find renames.
/// </summary>
protected MergeOptionsBase()
{
FindRenames = true;
RenameThreshold = 50;
TargetLimit = 200;
}
/// <summary>
/// Find renames. Default is true.
/// </summary>
public bool FindRenames { get; set; }
/// <summary>
/// If set, do not create or return conflict entries, but stop and return
/// an error result after finding the first conflict.
/// </summary>
public bool FailOnConflict { get; set; }
/// <summary>
/// Do not write the Resolve Undo Cache extension on the generated index. This can
/// be useful when no merge resolution will be presented to the user (e.g. a server-side
/// merge attempt).
/// </summary>
public bool SkipReuc { get; set; }
/// <summary>
/// Similarity to consider a file renamed.
/// </summary>
public int RenameThreshold;
/// <summary>
/// Maximum similarity sources to examine (overrides
/// 'merge.renameLimit' config (default 200)
/// </summary>
public int TargetLimit;
/// <summary>
/// How to handle conflicts encountered during a merge.
/// </summary>
public MergeFileFavor MergeFileFavor { get; set; }
/// <summary>
/// Ignore changes in amount of whitespace
/// </summary>
public bool IgnoreWhitespaceChange { get; set; }
}
/// <summary>
/// Enum specifying how merge should deal with conflicting regions
/// of the files.
/// </summary>
public enum MergeFileFavor
{
/// <summary>
/// When a region of a file is changed in both branches, a conflict
/// will be recorded in the index so that the checkout operation can produce
/// a merge file with conflict markers in the working directory.
/// This is the default.
/// </summary>
Normal = 0,
/// <summary>
/// When a region of a file is changed in both branches, the file
/// created in the index will contain the "ours" side of any conflicting
/// region. The index will not record a conflict.
/// </summary>
Ours = 1,
/// <summary>
/// When a region of a file is changed in both branches, the file
/// created in the index will contain the "theirs" side of any conflicting
/// region. The index will not record a conflict.
/// </summary>
Theirs = 2,
/// <summary>
/// When a region of a file is changed in both branches, the file
/// created in the index will contain each unique line from each side,
/// which has the result of combining both files. The index will not
/// record a conflict.
/// </summary>
Union = 3,
}
}