rugged 0.22.2 → 0.23.0b1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/rugged/rugged.c +1 -2
- data/ext/rugged/rugged_branch_collection.c +6 -44
- data/ext/rugged/rugged_config.c +7 -3
- data/ext/rugged/rugged_diff_delta.c +1 -1
- data/ext/rugged/rugged_diff_line.c +1 -1
- data/ext/rugged/rugged_object.c +2 -2
- data/ext/rugged/rugged_reference_collection.c +12 -56
- data/ext/rugged/rugged_remote.c +4 -33
- data/ext/rugged/rugged_remote_collection.c +1 -1
- data/ext/rugged/rugged_repo.c +10 -36
- data/ext/rugged/rugged_settings.c +3 -3
- data/ext/rugged/rugged_tree.c +1 -1
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/CMakeLists.txt +10 -3
- data/vendor/libgit2/COPYING +15 -21
- data/vendor/libgit2/include/git2/annotated_commit.h +20 -3
- data/vendor/libgit2/include/git2/branch.h +20 -16
- data/vendor/libgit2/include/git2/checkout.h +32 -18
- data/vendor/libgit2/include/git2/cherrypick.h +2 -2
- data/vendor/libgit2/include/git2/clone.h +4 -10
- data/vendor/libgit2/include/git2/config.h +66 -12
- data/vendor/libgit2/include/git2/describe.h +3 -2
- data/vendor/libgit2/include/git2/diff.h +3 -3
- data/vendor/libgit2/include/git2/errors.h +1 -0
- data/vendor/libgit2/include/git2/filter.h +21 -5
- data/vendor/libgit2/include/git2/index.h +32 -0
- data/vendor/libgit2/include/git2/merge.h +20 -3
- data/vendor/libgit2/include/git2/oid.h +1 -1
- data/vendor/libgit2/include/git2/pack.h +13 -0
- data/vendor/libgit2/include/git2/patch.h +3 -6
- data/vendor/libgit2/include/git2/rebase.h +8 -12
- data/vendor/libgit2/include/git2/refs.h +19 -29
- data/vendor/libgit2/include/git2/remote.h +5 -11
- data/vendor/libgit2/include/git2/repository.h +44 -15
- data/vendor/libgit2/include/git2/reset.h +19 -10
- data/vendor/libgit2/include/git2/revert.h +2 -2
- data/vendor/libgit2/include/git2/submodule.h +3 -9
- data/vendor/libgit2/include/git2/sys/config.h +3 -1
- data/vendor/libgit2/include/git2/sys/filter.h +10 -2
- data/vendor/libgit2/include/git2/sys/hashsig.h +49 -22
- data/vendor/libgit2/include/git2/transport.h +1 -1
- data/vendor/libgit2/include/git2/types.h +10 -3
- data/vendor/libgit2/include/git2/version.h +3 -2
- data/vendor/libgit2/src/annotated_commit.c +28 -0
- data/vendor/libgit2/src/array.h +19 -8
- data/vendor/libgit2/src/attr.c +95 -35
- data/vendor/libgit2/src/attr_file.c +51 -17
- data/vendor/libgit2/src/attr_file.h +37 -10
- data/vendor/libgit2/src/attrcache.c +13 -7
- data/vendor/libgit2/src/attrcache.h +1 -0
- data/vendor/libgit2/src/blame.c +26 -2
- data/vendor/libgit2/src/blame_git.c +6 -2
- data/vendor/libgit2/src/blob.c +6 -8
- data/vendor/libgit2/src/branch.c +55 -43
- data/vendor/libgit2/src/buf_text.c +13 -6
- data/vendor/libgit2/src/buffer.c +110 -25
- data/vendor/libgit2/src/buffer.h +18 -0
- data/vendor/libgit2/src/checkout.c +164 -92
- data/vendor/libgit2/src/checkout.h +0 -7
- data/vendor/libgit2/src/cherrypick.c +13 -7
- data/vendor/libgit2/src/clone.c +23 -25
- data/vendor/libgit2/src/commit.c +3 -3
- data/vendor/libgit2/src/common.h +23 -1
- data/vendor/libgit2/src/config.c +137 -19
- data/vendor/libgit2/src/config.h +2 -2
- data/vendor/libgit2/src/config_cache.c +2 -1
- data/vendor/libgit2/src/config_file.c +39 -18
- data/vendor/libgit2/src/config_file.h +1 -1
- data/vendor/libgit2/src/crlf.c +1 -1
- data/vendor/libgit2/src/delta-apply.c +3 -2
- data/vendor/libgit2/src/delta.c +25 -6
- data/vendor/libgit2/src/describe.c +2 -0
- data/vendor/libgit2/src/diff.c +8 -5
- data/vendor/libgit2/src/diff_driver.c +39 -18
- data/vendor/libgit2/src/diff_file.c +1 -1
- data/vendor/libgit2/src/diff_patch.c +12 -6
- data/vendor/libgit2/src/diff_tform.c +21 -24
- data/vendor/libgit2/src/filebuf.c +14 -12
- data/vendor/libgit2/src/fileops.c +61 -18
- data/vendor/libgit2/src/fileops.h +11 -2
- data/vendor/libgit2/src/filter.c +351 -99
- data/vendor/libgit2/src/filter.h +17 -0
- data/vendor/libgit2/src/global.c +38 -9
- data/vendor/libgit2/src/hash/hash_generic.c +1 -1
- data/vendor/libgit2/src/hashsig.c +28 -16
- data/vendor/libgit2/src/ignore.c +2 -2
- data/vendor/libgit2/src/index.c +159 -42
- data/vendor/libgit2/src/index.h +29 -0
- data/vendor/libgit2/src/indexer.c +11 -2
- data/vendor/libgit2/src/integer.h +96 -0
- data/vendor/libgit2/src/iterator.c +5 -3
- data/vendor/libgit2/src/khash.h +41 -29
- data/vendor/libgit2/src/merge.c +48 -35
- data/vendor/libgit2/src/merge.h +0 -1
- data/vendor/libgit2/src/merge_file.c +13 -0
- data/vendor/libgit2/src/mwindow.c +1 -1
- data/vendor/libgit2/src/notes.c +1 -1
- data/vendor/libgit2/src/odb.c +13 -11
- data/vendor/libgit2/src/odb_loose.c +22 -10
- data/vendor/libgit2/src/odb_mempack.c +4 -2
- data/vendor/libgit2/src/offmap.h +3 -2
- data/vendor/libgit2/src/oid.c +1 -1
- data/vendor/libgit2/src/oidmap.h +2 -1
- data/vendor/libgit2/src/openssl_stream.c +6 -3
- data/vendor/libgit2/src/pack-objects.c +273 -12
- data/vendor/libgit2/src/pack-objects.h +10 -0
- data/vendor/libgit2/src/pack.c +17 -6
- data/vendor/libgit2/src/pack.h +1 -3
- data/vendor/libgit2/src/path.c +68 -38
- data/vendor/libgit2/src/pathspec.c +3 -0
- data/vendor/libgit2/src/pool.c +9 -8
- data/vendor/libgit2/src/posix.c +11 -1
- data/vendor/libgit2/src/push.c +15 -17
- data/vendor/libgit2/src/push.h +1 -6
- data/vendor/libgit2/src/rebase.c +77 -35
- data/vendor/libgit2/src/refdb_fs.c +2 -2
- data/vendor/libgit2/src/refs.c +107 -81
- data/vendor/libgit2/src/refs.h +2 -2
- data/vendor/libgit2/src/refspec.c +3 -0
- data/vendor/libgit2/src/remote.c +19 -21
- data/vendor/libgit2/src/repository.c +258 -67
- data/vendor/libgit2/src/repository.h +31 -16
- data/vendor/libgit2/src/reset.c +28 -12
- data/vendor/libgit2/src/revert.c +12 -7
- data/vendor/libgit2/src/revwalk.c +3 -5
- data/vendor/libgit2/src/revwalk.h +1 -1
- data/vendor/libgit2/src/sortedcache.c +5 -3
- data/vendor/libgit2/src/stash.c +3 -5
- data/vendor/libgit2/src/strmap.h +2 -1
- data/vendor/libgit2/src/submodule.c +5 -6
- data/vendor/libgit2/src/tag.c +7 -5
- data/vendor/libgit2/src/transaction.c +1 -1
- data/vendor/libgit2/src/transports/cred.c +5 -2
- data/vendor/libgit2/src/transports/git.c +2 -3
- data/vendor/libgit2/src/transports/local.c +15 -34
- data/vendor/libgit2/src/transports/smart.c +1 -1
- data/vendor/libgit2/src/transports/smart_pkt.c +58 -18
- data/vendor/libgit2/src/transports/smart_protocol.c +2 -2
- data/vendor/libgit2/src/transports/winhttp.c +2 -2
- data/vendor/libgit2/src/tree.c +7 -5
- data/vendor/libgit2/src/tsort.c +3 -1
- data/vendor/libgit2/src/util.c +25 -0
- data/vendor/libgit2/src/util.h +31 -27
- data/vendor/libgit2/src/vector.c +2 -7
- data/vendor/libgit2/src/win32/dir.c +5 -3
- data/vendor/libgit2/src/win32/git2.rc +8 -4
- data/vendor/libgit2/src/win32/mingw-compat.h +7 -0
- data/vendor/libgit2/src/win32/msvc-compat.h +3 -0
- data/vendor/libgit2/src/win32/posix.h +1 -3
- data/vendor/libgit2/src/win32/posix_w32.c +31 -7
- data/vendor/libgit2/src/win32/utf-conv.c +1 -3
- data/vendor/libgit2/src/zstream.c +1 -1
- metadata +5 -5
- data/vendor/libgit2/src/bswap.h +0 -97
@@ -89,9 +89,9 @@ GIT_EXTERN(int) git_reference_dwim(git_reference **out, git_repository *repo, co
|
|
89
89
|
* This function will return an error if a reference already exists with the
|
90
90
|
* given name unless `force` is true, in which case it will be overwritten.
|
91
91
|
*
|
92
|
-
* The
|
93
|
-
*
|
94
|
-
*
|
92
|
+
* The message for the reflog will be ignored if the reference does
|
93
|
+
* not belong in the standard set (HEAD, branches and remote-tracking
|
94
|
+
* branches) and it does not have a reflog.
|
95
95
|
*
|
96
96
|
* It will return GIT_EMODIFIED if the reference's value at the time
|
97
97
|
* of updating does not match the one passed through `current_value`
|
@@ -103,11 +103,10 @@ GIT_EXTERN(int) git_reference_dwim(git_reference **out, git_repository *repo, co
|
|
103
103
|
* @param target The target of the reference
|
104
104
|
* @param force Overwrite existing references
|
105
105
|
* @param current_value The expected value of the reference when updating
|
106
|
-
* @param signature The identity that will used to populate the reflog entry
|
107
106
|
* @param log_message The one line long message to be appended to the reflog
|
108
107
|
* @return 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC, GIT_EMODIFIED or an error code
|
109
108
|
*/
|
110
|
-
GIT_EXTERN(int) git_reference_symbolic_create_matching(git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *current_value, const
|
109
|
+
GIT_EXTERN(int) git_reference_symbolic_create_matching(git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *current_value, const char *log_message);
|
111
110
|
|
112
111
|
/**
|
113
112
|
* Create a new symbolic reference.
|
@@ -131,20 +130,19 @@ GIT_EXTERN(int) git_reference_symbolic_create_matching(git_reference **out, git_
|
|
131
130
|
* This function will return an error if a reference already exists with the
|
132
131
|
* given name unless `force` is true, in which case it will be overwritten.
|
133
132
|
*
|
134
|
-
* The
|
135
|
-
*
|
136
|
-
*
|
133
|
+
* The message for the reflog will be ignored if the reference does
|
134
|
+
* not belong in the standard set (HEAD, branches and remote-tracking
|
135
|
+
* branches) and it does not have a reflog.
|
137
136
|
*
|
138
137
|
* @param out Pointer to the newly created reference
|
139
138
|
* @param repo Repository where that reference will live
|
140
139
|
* @param name The name of the reference
|
141
140
|
* @param target The target of the reference
|
142
141
|
* @param force Overwrite existing references
|
143
|
-
* @param signature The identity that will used to populate the reflog entry
|
144
142
|
* @param log_message The one line long message to be appended to the reflog
|
145
143
|
* @return 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code
|
146
144
|
*/
|
147
|
-
GIT_EXTERN(int) git_reference_symbolic_create(git_reference **out, git_repository *repo, const char *name, const char *target, int force, const
|
145
|
+
GIT_EXTERN(int) git_reference_symbolic_create(git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *log_message);
|
148
146
|
|
149
147
|
/**
|
150
148
|
* Create a new direct reference.
|
@@ -169,20 +167,19 @@ GIT_EXTERN(int) git_reference_symbolic_create(git_reference **out, git_repositor
|
|
169
167
|
* This function will return an error if a reference already exists with the
|
170
168
|
* given name unless `force` is true, in which case it will be overwritten.
|
171
169
|
*
|
172
|
-
* The
|
173
|
-
*
|
174
|
-
*
|
170
|
+
* The message for the reflog will be ignored if the reference does
|
171
|
+
* not belong in the standard set (HEAD, branches and remote-tracking
|
172
|
+
* branches) and and it does not have a reflog.
|
175
173
|
*
|
176
174
|
* @param out Pointer to the newly created reference
|
177
175
|
* @param repo Repository where that reference will live
|
178
176
|
* @param name The name of the reference
|
179
177
|
* @param id The object id pointed to by the reference.
|
180
178
|
* @param force Overwrite existing references
|
181
|
-
* @param signature The identity that will used to populate the reflog entry
|
182
179
|
* @param log_message The one line long message to be appended to the reflog
|
183
180
|
* @return 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code
|
184
181
|
*/
|
185
|
-
GIT_EXTERN(int) git_reference_create(git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const
|
182
|
+
GIT_EXTERN(int) git_reference_create(git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const char *log_message);
|
186
183
|
|
187
184
|
/**
|
188
185
|
* Conditionally create new direct reference
|
@@ -207,9 +204,9 @@ GIT_EXTERN(int) git_reference_create(git_reference **out, git_repository *repo,
|
|
207
204
|
* This function will return an error if a reference already exists with the
|
208
205
|
* given name unless `force` is true, in which case it will be overwritten.
|
209
206
|
*
|
210
|
-
* The
|
211
|
-
*
|
212
|
-
*
|
207
|
+
* The message for the reflog will be ignored if the reference does
|
208
|
+
* not belong in the standard set (HEAD, branches and remote-tracking
|
209
|
+
* branches) and and it does not have a reflog.
|
213
210
|
*
|
214
211
|
* It will return GIT_EMODIFIED if the reference's value at the time
|
215
212
|
* of updating does not match the one passed through `current_id`
|
@@ -221,12 +218,11 @@ GIT_EXTERN(int) git_reference_create(git_reference **out, git_repository *repo,
|
|
221
218
|
* @param id The object id pointed to by the reference.
|
222
219
|
* @param force Overwrite existing references
|
223
220
|
* @param current_id The expected value of the reference at the time of update
|
224
|
-
* @param signature The identity that will used to populate the reflog entry
|
225
221
|
* @param log_message The one line long message to be appended to the reflog
|
226
222
|
* @return 0 on success, GIT_EMODIFIED if the value of the reference
|
227
223
|
* has changed, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code
|
228
224
|
*/
|
229
|
-
GIT_EXTERN(int) git_reference_create_matching(git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const git_oid *current_id, const
|
225
|
+
GIT_EXTERN(int) git_reference_create_matching(git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const git_oid *current_id, const char *log_message);
|
230
226
|
|
231
227
|
/**
|
232
228
|
* Get the OID pointed to by a direct reference.
|
@@ -320,14 +316,13 @@ GIT_EXTERN(git_repository *) git_reference_owner(const git_reference *ref);
|
|
320
316
|
* The target name will be checked for validity.
|
321
317
|
* See `git_reference_symbolic_create()` for rules about valid names.
|
322
318
|
*
|
323
|
-
* The
|
324
|
-
*
|
325
|
-
*
|
319
|
+
* The message for the reflog will be ignored if the reference does
|
320
|
+
* not belong in the standard set (HEAD, branches and remote-tracking
|
321
|
+
* branches) and and it does not have a reflog.
|
326
322
|
*
|
327
323
|
* @param out Pointer to the newly created reference
|
328
324
|
* @param ref The reference
|
329
325
|
* @param target The new target for the reference
|
330
|
-
* @param signature The identity that will used to populate the reflog entry
|
331
326
|
* @param log_message The one line long message to be appended to the reflog
|
332
327
|
* @return 0 on success, GIT_EINVALIDSPEC or an error code
|
333
328
|
*/
|
@@ -335,7 +330,6 @@ GIT_EXTERN(int) git_reference_symbolic_set_target(
|
|
335
330
|
git_reference **out,
|
336
331
|
git_reference *ref,
|
337
332
|
const char *target,
|
338
|
-
const git_signature *signature,
|
339
333
|
const char *log_message);
|
340
334
|
|
341
335
|
/**
|
@@ -348,7 +342,6 @@ GIT_EXTERN(int) git_reference_symbolic_set_target(
|
|
348
342
|
* @param out Pointer to the newly created reference
|
349
343
|
* @param ref The reference
|
350
344
|
* @param id The new target OID for the reference
|
351
|
-
* @param signature The identity that will used to populate the reflog entry
|
352
345
|
* @param log_message The one line long message to be appended to the reflog
|
353
346
|
* @return 0 on success, GIT_EMODIFIED if the value of the reference
|
354
347
|
* has changed since it was read, or an error code
|
@@ -357,7 +350,6 @@ GIT_EXTERN(int) git_reference_set_target(
|
|
357
350
|
git_reference **out,
|
358
351
|
git_reference *ref,
|
359
352
|
const git_oid *id,
|
360
|
-
const git_signature *signature,
|
361
353
|
const char *log_message);
|
362
354
|
|
363
355
|
/**
|
@@ -379,7 +371,6 @@ GIT_EXTERN(int) git_reference_set_target(
|
|
379
371
|
* @param ref The reference to rename
|
380
372
|
* @param new_name The new name for the reference
|
381
373
|
* @param force Overwrite an existing reference
|
382
|
-
* @param signature The identity that will used to populate the reflog entry
|
383
374
|
* @param log_message The one line long message to be appended to the reflog
|
384
375
|
* @return 0 on success, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code
|
385
376
|
*
|
@@ -389,7 +380,6 @@ GIT_EXTERN(int) git_reference_rename(
|
|
389
380
|
git_reference *ref,
|
390
381
|
const char *new_name,
|
391
382
|
int force,
|
392
|
-
const git_signature *signature,
|
393
383
|
const char *log_message);
|
394
384
|
|
395
385
|
/**
|
@@ -376,15 +376,14 @@ GIT_EXTERN(void) git_remote_free(git_remote *remote);
|
|
376
376
|
* Update the tips to the new state
|
377
377
|
*
|
378
378
|
* @param remote the remote to update
|
379
|
-
* @param
|
380
|
-
*
|
381
|
-
*
|
382
|
-
*
|
379
|
+
* @param reflog_message The message to insert into the reflogs. If
|
380
|
+
* NULL and fetching, the default is "fetch <name>", where <name> is
|
381
|
+
* the name of the remote (or its url, for in-memory remotes). This
|
382
|
+
* parameter is ignored when pushing.
|
383
383
|
* @return 0 or an error code
|
384
384
|
*/
|
385
385
|
GIT_EXTERN(int) git_remote_update_tips(
|
386
386
|
git_remote *remote,
|
387
|
-
const git_signature *signature,
|
388
387
|
const char *reflog_message);
|
389
388
|
|
390
389
|
/**
|
@@ -404,7 +403,6 @@ GIT_EXTERN(int) git_remote_prune(git_remote *remote);
|
|
404
403
|
* @param remote the remote to fetch from
|
405
404
|
* @param refspecs the refspecs to use for this fetch. Pass NULL or an
|
406
405
|
* empty array to use the base refspecs.
|
407
|
-
* @param signature The identity to use when updating reflogs
|
408
406
|
* @param reflog_message The message to insert into the reflogs. If NULL, the
|
409
407
|
* default is "fetch"
|
410
408
|
* @return 0 or an error code
|
@@ -412,7 +410,6 @@ GIT_EXTERN(int) git_remote_prune(git_remote *remote);
|
|
412
410
|
GIT_EXTERN(int) git_remote_fetch(
|
413
411
|
git_remote *remote,
|
414
412
|
const git_strarray *refspecs,
|
415
|
-
const git_signature *signature,
|
416
413
|
const char *reflog_message);
|
417
414
|
|
418
415
|
/**
|
@@ -424,13 +421,10 @@ GIT_EXTERN(int) git_remote_fetch(
|
|
424
421
|
* @param refspecs the refspecs to use for pushing. If none are
|
425
422
|
* passed, the configured refspecs will be used
|
426
423
|
* @param opts the options
|
427
|
-
* @param signature signature to use for the reflog of updated references
|
428
|
-
* @param reflog_message message to use for the reflog of upated references
|
429
424
|
*/
|
430
425
|
GIT_EXTERN(int) git_remote_push(git_remote *remote,
|
431
426
|
const git_strarray *refspecs,
|
432
|
-
const git_push_options *opts
|
433
|
-
const git_signature *signature, const char *reflog_message);
|
427
|
+
const git_push_options *opts);
|
434
428
|
|
435
429
|
/**
|
436
430
|
* Get a list of the configured remotes for a repo
|
@@ -603,15 +603,11 @@ GIT_EXTERN(int) git_repository_hashfile(
|
|
603
603
|
*
|
604
604
|
* @param repo Repository pointer
|
605
605
|
* @param refname Canonical name of the reference the HEAD should point at
|
606
|
-
* @param signature The identity that will used to populate the reflog entry
|
607
|
-
* @param log_message The one line long message to be appended to the reflog
|
608
606
|
* @return 0 on success, or an error code
|
609
607
|
*/
|
610
608
|
GIT_EXTERN(int) git_repository_set_head(
|
611
609
|
git_repository* repo,
|
612
|
-
const char* refname
|
613
|
-
const git_signature *signature,
|
614
|
-
const char *log_message);
|
610
|
+
const char* refname);
|
615
611
|
|
616
612
|
/**
|
617
613
|
* Make the repository HEAD directly point to the Commit.
|
@@ -627,15 +623,27 @@ GIT_EXTERN(int) git_repository_set_head(
|
|
627
623
|
*
|
628
624
|
* @param repo Repository pointer
|
629
625
|
* @param commitish Object id of the Commit the HEAD should point to
|
630
|
-
* @param signature The identity that will used to populate the reflog entry
|
631
|
-
* @param log_message The one line long message to be appended to the reflog
|
632
626
|
* @return 0 on success, or an error code
|
633
627
|
*/
|
634
628
|
GIT_EXTERN(int) git_repository_set_head_detached(
|
635
629
|
git_repository* repo,
|
636
|
-
const git_oid* commitish
|
637
|
-
|
638
|
-
|
630
|
+
const git_oid* commitish);
|
631
|
+
|
632
|
+
/**
|
633
|
+
* Make the repository HEAD directly point to the Commit.
|
634
|
+
*
|
635
|
+
* This behaves like `git_repository_set_head_detached()` but takes an
|
636
|
+
* annotated commit, which lets you specify which extended sha syntax
|
637
|
+
* string was specified by a user, allowing for more exact reflog
|
638
|
+
* messages.
|
639
|
+
*
|
640
|
+
* See the documentation for `git_repository_set_head_detached()`.
|
641
|
+
*
|
642
|
+
* @see git_repository_set_head_detached
|
643
|
+
*/
|
644
|
+
GIT_EXTERN(int) git_repository_set_head_detached_from_annotated(
|
645
|
+
git_repository *repo,
|
646
|
+
const git_annotated_commit *commitish);
|
639
647
|
|
640
648
|
/**
|
641
649
|
* Detach the HEAD.
|
@@ -651,15 +659,11 @@ GIT_EXTERN(int) git_repository_set_head_detached(
|
|
651
659
|
* Otherwise, the HEAD will be detached and point to the peeled Commit.
|
652
660
|
*
|
653
661
|
* @param repo Repository pointer
|
654
|
-
* @param signature The identity that will used to populate the reflog entry
|
655
|
-
* @param reflog_message The one line long message to be appended to the reflog
|
656
662
|
* @return 0 on success, GIT_EUNBORNBRANCH when HEAD points to a non existing
|
657
663
|
* branch or an error code
|
658
664
|
*/
|
659
665
|
GIT_EXTERN(int) git_repository_detach_head(
|
660
|
-
git_repository* repo
|
661
|
-
const git_signature *signature,
|
662
|
-
const char *reflog_message);
|
666
|
+
git_repository* repo);
|
663
667
|
|
664
668
|
/**
|
665
669
|
* Repository state
|
@@ -720,6 +724,31 @@ GIT_EXTERN(const char *) git_repository_get_namespace(git_repository *repo);
|
|
720
724
|
*/
|
721
725
|
GIT_EXTERN(int) git_repository_is_shallow(git_repository *repo);
|
722
726
|
|
727
|
+
/**
|
728
|
+
* Retrieve the configured identity to use for reflogs
|
729
|
+
*
|
730
|
+
* The memory is owned by the repository and must not be freed by the
|
731
|
+
* user.
|
732
|
+
*
|
733
|
+
* @param name where to store the pointer to the name
|
734
|
+
* @param email where to store the pointer to the email
|
735
|
+
* @param repo the repository
|
736
|
+
*/
|
737
|
+
GIT_EXTERN(int) git_repository_ident(const char **name, const char **email, const git_repository *repo);
|
738
|
+
|
739
|
+
/**
|
740
|
+
* Set the identity to be used for writing reflogs
|
741
|
+
*
|
742
|
+
* If both are set, this name and email will be used to write to the
|
743
|
+
* reflog. Pass NULL to unset. When unset, the identity will be taken
|
744
|
+
* from the repository's configuration.
|
745
|
+
*
|
746
|
+
* @param repo the repository to configure
|
747
|
+
* @param name the name to use for the reflog entries
|
748
|
+
* @param name the email to use for the reflog entries
|
749
|
+
*/
|
750
|
+
GIT_EXTERN(int) git_repository_set_ident(git_repository *repo, const char *name, const char *email);
|
751
|
+
|
723
752
|
/** @} */
|
724
753
|
GIT_END_DECL
|
725
754
|
#endif
|
@@ -56,22 +56,31 @@ typedef enum {
|
|
56
56
|
* The checkout_strategy field will be overridden (based on reset_type).
|
57
57
|
* This parameter can be used to propagate notify and progress callbacks.
|
58
58
|
*
|
59
|
-
* @param signature The identity that will used to populate the reflog entry
|
60
|
-
*
|
61
|
-
* @param log_message The one line long message to be appended to the reflog.
|
62
|
-
* The reflog is only updated if the affected direct reference is actually
|
63
|
-
* changing. If NULL, the default is "reset: moving"; if you want something more
|
64
|
-
* useful, provide a message.
|
65
|
-
*
|
66
59
|
* @return 0 on success or an error code
|
67
60
|
*/
|
68
61
|
GIT_EXTERN(int) git_reset(
|
69
62
|
git_repository *repo,
|
70
63
|
git_object *target,
|
71
64
|
git_reset_t reset_type,
|
72
|
-
git_checkout_options *checkout_opts
|
73
|
-
|
74
|
-
|
65
|
+
git_checkout_options *checkout_opts);
|
66
|
+
|
67
|
+
/**
|
68
|
+
* Sets the current head to the specified commit oid and optionally
|
69
|
+
* resets the index and working tree to match.
|
70
|
+
*
|
71
|
+
* This behaves like `git_reset()` but takes an annotated commit,
|
72
|
+
* which lets you specify which extended sha syntax string was
|
73
|
+
* specified by a user, allowing for more exact reflog messages.
|
74
|
+
*
|
75
|
+
* See the documentation for `git_reset()`.
|
76
|
+
*
|
77
|
+
* @see git_reset
|
78
|
+
*/
|
79
|
+
GIT_EXTERN(int) git_reset_from_annotated(
|
80
|
+
git_repository *repo,
|
81
|
+
git_annotated_commit *commit,
|
82
|
+
git_reset_t reset_type,
|
83
|
+
git_checkout_options *checkout_opts);
|
75
84
|
|
76
85
|
/**
|
77
86
|
* Updates some entries in the index from the target commit tree.
|
@@ -29,8 +29,8 @@ typedef struct {
|
|
29
29
|
/** For merge commits, the "mainline" is treated as the parent. */
|
30
30
|
unsigned int mainline;
|
31
31
|
|
32
|
-
git_merge_options merge_opts;
|
33
|
-
git_checkout_options checkout_opts;
|
32
|
+
git_merge_options merge_opts; /**< Options for the merging */
|
33
|
+
git_checkout_options checkout_opts; /**< Options for the checkout */
|
34
34
|
} git_revert_options;
|
35
35
|
|
36
36
|
#define GIT_REVERT_OPTIONS_VERSION 1
|
@@ -137,23 +137,17 @@ typedef struct git_submodule_update_options {
|
|
137
137
|
|
138
138
|
/**
|
139
139
|
* The checkout strategy to use when the sub repository needs to
|
140
|
-
* be cloned. Use
|
140
|
+
* be cloned. Use GIT_CHECKOUT_SAFE to create all files
|
141
141
|
* in the working directory for the newly cloned repository.
|
142
142
|
*/
|
143
143
|
unsigned int clone_checkout_strategy;
|
144
|
-
|
145
|
-
/**
|
146
|
-
* The identity used when updating the reflog. NULL means to
|
147
|
-
* use the default signature using the config.
|
148
|
-
*/
|
149
|
-
git_signature *signature;
|
150
144
|
} git_submodule_update_options;
|
151
145
|
|
152
146
|
#define GIT_SUBMODULE_UPDATE_OPTIONS_VERSION 1
|
153
147
|
#define GIT_SUBMODULE_UPDATE_OPTIONS_INIT \
|
154
148
|
{ GIT_CHECKOUT_OPTIONS_VERSION, \
|
155
|
-
{ GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE}, \
|
156
|
-
GIT_REMOTE_CALLBACKS_INIT,
|
149
|
+
{ GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE }, \
|
150
|
+
GIT_REMOTE_CALLBACKS_INIT, GIT_CHECKOUT_SAFE }
|
157
151
|
|
158
152
|
/**
|
159
153
|
* Initializes a `git_submodule_update_options` with default values.
|
@@ -53,11 +53,13 @@ struct git_config_iterator {
|
|
53
53
|
*/
|
54
54
|
struct git_config_backend {
|
55
55
|
unsigned int version;
|
56
|
+
/** True if this backend is for a snapshot */
|
57
|
+
int readonly;
|
56
58
|
struct git_config *cfg;
|
57
59
|
|
58
60
|
/* Open means open the file/database and parse if necessary */
|
59
61
|
int (*open)(struct git_config_backend *, git_config_level_t level);
|
60
|
-
int (*get)(struct git_config_backend *, const char *key,
|
62
|
+
int (*get)(struct git_config_backend *, const char *key, git_config_entry **entry);
|
61
63
|
int (*set)(struct git_config_backend *, const char *key, const char *value);
|
62
64
|
int (*set_multivar)(git_config_backend *cfg, const char *name, const char *regexp, const char *value);
|
63
65
|
int (*del)(struct git_config_backend *, const char *key);
|
@@ -123,9 +123,9 @@ GIT_EXTERN(const git_oid *) git_filter_source_id(const git_filter_source *src);
|
|
123
123
|
GIT_EXTERN(git_filter_mode_t) git_filter_source_mode(const git_filter_source *src);
|
124
124
|
|
125
125
|
/**
|
126
|
-
* Get the combination
|
126
|
+
* Get the combination git_filter_flag_t options to be applied
|
127
127
|
*/
|
128
|
-
GIT_EXTERN(uint32_t)
|
128
|
+
GIT_EXTERN(uint32_t) git_filter_source_flags(const git_filter_source *src);
|
129
129
|
|
130
130
|
/*
|
131
131
|
* struct git_filter
|
@@ -208,6 +208,13 @@ typedef int (*git_filter_apply_fn)(
|
|
208
208
|
const git_buf *from,
|
209
209
|
const git_filter_source *src);
|
210
210
|
|
211
|
+
typedef int (*git_filter_stream_fn)(
|
212
|
+
git_writestream **out,
|
213
|
+
git_filter *self,
|
214
|
+
void **payload,
|
215
|
+
const git_filter_source *src,
|
216
|
+
git_writestream *next);
|
217
|
+
|
211
218
|
/**
|
212
219
|
* Callback to clean up after filtering has been applied
|
213
220
|
*
|
@@ -247,6 +254,7 @@ struct git_filter {
|
|
247
254
|
git_filter_shutdown_fn shutdown;
|
248
255
|
git_filter_check_fn check;
|
249
256
|
git_filter_apply_fn apply;
|
257
|
+
git_filter_stream_fn stream;
|
250
258
|
git_filter_cleanup_fn cleanup;
|
251
259
|
};
|
252
260
|
|
@@ -12,33 +12,52 @@
|
|
12
12
|
GIT_BEGIN_DECL
|
13
13
|
|
14
14
|
/**
|
15
|
-
* Similarity signature of
|
15
|
+
* Similarity signature of arbitrary text content based on line hashes
|
16
16
|
*/
|
17
17
|
typedef struct git_hashsig git_hashsig;
|
18
18
|
|
19
19
|
/**
|
20
|
-
* Options for hashsig
|
20
|
+
* Options for hashsig computation
|
21
|
+
*
|
22
|
+
* The options GIT_HASHSIG_NORMAL, GIT_HASHSIG_IGNORE_WHITESPACE,
|
23
|
+
* GIT_HASHSIG_SMART_WHITESPACE are exclusive and should not be combined.
|
21
24
|
*/
|
22
25
|
typedef enum {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
+
/**
|
27
|
+
* Use all data
|
28
|
+
*/
|
29
|
+
GIT_HASHSIG_NORMAL = 0,
|
30
|
+
|
31
|
+
/**
|
32
|
+
* Ignore whitespace
|
33
|
+
*/
|
34
|
+
GIT_HASHSIG_IGNORE_WHITESPACE = (1 << 0),
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Ignore \r and all space after \n
|
38
|
+
*/
|
39
|
+
GIT_HASHSIG_SMART_WHITESPACE = (1 << 1),
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Allow hashing of small files
|
43
|
+
*/
|
44
|
+
GIT_HASHSIG_ALLOW_SMALL_FILES = (1 << 2)
|
26
45
|
} git_hashsig_option_t;
|
27
46
|
|
28
47
|
/**
|
29
|
-
*
|
30
|
-
*
|
31
|
-
* If you have passed a whitespace-ignoring buffer, then the whitespace
|
32
|
-
* will be removed from the buffer while it is being processed, modifying
|
33
|
-
* the buffer in place. Sorry about that!
|
48
|
+
* Compute a similarity signature for a text buffer
|
34
49
|
*
|
35
|
-
*
|
36
|
-
*
|
50
|
+
* If you have passed the option GIT_HASHSIG_IGNORE_WHITESPACE, then the
|
51
|
+
* whitespace will be removed from the buffer while it is being processed,
|
52
|
+
* modifying the buffer in place. Sorry about that!
|
37
53
|
*
|
38
|
-
* @param out The
|
39
|
-
* @param buf The
|
40
|
-
* @param buflen The
|
41
|
-
* @param
|
54
|
+
* @param out The computed similarity signature.
|
55
|
+
* @param buf The input buffer.
|
56
|
+
* @param buflen The input buffer size.
|
57
|
+
* @param opts The signature computation options (see above).
|
58
|
+
* @return 0 on success, GIT_EBUFS if the buffer doesn't contain enough data to
|
59
|
+
* compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or
|
60
|
+
* error code.
|
42
61
|
*/
|
43
62
|
GIT_EXTERN(int) git_hashsig_create(
|
44
63
|
git_hashsig **out,
|
@@ -47,13 +66,17 @@ GIT_EXTERN(int) git_hashsig_create(
|
|
47
66
|
git_hashsig_option_t opts);
|
48
67
|
|
49
68
|
/**
|
50
|
-
*
|
69
|
+
* Compute a similarity signature for a text file
|
51
70
|
*
|
52
71
|
* This walks through the file, only loading a maximum of 4K of file data at
|
53
|
-
* a time.
|
72
|
+
* a time. Otherwise, it acts just like `git_hashsig_create`.
|
54
73
|
*
|
55
|
-
*
|
56
|
-
*
|
74
|
+
* @param out The computed similarity signature.
|
75
|
+
* @param path The path to the input file.
|
76
|
+
* @param opts The signature computation options (see above).
|
77
|
+
* @return 0 on success, GIT_EBUFS if the buffer doesn't contain enough data to
|
78
|
+
* compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or
|
79
|
+
* error code.
|
57
80
|
*/
|
58
81
|
GIT_EXTERN(int) git_hashsig_create_fromfile(
|
59
82
|
git_hashsig **out,
|
@@ -62,13 +85,17 @@ GIT_EXTERN(int) git_hashsig_create_fromfile(
|
|
62
85
|
|
63
86
|
/**
|
64
87
|
* Release memory for a content similarity signature
|
88
|
+
*
|
89
|
+
* @param sig The similarity signature to free.
|
65
90
|
*/
|
66
91
|
GIT_EXTERN(void) git_hashsig_free(git_hashsig *sig);
|
67
92
|
|
68
93
|
/**
|
69
|
-
* Measure similarity between two
|
94
|
+
* Measure similarity score between two similarity signatures
|
70
95
|
*
|
71
|
-
* @
|
96
|
+
* @param a The first similarity signature to compare.
|
97
|
+
* @param b The second similarity signature to compare.
|
98
|
+
* @return [0 to 100] on success as the similarity score, or error code.
|
72
99
|
*/
|
73
100
|
GIT_EXTERN(int) git_hashsig_compare(
|
74
101
|
const git_hashsig *a,
|