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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
using System;
using System.Runtime.InteropServices;
namespace LibGit2Sharp.Core
{
internal static class NativeMethods
{
private const string libgit2 = "git2";
[DllImport(libgit2)]
public static extern IntPtr git_blob_rawcontent(IntPtr blob);
[DllImport(libgit2)]
public static extern int git_blob_rawsize(IntPtr blob);
[DllImport(libgit2)]
public static extern IntPtr git_commit_author(IntPtr commit);
[DllImport(libgit2)]
public static extern IntPtr git_commit_committer(IntPtr commit);
[DllImport(libgit2)]
public static extern int git_commit_create_o(out GitOid oid, RepositorySafeHandle repo, string updateRef, IntPtr author, IntPtr committer, string message, IntPtr tree, int parentCount, IntPtr parents);
[DllImport(libgit2)]
public static extern IntPtr git_commit_message(IntPtr commit);
[DllImport(libgit2)]
public static extern IntPtr git_commit_message_short(IntPtr commit);
[DllImport(libgit2)]
public static extern int git_commit_parent(out IntPtr parentCommit, IntPtr commit, uint n);
[DllImport(libgit2)]
public static extern uint git_commit_parentcount(IntPtr commit);
[DllImport(libgit2)]
public static extern int git_commit_tree(out IntPtr tree, IntPtr commit);
[DllImport(libgit2)]
public static extern IntPtr git_commit_tree_oid(IntPtr commit);
[DllImport(libgit2)]
public static extern int git_index_add(IndexSafeHandle index, string path, int stage = 0);
[DllImport(libgit2)]
public static extern uint git_index_entrycount(IndexSafeHandle index);
[DllImport(libgit2)]
public static extern int git_index_find(IndexSafeHandle index, string path);
[DllImport(libgit2)]
public static extern void git_index_free(IntPtr index);
[DllImport(libgit2)]
public static extern IntPtr git_index_get(IndexSafeHandle index, int n);
[DllImport(libgit2)]
public static extern int git_index_remove(IndexSafeHandle index, int n);
[DllImport(libgit2)]
public static extern int git_index_write(IndexSafeHandle index);
[DllImport(libgit2)]
public static extern IntPtr git_lasterror();
[DllImport(libgit2)]
public static extern void git_object_close(IntPtr obj);
[DllImport(libgit2)]
public static extern IntPtr git_object_id(IntPtr obj);
[DllImport(libgit2)]
public static extern int git_object_lookup(out IntPtr obj, RepositorySafeHandle repo, ref GitOid id, GitObjectType type);
[DllImport(libgit2)]
public static extern GitObjectType git_object_type(IntPtr obj);
[DllImport(libgit2)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool git_odb_exists(IntPtr db, ref GitOid id);
[DllImport(libgit2)]
public static extern void git_odb_object_close(IntPtr obj);
[DllImport(libgit2)]
public static extern int git_oid_cmp(ref GitOid a, ref GitOid b);
[DllImport(libgit2)]
public static extern void git_oid_fmt(byte[] str, ref GitOid oid);
[DllImport(libgit2)]
public static extern int git_oid_mkstr(out GitOid oid, string str);
[DllImport(libgit2)]
public static extern int git_reference_create_oid(out IntPtr reference, RepositorySafeHandle repo, string name, ref GitOid oid);
[DllImport(libgit2)]
public static extern int git_reference_create_oid_f(out IntPtr reference, RepositorySafeHandle repo, string name, ref GitOid oid);
[DllImport(libgit2)]
public static extern int git_reference_create_symbolic(out IntPtr reference, RepositorySafeHandle repo, string name, string target);
[DllImport(libgit2)]
public static extern int git_reference_create_symbolic_f(out IntPtr reference, RepositorySafeHandle repo, string name, string target);
[DllImport(libgit2)]
public static extern int git_reference_delete(IntPtr reference);
[DllImport(libgit2)]
public static extern int git_reference_lookup(out IntPtr reference, RepositorySafeHandle repo, string name);
[DllImport(libgit2)]
public static extern IntPtr git_reference_name(IntPtr reference);
[DllImport(libgit2)]
public static extern IntPtr git_reference_oid(IntPtr reference);
[DllImport(libgit2)]
public static extern int git_reference_rename(IntPtr reference, string newName);
[DllImport(libgit2)]
public static extern int git_reference_rename_f(IntPtr reference, string newName);
[DllImport(libgit2)]
public static extern int git_reference_resolve(out IntPtr resolvedReference, IntPtr reference);
[DllImport(libgit2)]
public static extern int git_reference_set_oid(IntPtr reference, ref GitOid id);
[DllImport(libgit2)]
public static extern int git_reference_set_target(IntPtr reference, string target);
[DllImport(libgit2)]
public static extern IntPtr git_reference_target(IntPtr reference);
[DllImport(libgit2)]
public static extern GitReferenceType git_reference_type(IntPtr reference);
[DllImport(libgit2)]
public static extern IntPtr git_repository_database(RepositorySafeHandle repository);
[DllImport(libgit2)]
public static extern void git_repository_free(IntPtr repository);
[DllImport(libgit2)]
public static extern int git_repository_index(out IndexSafeHandle index, RepositorySafeHandle repo);
[DllImport(libgit2)]
public static extern int git_repository_init(out RepositorySafeHandle repository, string path, [MarshalAs(UnmanagedType.Bool)] bool isBare);
[DllImport(libgit2)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool git_repository_is_bare(RepositorySafeHandle handle);
[DllImport(libgit2)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool git_repository_is_empty(RepositorySafeHandle repo);
[DllImport(libgit2)]
public static extern int git_repository_open(out RepositorySafeHandle repository, string path);
[DllImport(libgit2)]
public static extern IntPtr git_repository_path(RepositorySafeHandle repository, GitRepositoryPathId pathIdentifier);
[DllImport(libgit2)]
public static extern void git_revwalk_free(IntPtr walker);
[DllImport(libgit2)]
public static extern int git_revwalk_hide(RevWalkerSafeHandle walker, ref GitOid oid);
[DllImport(libgit2)]
public static extern int git_revwalk_new(out RevWalkerSafeHandle walker, RepositorySafeHandle repo);
[DllImport(libgit2)]
public static extern int git_revwalk_next(out GitOid oid, RevWalkerSafeHandle walker);
[DllImport(libgit2)]
public static extern int git_revwalk_push(RevWalkerSafeHandle walker, ref GitOid oid);
[DllImport(libgit2)]
public static extern void git_revwalk_reset(RevWalkerSafeHandle walker);
[DllImport(libgit2)]
public static extern void git_revwalk_sorting(RevWalkerSafeHandle walk, GitSortOptions sort);
[DllImport(libgit2)]
public static extern void git_signature_free(IntPtr signature);
[DllImport(libgit2)]
public static extern IntPtr git_signature_new(string name, string email, long time, int offset);
[DllImport(libgit2)]
public static extern int git_tag_create(out GitOid oid, RepositorySafeHandle repo, string name, ref GitOid target, GitObjectType type, GitSignature signature, string message);
[DllImport(libgit2)]
public static extern int git_tag_create_f(out GitOid oid, RepositorySafeHandle repo, string name, ref GitOid target, GitObjectType type, GitSignature signature, string message);
[DllImport(libgit2)]
public static extern int git_tag_delete(RepositorySafeHandle repo, string tagName);
[DllImport(libgit2)]
public static extern IntPtr git_tag_message(IntPtr tag);
[DllImport(libgit2)]
public static extern IntPtr git_tag_name(IntPtr tag);
[DllImport(libgit2)]
public static extern IntPtr git_tag_tagger(IntPtr tag);
[DllImport(libgit2)]
public static extern IntPtr git_tag_target_oid(IntPtr tag);
[DllImport(libgit2)]
public static extern int git_tree_entry_2object(out IntPtr obj, RepositorySafeHandle repo, IntPtr entry);
[DllImport(libgit2)]
public static extern int git_tree_entry_attributes(IntPtr entry);
[DllImport(libgit2)]
public static extern IntPtr git_tree_entry_byindex(IntPtr tree, int idx);
[DllImport(libgit2)]
public static extern IntPtr git_tree_entry_byname(IntPtr tree, string filename);
[DllImport(libgit2)]
public static extern IntPtr git_tree_entry_id(IntPtr tree);
[DllImport(libgit2)]
public static extern IntPtr git_tree_entry_name(IntPtr entry);
[DllImport(libgit2)]
public static extern int git_tree_entrycount(IntPtr tree);
}
}
|