diff options
author | crumblycake <angusbjones@outlook.com> | 2013-12-05 15:31:18 +0400 |
---|---|---|
committer | Jameson Miller <jamill@microsoft.com> | 2014-01-16 18:21:49 +0400 |
commit | cc4bb2da1de35122860993cb1f5c9fae7a724f59 (patch) | |
tree | d3f68c1c7949cd544af2d3a588797b45861b499d /LibGit2Sharp/MergeResult.cs | |
parent | 9165ae30d4cff10681b5b65f094d0d4320426b6e (diff) |
Initial merge functionality.
Bring initial merge functionality to LibGit2Sharp.
Diffstat (limited to 'LibGit2Sharp/MergeResult.cs')
-rw-r--r-- | LibGit2Sharp/MergeResult.cs | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/LibGit2Sharp/MergeResult.cs b/LibGit2Sharp/MergeResult.cs new file mode 100644 index 00000000..fa209336 --- /dev/null +++ b/LibGit2Sharp/MergeResult.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace LibGit2Sharp +{ + /// <summary> + /// Class to report the result of a merge. + /// </summary> + public class MergeResult + { + /// <summary> + /// Needed for mocking purposes. + /// </summary> + protected MergeResult() + { } + + internal MergeResult(MergeStatus status, Commit commit = null) + { + this.Status = status; + this.Commit = commit; + } + + /// <summary> + /// The status of the merge. + /// </summary> + public virtual MergeStatus Status + { + get; + private set; + } + + /// <summary> + /// The resulting commit of the merge. For fast-forward merges, this is the + /// commit that merge was fast forwarded to. + /// <para>This will return <code>null</code> if the merge has been unsuccessful due to conflicts.</para> + /// </summary> + public virtual Commit Commit + { + get; + private set; + } + } + + /// <summary> + /// The status of what happened as a result of a merge. + /// </summary> + public enum MergeStatus + { + /// <summary> + /// Merge was up-to-date. + /// </summary> + UpToDate, + + /// <summary> + /// Fast-forward merge. + /// </summary> + FastForward, + + /// <summary> + /// A non fast-forward merge. + /// </summary> + NonFastForward, + + /// <summary> + /// Merge resulted in conflicts. + /// </summary> + Conflicts, + } +} |