Welcome to mirror list, hosted at ThFree Co, Russian Federation.

MergeResult.cs « LibGit2Sharp - github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fa20933624c5a18352733e1e89e9c399288e0426 (plain)
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
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,
    }
}