@@ -6,108 +6,26 @@ namespace LibGit2Sharp
66 /// <summary>
77 /// Options controlling CherryPick behavior.
88 /// </summary>
9- public sealed class CherryPickOptions : IConvertableToGitCheckoutOpts
9+ public sealed class CherryPickOptions : MergeAndCheckoutOptionsBase
1010 {
1111 /// <summary>
1212 /// Initializes a new instance of the <see cref="CherryPickOptions"/> class.
1313 /// By default the cherry pick will be committed if there are no conflicts.
1414 /// </summary>
1515 public CherryPickOptions ( )
1616 {
17- CommitOnSuccess = true ;
18-
19- FindRenames = true ;
20-
21- // TODO: libgit2 should provide reasonable defaults for these
22- // values, but it currently does not.
23- RenameThreshold = 50 ;
24- TargetLimit = 200 ;
2517 }
2618
27- /// <summary>
28- /// The Flags specifying what conditions are
29- /// reported through the OnCheckoutNotify delegate.
30- /// </summary>
31- public CheckoutNotifyFlags CheckoutNotifyFlags { get ; set ; }
32-
33- /// <summary>
34- /// Delegate that checkout progress will be reported through.
35- /// </summary>
36- public CheckoutProgressHandler OnCheckoutProgress { get ; set ; }
37-
38- /// <summary>
39- /// Delegate that checkout will notify callers of
40- /// certain conditions. The conditions that are reported is
41- /// controlled with the CheckoutNotifyFlags property.
42- /// </summary>
43- public CheckoutNotifyHandler OnCheckoutNotify { get ; set ; }
44-
45- /// <summary>
46- /// Commit the cherry pick if the cherry pick is successful.
47- /// </summary>
48- public bool CommitOnSuccess { get ; set ; }
49-
5019 /// <summary>
5120 /// When cherry picking a merge commit, the parent number to consider as
5221 /// mainline, starting from offset 1.
5322 /// <para>
5423 /// As a merge commit has multiple parents, cherry picking a merge commit
55- /// will reverse all the changes brought in by the merge except for
56- /// one parent's line of commits. The parent to preserve is called the
57- /// mainline, and must be specified by its number (i.e. offset).
24+ /// will take only the changes relative to the given parent. The parent
25+ /// to consider changes based on is called the mainline, and must be
26+ /// specified by its number (i.e. offset).
5827 /// </para>
5928 /// </summary>
6029 public int Mainline { get ; set ; }
61-
62- /// <summary>
63- /// How to handle conflicts encountered during a merge.
64- /// </summary>
65- public MergeFileFavor MergeFileFavor { get ; set ; }
66-
67- /// <summary>
68- /// How Checkout should handle writing out conflicting index entries.
69- /// </summary>
70- public CheckoutFileConflictStrategy FileConflictStrategy { get ; set ; }
71-
72- /// <summary>
73- /// Find renames. Default is true.
74- /// </summary>
75- public bool FindRenames { get ; set ; }
76-
77- /// <summary>
78- /// Similarity to consider a file renamed (default 50). If
79- /// `FindRenames` is enabled, added files will be compared
80- /// with deleted files to determine their similarity. Files that are
81- /// more similar than the rename threshold (percentage-wise) will be
82- /// treated as a rename.
83- /// </summary>
84- public int RenameThreshold ;
85-
86- /// <summary>
87- /// Maximum similarity sources to examine for renames (default 200).
88- /// If the number of rename candidates (add / delete pairs) is greater
89- /// than this value, inexact rename detection is aborted.
90- ///
91- /// This setting overrides the `merge.renameLimit` configuration value.
92- /// </summary>
93- public int TargetLimit ;
94-
95- #region IConvertableToGitCheckoutOpts
96-
97- CheckoutCallbacks IConvertableToGitCheckoutOpts . GenerateCallbacks ( )
98- {
99- return CheckoutCallbacks . From ( OnCheckoutProgress , OnCheckoutNotify ) ;
100- }
101-
102- CheckoutStrategy IConvertableToGitCheckoutOpts . CheckoutStrategy
103- {
104- get
105- {
106- return CheckoutStrategy . GIT_CHECKOUT_SAFE |
107- GitCheckoutOptsWrapper . CheckoutStrategyFromFileConflictStrategy ( FileConflictStrategy ) ;
108- }
109- }
110-
111- #endregion IConvertableToGitCheckoutOpts
11230 }
11331}
0 commit comments