|
3 | 3 |
|
4 | 4 | namespace LibGit2Sharp.Core
|
5 | 5 | {
|
6 |
| - internal delegate int conflict_cb( |
7 |
| - IntPtr conflicting_path, |
8 |
| - ref GitOid blob_oid, |
9 |
| - uint index_mode, |
10 |
| - uint wd_mode, |
11 |
| - IntPtr payload); |
12 |
| - |
13 |
| - internal delegate void progress_cb( |
14 |
| - IntPtr strPtr, |
15 |
| - UIntPtr completed_steps, |
16 |
| - UIntPtr total_steps, |
17 |
| - IntPtr payload); |
18 |
| - |
19 |
| - [StructLayout(LayoutKind.Sequential)] |
20 |
| - internal class GitCheckoutOpts |
21 |
| - { |
22 |
| - public uint version = 1; |
23 |
| - public CheckoutStrategy checkout_strategy; |
24 |
| - public int DisableFilters; |
25 |
| - public int DirMode; |
26 |
| - public int FileMode; |
27 |
| - public int FileOpenFlags; |
28 |
| - public conflict_cb conflictCb; |
29 |
| - public IntPtr ConflictPayload; |
30 |
| - public progress_cb ProgressCb; |
31 |
| - public IntPtr ProgressPayload; |
32 |
| - public UnSafeNativeMethods.git_strarray paths; |
33 |
| - } |
34 |
| - |
35 | 6 | [Flags]
|
36 | 7 | internal enum CheckoutStrategy
|
37 | 8 | {
|
38 | 9 | /// <summary>
|
39 | 10 | /// Default is a dry run, no actual updates.
|
40 | 11 | /// </summary>
|
41 |
| - GIT_CHECKOUT_DEFAULT = 0, |
| 12 | + GIT_CHECKOUT_NONE = 0, |
42 | 13 |
|
43 | 14 | /// <summary>
|
44 |
| - /// Allow update of entries where working dir matches HEAD. |
45 |
| - /// </summary> |
46 |
| - GIT_CHECKOUT_UPDATE_UNMODIFIED = (1 << 0), |
47 |
| - |
48 |
| - /// <summary> |
49 |
| - /// Allow update of entries where working dir does not have file. |
| 15 | + /// Allow safe updates that cannot overwrite uncommited data. |
50 | 16 | /// </summary>
|
51 |
| - GIT_CHECKOUT_UPDATE_MISSING = (1 << 1), |
| 17 | + GIT_CHECKOUT_SAFE = (1 << 0), |
52 | 18 |
|
53 | 19 | /// <summary>
|
54 |
| - /// Allow safe updates that cannot overwrite uncommited data. |
| 20 | + /// Allow safe updates plus creation of missing files. |
55 | 21 | /// </summary>
|
56 |
| - GIT_CHECKOUT_SAFE = |
57 |
| - (GIT_CHECKOUT_UPDATE_UNMODIFIED | GIT_CHECKOUT_UPDATE_MISSING), |
| 22 | + GIT_CHECKOUT_SAFE_CREATE = (1 << 1), |
58 | 23 |
|
59 | 24 | /// <summary>
|
60 | 25 | /// Allow update of entries in working dir that are modified from HEAD.
|
61 | 26 | /// </summary>
|
62 |
| - GIT_CHECKOUT_UPDATE_MODIFIED = (1 << 2), |
| 27 | + GIT_CHECKOUT_FORCE = (1 << 2), |
63 | 28 |
|
64 | 29 | /// <summary>
|
65 |
| - /// Update existing untracked files that are now present in the index. |
| 30 | + /// Allow checkout to make safe updates even if conflicts are found |
66 | 31 | /// </summary>
|
67 |
| - GIT_CHECKOUT_UPDATE_UNTRACKED = (1 << 3), |
| 32 | + GIT_CHECKOUT_ALLOW_CONFLICTS = (1 << 4), |
68 | 33 |
|
69 | 34 | /// <summary>
|
70 |
| - /// Allow all updates to force working directory to look like index. |
| 35 | + /// Remove untracked files not in index (that are not ignored) |
71 | 36 | /// </summary>
|
72 |
| - GIT_CHECKOUT_FORCE = |
73 |
| - (GIT_CHECKOUT_SAFE | GIT_CHECKOUT_UPDATE_MODIFIED | GIT_CHECKOUT_UPDATE_UNTRACKED), |
| 37 | + GIT_CHECKOUT_REMOVE_UNTRACKED = (1 << 5), |
74 | 38 |
|
75 | 39 | /// <summary>
|
76 |
| - /// Allow checkout to make updates even if conflicts are found. |
| 40 | + /// Remove ignored files not in index |
77 | 41 | /// </summary>
|
78 |
| - GIT_CHECKOUT_ALLOW_CONFLICTS = (1 << 4), |
| 42 | + GIT_CHECKOUT_REMOVE_IGNORED = (1 << 6), |
79 | 43 |
|
80 | 44 | /// <summary>
|
81 |
| - /// Remove untracked files not in index (that are not ignored). |
| 45 | + /// Only update existing files, don't create new ones |
82 | 46 | /// </summary>
|
83 |
| - GIT_CHECKOUT_REMOVE_UNTRACKED = (1 << 5), |
| 47 | + GIT_CHECKOUT_UPDATE_ONLY = (1 << 7), |
84 | 48 |
|
85 | 49 | /// <summary>
|
86 |
| - /// Only update existing files, don't create new ones. |
| 50 | + /// Normally checkout updates index entries as it goes; this stops that |
87 | 51 | /// </summary>
|
88 |
| - GIT_CHECKOUT_UPDATE_ONLY = (1 << 6), |
89 |
| - |
90 |
| - /* |
91 |
| - * THE FOLLOWING OPTIONS ARE NOT YET IMPLEMENTED. |
92 |
| - */ |
| 52 | + GIT_CHECKOUT_DONT_UPDATE_INDEX = (1 << 8), |
93 | 53 |
|
94 | 54 | /// <summary>
|
95 |
| - /// Allow checkout to skip unmerged files (NOT IMPLEMENTED). |
| 55 | + /// Don't refresh index/config/etc before doing checkout |
96 | 56 | /// </summary>
|
| 57 | + GIT_CHECKOUT_NO_REFRESH = (1 << 9), |
| 58 | + |
| 59 | + ///Allow checkout to skip unmerged files (NOT IMPLEMENTED) |
97 | 60 | GIT_CHECKOUT_SKIP_UNMERGED = (1 << 10),
|
98 | 61 |
|
99 | 62 | /// <summary>
|
100 |
| - /// For unmerged files, checkout stage 2 from index (NOT IMPLEMENTED). |
| 63 | + /// For unmerged files, checkout stage 2 from index (NOT IMPLEMENTED) |
101 | 64 | /// </summary>
|
102 | 65 | GIT_CHECKOUT_USE_OURS = (1 << 11),
|
103 | 66 |
|
104 | 67 | /// <summary>
|
105 |
| - /// For unmerged files, checkout stage 3 from index (NOT IMPLEMENTED). |
| 68 | + /// For unmerged files, checkout stage 3 from index (NOT IMPLEMENTED) |
106 | 69 | /// </summary>
|
107 | 70 | GIT_CHECKOUT_USE_THEIRS = (1 << 12),
|
108 | 71 |
|
109 | 72 | /// <summary>
|
110 |
| - /// Recursively checkout submodules with same options (NOT IMPLEMENTED). |
| 73 | +
F987
/// Recursively checkout submodules with same options (NOT IMPLEMENTED) |
111 | 74 | /// </summary>
|
112 | 75 | GIT_CHECKOUT_UPDATE_SUBMODULES = (1 << 16),
|
113 | 76 |
|
114 | 77 | /// <summary>
|
115 |
| - /// Recursively checkout submodules if HEAD moved in super repo (NOT IMPLEMENTED) */ |
| 78 | + /// Recursively checkout submodules if HEAD moved in super repo (NOT IMPLEMENTED) |
116 | 79 | /// </summary>
|
117 | 80 | GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED = (1 << 17),
|
118 | 81 | }
|
| 82 | + |
| 83 | + [Flags] |
| 84 | + internal enum NotifyFlags |
| 85 | + { |
| 86 | + GIT_CHECKOUT_NOTIFY_NONE = 0, |
| 87 | + GIT_CHECKOUT_NOTIFY_CONFLICT = (1 << 0), |
| 88 | + GIT_CHECKOUT_NOTIFY_DIRTY = (1 << 1), |
| 89 | + GIT_CHECKOUT_NOTIFY_UPDATED = (1 << 2), |
| 90 | + GIT_CHECKOUT_NOTIFY_UNTRACKED = (1 << 3), |
| 91 | + GIT_CHECKOUT_NOTIFY_IGNORED = (1 << 4), |
| 92 | + } |
| 93 | + |
| 94 | + internal delegate int checkout_notify_cb( |
| 95 | + NotifyFlags why, |
| 96 | + IntPtr path, |
| 97 | + IntPtr baseline, |
| 98 | + IntPtr target, |
| 99 | + IntPtr workdir, |
| 100 | + IntPtr payload); |
| 101 | + |
| 102 | + internal delegate void progress_cb( |
| 103 | + IntPtr strPtr, |
| 104 | + UIntPtr completed_steps, |
| 105 | + UIntPtr total_steps, |
| 106 | + IntPtr payload); |
| 107 | + |
| 108 | + [StructLayout(LayoutKind.Sequential)] |
| 109 | + internal struct GitCheckoutOpts |
| 110 | + { |
| 111 | + public uint version; |
| 112 | + |
| 113 | + public CheckoutStrategy checkout_strategy; |
| 114 | + |
| 115 | + public int DisableFilters; |
| 116 | + public uint DirMode; |
| 117 | + public uint FileMode; |
| 118 | + public int FileOpenFlags; |
| 119 | + |
| 120 | + public NotifyFlags notify_flags; |
| 121 | + public checkout_notify_cb notify_cb; |
| 122 | + public IntPtr notify_payload; |
| 123 | + |
| 124 | + public progress_cb progress_cb; |
| 125 | + public IntPtr progress_payload; |
| 126 | + |
| 127 | + public UnSafeNativeMethods.git_strarray paths; |
| 128 | + |
| 129 | + public IntPtr baseline; |
| 130 | + } |
119 | 131 | }
|
0 commit comments