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

GitCheckoutOpts.cs « Core « LibGit2Sharp - github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a1d562f98b9b1c59a270005e00479aa249210a00 (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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
using System;
using System.Runtime.InteropServices;

namespace LibGit2Sharp.Core
{
    [Flags]
    internal enum CheckoutStrategy
    {
        /// <summary>
        /// Default is a dry run, no actual updates.
        /// </summary>
        GIT_CHECKOUT_NONE = 0,

        /// <summary>
        /// Allow safe updates that cannot overwrite uncommited data.
        /// </summary>
        GIT_CHECKOUT_SAFE = (1 << 0),

        /// <summary>
        /// Allow safe updates plus creation of missing files.
        /// </summary>
        GIT_CHECKOUT_SAFE_CREATE = (1 << 1),

        /// <summary>
        /// Allow update of entries in working dir that are modified from HEAD.
        /// </summary>
        GIT_CHECKOUT_FORCE = (1 << 2),

        /// <summary>
        /// Allow checkout to make safe updates even if conflicts are found
        /// </summary>
        GIT_CHECKOUT_ALLOW_CONFLICTS = (1 << 4),

        /// <summary>
        /// Remove untracked files not in index (that are not ignored)
        /// </summary>
        GIT_CHECKOUT_REMOVE_UNTRACKED = (1 << 5),

        /// <summary>
        /// Remove ignored files not in index
        /// </summary>
        GIT_CHECKOUT_REMOVE_IGNORED = (1 << 6),

        /// <summary>
        /// Only update existing files, don't create new ones
        /// </summary>
        GIT_CHECKOUT_UPDATE_ONLY = (1 << 7),

        /// <summary>
        /// Normally checkout updates index entries as it goes; this stops that
        /// </summary>
        GIT_CHECKOUT_DONT_UPDATE_INDEX = (1 << 8),

        /// <summary>
        /// Don't refresh index/config/etc before doing checkout
        /// </summary>
        GIT_CHECKOUT_NO_REFRESH = (1 << 9),

        ///Allow checkout to skip unmerged files (NOT IMPLEMENTED)
        GIT_CHECKOUT_SKIP_UNMERGED = (1 << 10),

        /// <summary>
        /// For unmerged files, checkout stage 2 from index (NOT IMPLEMENTED)
        /// </summary>
        GIT_CHECKOUT_USE_OURS = (1 << 11),

        /// <summary>
        /// For unmerged files, checkout stage 3 from index (NOT IMPLEMENTED)
        /// </summary>
        GIT_CHECKOUT_USE_THEIRS = (1 << 12),

        /// <summary>
        /// Recursively checkout submodules with same options (NOT IMPLEMENTED)
        /// </summary>
        GIT_CHECKOUT_UPDATE_SUBMODULES = (1 << 16),

        /// <summary>
        /// Recursively checkout submodules if HEAD moved in super repo (NOT IMPLEMENTED)
        /// </summary>
        GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED = (1 << 17),
    }

    internal delegate int checkout_notify_cb(
        CheckoutNotifyFlags why,
        IntPtr path,
        IntPtr baseline,
        IntPtr target,
        IntPtr workdir,
        IntPtr payload);

    internal delegate void progress_cb(
            IntPtr strPtr,
            UIntPtr completed_steps,
            UIntPtr total_steps,
            IntPtr payload);

    [StructLayout(LayoutKind.Sequential)]
    internal struct GitCheckoutOpts :IDisposable
    {
        public uint version;

        public CheckoutStrategy checkout_strategy;

        public int DisableFilters;
        public uint DirMode;
        public uint FileMode;
        public int FileOpenFlags;

        public CheckoutNotifyFlags notify_flags;
        public checkout_notify_cb notify_cb;
        public IntPtr notify_payload;

        public progress_cb progress_cb;
        public IntPtr progress_payload;

        public GitStrArrayIn paths;

        public IntPtr baseline;
        public IntPtr target_directory;

        public IntPtr our_label;
        public IntPtr their_label;

        public void Dispose()
        {
            if (paths == null)
            {
                return;
            }

            paths.Dispose();
        }
    }
}