rugged 0.27.10.1 → 0.28.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/rugged/extconf.rb +23 -2
- data/ext/rugged/rugged.c +48 -2
- data/ext/rugged/rugged.h +5 -0
- data/ext/rugged/rugged_allocator.c +89 -0
- data/ext/rugged/rugged_blob.c +3 -3
- data/ext/rugged/rugged_branch.c +1 -1
- data/ext/rugged/rugged_commit.c +8 -8
- data/ext/rugged/rugged_config.c +1 -1
- data/ext/rugged/rugged_diff.c +24 -4
- data/ext/rugged/rugged_note.c +1 -1
- data/ext/rugged/rugged_repo.c +10 -10
- data/ext/rugged/rugged_settings.c +1 -1
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/CMakeLists.txt +69 -47
- data/vendor/libgit2/cmake/Modules/AddCFlagIfSupported.cmake +15 -1
- data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +5 -8
- data/vendor/libgit2/cmake/Modules/FindmbedTLS.cmake +93 -0
- data/vendor/libgit2/deps/http-parser/CMakeLists.txt +2 -0
- data/vendor/libgit2/deps/http-parser/{LICENSE-MIT → COPYING} +0 -0
- data/vendor/libgit2/deps/regex/COPYING +502 -0
- data/vendor/libgit2/deps/winhttp/COPYING.GPL +993 -0
- data/vendor/libgit2/deps/winhttp/COPYING.LGPL +502 -0
- data/vendor/libgit2/deps/zlib/CMakeLists.txt +1 -0
- data/vendor/libgit2/deps/zlib/COPYING +27 -0
- data/vendor/libgit2/include/git2.h +3 -0
- data/vendor/libgit2/include/git2/annotated_commit.h +9 -0
- data/vendor/libgit2/include/git2/apply.h +129 -0
- data/vendor/libgit2/include/git2/attr.h +19 -8
- data/vendor/libgit2/include/git2/blame.h +41 -24
- data/vendor/libgit2/include/git2/blob.h +1 -1
- data/vendor/libgit2/include/git2/branch.h +1 -1
- data/vendor/libgit2/include/git2/buffer.h +2 -2
- data/vendor/libgit2/include/git2/checkout.h +20 -19
- data/vendor/libgit2/include/git2/cherrypick.h +6 -4
- data/vendor/libgit2/include/git2/clone.h +11 -9
- data/vendor/libgit2/include/git2/commit.h +30 -2
- data/vendor/libgit2/include/git2/common.h +54 -4
- data/vendor/libgit2/include/git2/config.h +18 -7
- data/vendor/libgit2/include/git2/deprecated.h +253 -0
- data/vendor/libgit2/include/git2/describe.h +30 -7
- data/vendor/libgit2/include/git2/diff.h +193 -143
- data/vendor/libgit2/include/git2/errors.h +54 -46
- data/vendor/libgit2/include/git2/ignore.h +2 -2
- data/vendor/libgit2/include/git2/index.h +72 -51
- data/vendor/libgit2/include/git2/indexer.h +30 -4
- data/vendor/libgit2/include/git2/mailmap.h +115 -0
- data/vendor/libgit2/include/git2/merge.h +29 -8
- data/vendor/libgit2/include/git2/net.h +1 -1
- data/vendor/libgit2/include/git2/notes.h +1 -1
- data/vendor/libgit2/include/git2/object.h +16 -16
- data/vendor/libgit2/include/git2/odb.h +10 -10
- data/vendor/libgit2/include/git2/odb_backend.h +7 -7
- data/vendor/libgit2/include/git2/oid.h +1 -1
- data/vendor/libgit2/include/git2/pack.h +2 -2
- data/vendor/libgit2/include/git2/proxy.h +9 -5
- data/vendor/libgit2/include/git2/rebase.h +7 -4
- data/vendor/libgit2/include/git2/refs.h +14 -15
- data/vendor/libgit2/include/git2/refspec.h +17 -0
- data/vendor/libgit2/include/git2/remote.h +92 -16
- data/vendor/libgit2/include/git2/repository.h +52 -37
- data/vendor/libgit2/include/git2/revert.h +5 -3
- data/vendor/libgit2/include/git2/revwalk.h +7 -7
- data/vendor/libgit2/include/git2/signature.h +2 -2
- data/vendor/libgit2/include/git2/stash.h +13 -10
- data/vendor/libgit2/include/git2/status.h +8 -4
- data/vendor/libgit2/include/git2/submodule.h +11 -10
- data/vendor/libgit2/include/git2/sys/alloc.h +101 -0
- data/vendor/libgit2/include/git2/sys/commit.h +1 -1
- data/vendor/libgit2/include/git2/sys/config.h +13 -13
- data/vendor/libgit2/include/git2/sys/filter.h +6 -6
- data/vendor/libgit2/include/git2/sys/index.h +3 -0
- data/vendor/libgit2/include/git2/sys/mempack.h +35 -35
- data/vendor/libgit2/include/git2/sys/merge.h +9 -4
- data/vendor/libgit2/include/git2/sys/odb_backend.h +19 -19
- data/vendor/libgit2/include/git2/sys/path.h +64 -0
- data/vendor/libgit2/include/git2/sys/refdb_backend.h +19 -19
- data/vendor/libgit2/include/git2/sys/stream.h +92 -12
- data/vendor/libgit2/include/git2/sys/transport.h +127 -81
- data/vendor/libgit2/include/git2/tag.h +2 -2
- data/vendor/libgit2/include/git2/trace.h +1 -1
- data/vendor/libgit2/include/git2/transaction.h +1 -0
- data/vendor/libgit2/include/git2/transport.h +47 -18
- data/vendor/libgit2/include/git2/tree.h +3 -3
- data/vendor/libgit2/include/git2/types.h +35 -28
- data/vendor/libgit2/include/git2/version.h +4 -4
- data/vendor/libgit2/include/git2/worktree.h +47 -12
- data/vendor/libgit2/src/CMakeLists.txt +87 -26
- data/vendor/libgit2/src/alloc.c +55 -0
- data/vendor/libgit2/src/alloc.h +40 -0
- data/vendor/libgit2/src/annotated_commit.c +15 -8
- data/vendor/libgit2/src/apply.c +490 -14
- data/vendor/libgit2/src/apply.h +3 -1
- data/vendor/libgit2/src/array.h +2 -2
- data/vendor/libgit2/src/attr.c +11 -11
- data/vendor/libgit2/src/attr_file.c +20 -15
- data/vendor/libgit2/src/attrcache.c +11 -11
- data/vendor/libgit2/src/blame.c +30 -15
- data/vendor/libgit2/src/blame.h +1 -0
- data/vendor/libgit2/src/blame_git.c +16 -13
- data/vendor/libgit2/src/blob.c +50 -28
- data/vendor/libgit2/src/blob.h +18 -1
- data/vendor/libgit2/src/branch.c +38 -38
- data/vendor/libgit2/src/buf_text.c +7 -6
- data/vendor/libgit2/src/buffer.c +55 -50
- data/vendor/libgit2/src/buffer.h +1 -1
- data/vendor/libgit2/src/cache.c +16 -16
- data/vendor/libgit2/src/cache.h +2 -2
- data/vendor/libgit2/src/cc-compat.h +15 -3
- data/vendor/libgit2/src/checkout.c +83 -74
- data/vendor/libgit2/src/cherrypick.c +6 -6
- data/vendor/libgit2/src/clone.c +20 -20
- data/vendor/libgit2/src/commit.c +53 -33
- data/vendor/libgit2/src/commit.h +1 -0
- data/vendor/libgit2/src/commit_list.c +6 -10
- data/vendor/libgit2/src/common.h +32 -30
- data/vendor/libgit2/src/config.c +167 -147
- data/vendor/libgit2/src/config.h +1 -14
- data/vendor/libgit2/src/config_backend.h +84 -0
- data/vendor/libgit2/src/config_cache.c +7 -1
- data/vendor/libgit2/src/config_entries.c +259 -0
- data/vendor/libgit2/src/config_entries.h +23 -0
- data/vendor/libgit2/src/config_file.c +167 -439
- data/vendor/libgit2/src/config_mem.c +224 -0
- data/vendor/libgit2/src/config_parse.c +69 -38
- data/vendor/libgit2/src/config_parse.h +4 -4
- data/vendor/libgit2/src/crlf.c +215 -186
- data/vendor/libgit2/src/delta.c +25 -18
- data/vendor/libgit2/src/describe.c +23 -23
- data/vendor/libgit2/src/diff.c +12 -12
- data/vendor/libgit2/src/diff_driver.c +14 -15
- data/vendor/libgit2/src/diff_file.c +10 -10
- data/vendor/libgit2/src/diff_generate.c +29 -23
- data/vendor/libgit2/src/diff_generate.h +1 -1
- data/vendor/libgit2/src/diff_parse.c +3 -3
- data/vendor/libgit2/src/diff_print.c +17 -17
- data/vendor/libgit2/src/diff_stats.c +22 -7
- data/vendor/libgit2/src/diff_tform.c +12 -12
- data/vendor/libgit2/src/diff_xdiff.c +15 -3
- data/vendor/libgit2/src/errors.c +42 -20
- data/vendor/libgit2/src/features.h.in +2 -1
- data/vendor/libgit2/src/fetch.c +3 -3
- data/vendor/libgit2/src/fetchhead.c +16 -16
- data/vendor/libgit2/src/filebuf.c +28 -28
- data/vendor/libgit2/src/fileops.c +54 -54
- data/vendor/libgit2/src/fileops.h +1 -1
- data/vendor/libgit2/src/filter.c +30 -30
- data/vendor/libgit2/src/filter.h +0 -10
- data/vendor/libgit2/src/global.c +36 -23
- data/vendor/libgit2/src/hash.h +4 -1
- data/vendor/libgit2/src/hash/hash_collisiondetect.h +6 -2
- data/vendor/libgit2/src/hash/hash_common_crypto.h +5 -1
- data/vendor/libgit2/src/hash/hash_generic.h +5 -1
- data/vendor/libgit2/src/hash/hash_mbedtls.c +38 -0
- data/vendor/libgit2/src/hash/hash_mbedtls.h +24 -0
- data/vendor/libgit2/src/hash/hash_openssl.h +8 -4
- data/vendor/libgit2/src/hash/hash_win32.c +13 -13
- data/vendor/libgit2/src/hashsig.c +4 -4
- data/vendor/libgit2/src/idxmap.c +25 -5
- data/vendor/libgit2/src/idxmap.h +4 -18
- data/vendor/libgit2/src/ignore.c +9 -9
- data/vendor/libgit2/src/index.c +280 -198
- data/vendor/libgit2/src/index.h +16 -0
- data/vendor/libgit2/src/indexer.c +311 -139
- data/vendor/libgit2/src/integer.h +32 -22
- data/vendor/libgit2/src/iterator.c +116 -49
- data/vendor/libgit2/src/iterator.h +15 -0
- data/vendor/libgit2/src/khash.h +3 -1
- data/vendor/libgit2/src/mailmap.c +485 -0
- data/vendor/libgit2/src/mailmap.h +35 -0
- data/vendor/libgit2/src/merge.c +89 -59
- data/vendor/libgit2/src/merge_driver.c +7 -7
- data/vendor/libgit2/src/merge_file.c +1 -1
- data/vendor/libgit2/src/mwindow.c +8 -8
- data/vendor/libgit2/src/netops.c +22 -13
- data/vendor/libgit2/src/netops.h +2 -0
- data/vendor/libgit2/src/notes.c +15 -10
- data/vendor/libgit2/src/object.c +118 -67
- data/vendor/libgit2/src/object.h +20 -9
- data/vendor/libgit2/src/object_api.c +8 -8
- data/vendor/libgit2/src/odb.c +72 -72
- data/vendor/libgit2/src/odb.h +7 -7
- data/vendor/libgit2/src/odb_loose.c +46 -46
- data/vendor/libgit2/src/odb_mempack.c +14 -14
- data/vendor/libgit2/src/odb_pack.c +14 -10
- data/vendor/libgit2/src/offmap.c +30 -0
- data/vendor/libgit2/src/offmap.h +20 -11
- data/vendor/libgit2/src/oid.c +6 -6
- data/vendor/libgit2/src/oidmap.c +20 -0
- data/vendor/libgit2/src/oidmap.h +9 -12
- data/vendor/libgit2/src/pack-objects.c +71 -63
- data/vendor/libgit2/src/pack-objects.h +1 -7
- data/vendor/libgit2/src/pack.c +58 -58
- data/vendor/libgit2/src/pack.h +6 -6
- data/vendor/libgit2/src/parse.h +1 -1
- data/vendor/libgit2/src/patch.c +3 -3
- data/vendor/libgit2/src/patch_generate.c +18 -18
- data/vendor/libgit2/src/patch_parse.c +13 -13
- data/vendor/libgit2/src/path.c +93 -225
- data/vendor/libgit2/src/path.h +2 -84
- data/vendor/libgit2/src/pathspec.c +6 -6
- data/vendor/libgit2/src/posix.c +3 -3
- data/vendor/libgit2/src/proxy.c +1 -1
- data/vendor/libgit2/src/push.c +27 -26
- data/vendor/libgit2/src/push.h +2 -1
- data/vendor/libgit2/src/reader.c +265 -0
- data/vendor/libgit2/src/reader.h +107 -0
- data/vendor/libgit2/src/rebase.c +49 -52
- data/vendor/libgit2/src/refdb.c +3 -3
- data/vendor/libgit2/src/refdb_fs.c +181 -103
- data/vendor/libgit2/src/reflog.c +3 -3
- data/vendor/libgit2/src/refs.c +98 -74
- data/vendor/libgit2/src/refs.h +5 -3
- data/vendor/libgit2/src/refspec.c +47 -21
- data/vendor/libgit2/src/refspec.h +1 -1
- data/vendor/libgit2/src/remote.c +219 -166
- data/vendor/libgit2/src/remote.h +9 -0
- data/vendor/libgit2/src/repository.c +173 -133
- data/vendor/libgit2/src/repository.h +6 -3
- data/vendor/libgit2/src/reset.c +8 -8
- data/vendor/libgit2/src/revert.c +6 -6
- data/vendor/libgit2/src/revparse.c +30 -30
- data/vendor/libgit2/src/revwalk.c +60 -30
- data/vendor/libgit2/src/revwalk.h +2 -1
- data/vendor/libgit2/src/settings.c +42 -10
- data/vendor/libgit2/src/signature.c +11 -11
- data/vendor/libgit2/src/sortedcache.c +13 -13
- data/vendor/libgit2/src/stash.c +91 -45
- data/vendor/libgit2/src/status.c +13 -13
- data/vendor/libgit2/src/stdalloc.c +120 -0
- data/vendor/libgit2/src/{streams/curl.h → stdalloc.h} +6 -6
- data/vendor/libgit2/src/stream.h +17 -2
- data/vendor/libgit2/src/streams/mbedtls.c +483 -0
- data/vendor/libgit2/src/streams/mbedtls.h +23 -0
- data/vendor/libgit2/src/streams/openssl.c +204 -114
- data/vendor/libgit2/src/streams/openssl.h +4 -108
- data/vendor/libgit2/src/streams/registry.c +118 -0
- data/vendor/libgit2/src/streams/registry.h +19 -0
- data/vendor/libgit2/src/streams/socket.c +54 -29
- data/vendor/libgit2/src/streams/stransport.c +57 -32
- data/vendor/libgit2/src/streams/stransport.h +5 -0
- data/vendor/libgit2/src/streams/tls.c +50 -19
- data/vendor/libgit2/src/streams/tls.h +12 -4
- data/vendor/libgit2/src/strmap.c +22 -2
- data/vendor/libgit2/src/strmap.h +18 -15
- data/vendor/libgit2/src/submodule.c +179 -155
- data/vendor/libgit2/src/sysdir.c +18 -18
- data/vendor/libgit2/src/tag.c +31 -26
- data/vendor/libgit2/src/tag.h +2 -1
- data/vendor/libgit2/src/trace.c +1 -1
- data/vendor/libgit2/src/trace.h +1 -1
- data/vendor/libgit2/src/trailer.c +6 -6
- data/vendor/libgit2/src/transaction.c +23 -23
- data/vendor/libgit2/src/transport.c +5 -5
- data/vendor/libgit2/src/transports/auth.c +7 -4
- data/vendor/libgit2/src/transports/auth.h +1 -1
- data/vendor/libgit2/src/transports/auth_negotiate.c +12 -11
- data/vendor/libgit2/src/transports/cred.c +18 -18
- data/vendor/libgit2/src/transports/git.c +15 -15
- data/vendor/libgit2/src/transports/http.c +606 -216
- data/vendor/libgit2/src/transports/http.h +2 -0
- data/vendor/libgit2/src/transports/local.c +26 -26
- data/vendor/libgit2/src/transports/smart.c +54 -31
- data/vendor/libgit2/src/transports/smart.h +1 -2
- data/vendor/libgit2/src/transports/smart_pkt.c +43 -40
- data/vendor/libgit2/src/transports/smart_protocol.c +61 -57
- data/vendor/libgit2/src/transports/ssh.c +34 -33
- data/vendor/libgit2/src/transports/winhttp.c +99 -119
- data/vendor/libgit2/src/tree-cache.c +5 -5
- data/vendor/libgit2/src/tree.c +96 -121
- data/vendor/libgit2/src/tree.h +1 -12
- data/vendor/libgit2/src/unix/map.c +2 -2
- data/vendor/libgit2/src/util.c +22 -6
- data/vendor/libgit2/src/util.h +12 -135
- data/vendor/libgit2/src/vector.c +4 -4
- data/vendor/libgit2/src/win32/dir.c +3 -3
- data/vendor/libgit2/src/win32/findfile.c +3 -3
- data/vendor/libgit2/src/win32/map.c +6 -6
- data/vendor/libgit2/src/win32/msvc-compat.h +6 -0
- data/vendor/libgit2/src/win32/path_w32.c +101 -7
- data/vendor/libgit2/src/win32/path_w32.h +18 -0
- data/vendor/libgit2/src/win32/posix_w32.c +24 -43
- data/vendor/libgit2/src/win32/w32_buffer.c +2 -2
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +96 -2
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +28 -75
- data/vendor/libgit2/src/win32/w32_stack.c +2 -2
- data/vendor/libgit2/src/win32/w32_util.c +1 -69
- data/vendor/libgit2/src/win32/w32_util.h +1 -19
- data/vendor/libgit2/src/worktree.c +75 -54
- data/vendor/libgit2/src/worktree.h +2 -0
- data/vendor/libgit2/src/xdiff/xdiffi.c +7 -5
- data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
- data/vendor/libgit2/src/xdiff/xmerge.c +15 -15
- data/vendor/libgit2/src/zstream.c +4 -4
- metadata +33 -7
- data/vendor/libgit2/src/config_file.h +0 -73
- data/vendor/libgit2/src/streams/curl.c +0 -385
@@ -203,12 +203,13 @@ typedef struct {
|
|
203
203
|
#define GIT_MERGE_FILE_OPTIONS_INIT {GIT_MERGE_FILE_OPTIONS_VERSION}
|
204
204
|
|
205
205
|
/**
|
206
|
+
* Initialize git_merge_file_options structure
|
207
|
+
*
|
206
208
|
* Initializes a `git_merge_file_options` with default values. Equivalent to
|
207
|
-
* creating an instance with GIT_MERGE_FILE_OPTIONS_INIT
|
209
|
+
* creating an instance with `GIT_MERGE_FILE_OPTIONS_INIT`.
|
208
210
|
*
|
209
|
-
* @param opts
|
210
|
-
* @param version
|
211
|
-
* `GIT_MERGE_FILE_OPTIONS_VERSION` here.
|
211
|
+
* @param opts The `git_merge_file_options` struct to initialize.
|
212
|
+
* @param version The struct version; pass `GIT_MERGE_FILE_OPTIONS_VERSION`.
|
212
213
|
* @return Zero on success; -1 on failure.
|
213
214
|
*/
|
214
215
|
GIT_EXTERN(int) git_merge_file_init_options(
|
@@ -300,12 +301,13 @@ typedef struct {
|
|
300
301
|
GIT_MERGE_OPTIONS_VERSION, GIT_MERGE_FIND_RENAMES }
|
301
302
|
|
302
303
|
/**
|
304
|
+
* Initialize git_merge_options structure
|
305
|
+
*
|
303
306
|
* Initializes a `git_merge_options` with default values. Equivalent to
|
304
|
-
* creating an instance with GIT_MERGE_OPTIONS_INIT
|
307
|
+
* creating an instance with `GIT_MERGE_OPTIONS_INIT`.
|
305
308
|
*
|
306
|
-
* @param opts
|
307
|
-
* @param version
|
308
|
-
* `GIT_MERGE_OPTIONS_VERSION` here.
|
309
|
+
* @param opts The `git_merge_options` struct to initialize.
|
310
|
+
* @param version The struct version; pass `GIT_MERGE_OPTIONS_VERSION`.
|
309
311
|
* @return Zero on success; -1 on failure.
|
310
312
|
*/
|
311
313
|
GIT_EXTERN(int) git_merge_init_options(
|
@@ -386,6 +388,25 @@ GIT_EXTERN(int) git_merge_analysis(
|
|
386
388
|
const git_annotated_commit **their_heads,
|
387
389
|
size_t their_heads_len);
|
388
390
|
|
391
|
+
/**
|
392
|
+
* Analyzes the given branch(es) and determines the opportunities for
|
393
|
+
* merging them into a reference.
|
394
|
+
*
|
395
|
+
* @param analysis_out analysis enumeration that the result is written into
|
396
|
+
* @param repo the repository to merge
|
397
|
+
* @param our_ref the reference to perform the analysis from
|
398
|
+
* @param their_heads the heads to merge into
|
399
|
+
* @param their_heads_len the number of heads to merge
|
400
|
+
* @return 0 on success or error code
|
401
|
+
*/
|
402
|
+
GIT_EXTERN(int) git_merge_analysis_for_ref(
|
403
|
+
git_merge_analysis_t *analysis_out,
|
404
|
+
git_merge_preference_t *preference_out,
|
405
|
+
git_repository *repo,
|
406
|
+
git_reference *our_ref,
|
407
|
+
const git_annotated_commit **their_heads,
|
408
|
+
size_t their_heads_len);
|
409
|
+
|
389
410
|
/**
|
390
411
|
* Find a merge base between two commits
|
391
412
|
*
|
@@ -52,7 +52,7 @@ struct git_remote_head {
|
|
52
52
|
/**
|
53
53
|
* Callback for listing the remote heads
|
54
54
|
*/
|
55
|
-
typedef int (
|
55
|
+
typedef int GIT_CALLBACK(git_headlist_cb)(git_remote_head *rhead, void *payload);
|
56
56
|
|
57
57
|
/** @} */
|
58
58
|
GIT_END_DECL
|
@@ -26,7 +26,7 @@ GIT_BEGIN_DECL
|
|
26
26
|
* - annotated_object_id: Oid of the git object being annotated
|
27
27
|
* - payload: Payload data passed to `git_note_foreach`
|
28
28
|
*/
|
29
|
-
typedef int (
|
29
|
+
typedef int GIT_CALLBACK(git_note_foreach_cb)(
|
30
30
|
const git_oid *blob_id, const git_oid *annotated_object_id, void *payload);
|
31
31
|
|
32
32
|
/**
|
@@ -30,7 +30,7 @@ GIT_BEGIN_DECL
|
|
30
30
|
*
|
31
31
|
* The 'type' parameter must match the type of the object
|
32
32
|
* in the odb; the method will fail otherwise.
|
33
|
-
* The special value '
|
33
|
+
* The special value 'GIT_OBJECT_ANY' may be passed to let
|
34
34
|
* the method guess the object's type.
|
35
35
|
*
|
36
36
|
* @param object pointer to the looked-up object
|
@@ -43,7 +43,7 @@ GIT_EXTERN(int) git_object_lookup(
|
|
43
43
|
git_object **object,
|
44
44
|
git_repository *repo,
|
45
45
|
const git_oid *id,
|
46
|
-
|
46
|
+
git_object_t type);
|
47
47
|
|
48
48
|
/**
|
49
49
|
* Lookup a reference to one of the objects in a repository,
|
@@ -62,7 +62,7 @@ GIT_EXTERN(int) git_object_lookup(
|
|
62
62
|
*
|
63
63
|
* The 'type' parameter must match the type of the object
|
64
64
|
* in the odb; the method will fail otherwise.
|
65
|
-
* The special value '
|
65
|
+
* The special value 'GIT_OBJECT_ANY' may be passed to let
|
66
66
|
* the method guess the object's type.
|
67
67
|
*
|
68
68
|
* @param object_out pointer where to store the looked-up object
|
@@ -77,7 +77,7 @@ GIT_EXTERN(int) git_object_lookup_prefix(
|
|
77
77
|
git_repository *repo,
|
78
78
|
const git_oid *id,
|
79
79
|
size_t len,
|
80
|
-
|
80
|
+
git_object_t type);
|
81
81
|
|
82
82
|
|
83
83
|
/**
|
@@ -94,7 +94,7 @@ GIT_EXTERN(int) git_object_lookup_bypath(
|
|
94
94
|
git_object **out,
|
95
95
|
const git_object *treeish,
|
96
96
|
const char *path,
|
97
|
-
|
97
|
+
git_object_t type);
|
98
98
|
|
99
99
|
/**
|
100
100
|
* Get the id (SHA1) of a repository object
|
@@ -124,7 +124,7 @@ GIT_EXTERN(int) git_object_short_id(git_buf *out, const git_object *obj);
|
|
124
124
|
* @param obj the repository object
|
125
125
|
* @return the object's type
|
126
126
|
*/
|
127
|
-
GIT_EXTERN(
|
127
|
+
GIT_EXTERN(git_object_t) git_object_type(const git_object *obj);
|
128
128
|
|
129
129
|
/**
|
130
130
|
* Get the repository that owns this object
|
@@ -166,24 +166,24 @@ GIT_EXTERN(void) git_object_free(git_object *object);
|
|
166
166
|
* @param type object type to convert.
|
167
167
|
* @return the corresponding string representation.
|
168
168
|
*/
|
169
|
-
GIT_EXTERN(const char *) git_object_type2string(
|
169
|
+
GIT_EXTERN(const char *) git_object_type2string(git_object_t type);
|
170
170
|
|
171
171
|
/**
|
172
|
-
* Convert a string object type representation to it's
|
172
|
+
* Convert a string object type representation to it's git_object_t.
|
173
173
|
*
|
174
174
|
* @param str the string to convert.
|
175
|
-
* @return the corresponding
|
175
|
+
* @return the corresponding git_object_t.
|
176
176
|
*/
|
177
|
-
GIT_EXTERN(
|
177
|
+
GIT_EXTERN(git_object_t) git_object_string2type(const char *str);
|
178
178
|
|
179
179
|
/**
|
180
|
-
* Determine if the given
|
180
|
+
* Determine if the given git_object_t is a valid loose object type.
|
181
181
|
*
|
182
182
|
* @param type object type to test.
|
183
183
|
* @return true if the type represents a valid loose object type,
|
184
184
|
* false otherwise.
|
185
185
|
*/
|
186
|
-
GIT_EXTERN(int) git_object_typeisloose(
|
186
|
+
GIT_EXTERN(int) git_object_typeisloose(git_object_t type);
|
187
187
|
|
188
188
|
/**
|
189
189
|
* Get the size in bytes for the structure which
|
@@ -197,7 +197,7 @@ GIT_EXTERN(int) git_object_typeisloose(git_otype type);
|
|
197
197
|
* @param type object type to get its size
|
198
198
|
* @return size in bytes of the object
|
199
199
|
*/
|
200
|
-
GIT_EXTERN(size_t) git_object__size(
|
200
|
+
GIT_EXTERN(size_t) git_object__size(git_object_t type);
|
201
201
|
|
202
202
|
/**
|
203
203
|
* Recursively peel an object until an object of the specified type is met.
|
@@ -206,7 +206,7 @@ GIT_EXTERN(size_t) git_object__size(git_otype type);
|
|
206
206
|
* GIT_EINVALIDSPEC will be returned (e.g. trying to peel a blob to a
|
207
207
|
* tree).
|
208
208
|
*
|
209
|
-
* If you pass `
|
209
|
+
* If you pass `GIT_OBJECT_ANY` as the target type, then the object will
|
210
210
|
* be peeled until the type changes. A tag will be peeled until the
|
211
211
|
* referenced object is no longer a tag, and a commit will be peeled
|
212
212
|
* to a tree. Any other object type will return GIT_EINVALIDSPEC.
|
@@ -219,13 +219,13 @@ GIT_EXTERN(size_t) git_object__size(git_otype type);
|
|
219
219
|
*
|
220
220
|
* @param peeled Pointer to the peeled git_object
|
221
221
|
* @param object The object to be processed
|
222
|
-
* @param target_type The type of the requested object (a
|
222
|
+
* @param target_type The type of the requested object (a GIT_OBJECT_ value)
|
223
223
|
* @return 0 on success, GIT_EINVALIDSPEC, GIT_EPEEL, or an error code
|
224
224
|
*/
|
225
225
|
GIT_EXTERN(int) git_object_peel(
|
226
226
|
git_object **peeled,
|
227
227
|
const git_object *object,
|
228
|
-
|
228
|
+
git_object_t target_type);
|
229
229
|
|
230
230
|
/**
|
231
231
|
* Create an in-memory copy of a Git object. The copy must be
|
@@ -24,7 +24,7 @@ GIT_BEGIN_DECL
|
|
24
24
|
/**
|
25
25
|
* Function type for callbacks from git_odb_foreach.
|
26
26
|
*/
|
27
|
-
typedef int (
|
27
|
+
typedef int GIT_CALLBACK(git_odb_foreach_cb)(const git_oid *id, void *payload);
|
28
28
|
|
29
29
|
/**
|
30
30
|
* Create a new object database with no backends.
|
@@ -146,7 +146,7 @@ GIT_EXTERN(int) git_odb_read_prefix(git_odb_object **out, git_odb *db, const git
|
|
146
146
|
* - 0 if the object was read;
|
147
147
|
* - GIT_ENOTFOUND if the object is not in the database.
|
148
148
|
*/
|
149
|
-
GIT_EXTERN(int) git_odb_read_header(size_t *len_out,
|
149
|
+
GIT_EXTERN(int) git_odb_read_header(size_t *len_out, git_object_t *type_out, git_odb *db, const git_oid *id);
|
150
150
|
|
151
151
|
/**
|
152
152
|
* Determine if the given object can be found in the object database.
|
@@ -189,9 +189,9 @@ typedef struct git_odb_expand_id {
|
|
189
189
|
|
190
190
|
/**
|
191
191
|
* The (optional) type of the object to search for; leave as `0` or set
|
192
|
-
* to `
|
192
|
+
* to `GIT_OBJECT_ANY` to query for any object matching the ID.
|
193
193
|
*/
|
194
|
-
|
194
|
+
git_object_t type;
|
195
195
|
} git_odb_expand_id;
|
196
196
|
|
197
197
|
/**
|
@@ -270,7 +270,7 @@ GIT_EXTERN(int) git_odb_foreach(git_odb *db, git_odb_foreach_cb cb, void *payloa
|
|
270
270
|
* @param type type of the data to store
|
271
271
|
* @return 0 or an error code
|
272
272
|
*/
|
273
|
-
GIT_EXTERN(int) git_odb_write(git_oid *out, git_odb *odb, const void *data, size_t len,
|
273
|
+
GIT_EXTERN(int) git_odb_write(git_oid *out, git_odb *odb, const void *data, size_t len, git_object_t type);
|
274
274
|
|
275
275
|
/**
|
276
276
|
* Open a stream to write an object into the ODB
|
@@ -293,7 +293,7 @@ GIT_EXTERN(int) git_odb_write(git_oid *out, git_odb *odb, const void *data, size
|
|
293
293
|
* @param type type of the object that will be written
|
294
294
|
* @return 0 if the stream was created; error code otherwise
|
295
295
|
*/
|
296
|
-
GIT_EXTERN(int) git_odb_open_wstream(git_odb_stream **out, git_odb *db, git_off_t size,
|
296
|
+
GIT_EXTERN(int) git_odb_open_wstream(git_odb_stream **out, git_odb *db, git_off_t size, git_object_t type);
|
297
297
|
|
298
298
|
/**
|
299
299
|
* Write to an odb stream
|
@@ -366,7 +366,7 @@ GIT_EXTERN(void) git_odb_stream_free(git_odb_stream *stream);
|
|
366
366
|
GIT_EXTERN(int) git_odb_open_rstream(
|
367
367
|
git_odb_stream **out,
|
368
368
|
size_t *len,
|
369
|
-
|
369
|
+
git_object_t *type,
|
370
370
|
git_odb *db,
|
371
371
|
const git_oid *oid);
|
372
372
|
|
@@ -406,7 +406,7 @@ GIT_EXTERN(int) git_odb_write_pack(
|
|
406
406
|
* @param type of the data to hash
|
407
407
|
* @return 0 or an error code
|
408
408
|
*/
|
409
|
-
GIT_EXTERN(int) git_odb_hash(git_oid *out, const void *data, size_t len,
|
409
|
+
GIT_EXTERN(int) git_odb_hash(git_oid *out, const void *data, size_t len, git_object_t type);
|
410
410
|
|
411
411
|
/**
|
412
412
|
* Read a file from disk and fill a git_oid with the object id
|
@@ -421,7 +421,7 @@ GIT_EXTERN(int) git_odb_hash(git_oid *out, const void *data, size_t len, git_oty
|
|
421
421
|
* @param type the type of the object that will be hashed
|
422
422
|
* @return 0 or an error code
|
423
423
|
*/
|
424
|
-
GIT_EXTERN(int) git_odb_hashfile(git_oid *out, const char *path,
|
424
|
+
GIT_EXTERN(int) git_odb_hashfile(git_oid *out, const char *path, git_object_t type);
|
425
425
|
|
426
426
|
/**
|
427
427
|
* Create a copy of an odb_object
|
@@ -487,7 +487,7 @@ GIT_EXTERN(size_t) git_odb_object_size(git_odb_object *object);
|
|
487
487
|
* @param object the object
|
488
488
|
* @return the type
|
489
489
|
*/
|
490
|
-
GIT_EXTERN(
|
490
|
+
GIT_EXTERN(git_object_t) git_odb_object_type(git_odb_object *object);
|
491
491
|
|
492
492
|
/**
|
493
493
|
* Add a custom backend to an existing Object DB
|
@@ -92,12 +92,12 @@ struct git_odb_stream {
|
|
92
92
|
/**
|
93
93
|
* Write at most `len` bytes into `buffer` and advance the stream.
|
94
94
|
*/
|
95
|
-
int (
|
95
|
+
int GIT_CALLBACK(read)(git_odb_stream *stream, char *buffer, size_t len);
|
96
96
|
|
97
97
|
/**
|
98
98
|
* Write `len` bytes from `buffer` into the stream.
|
99
99
|
*/
|
100
|
-
int (
|
100
|
+
int GIT_CALLBACK(write)(git_odb_stream *stream, const char *buffer, size_t len);
|
101
101
|
|
102
102
|
/**
|
103
103
|
* Store the contents of the stream as an object with the id
|
@@ -109,7 +109,7 @@ struct git_odb_stream {
|
|
109
109
|
* - the final number of received bytes differs from the size declared
|
110
110
|
* with `git_odb_open_wstream()`
|
111
111
|
*/
|
112
|
-
int (
|
112
|
+
int GIT_CALLBACK(finalize_write)(git_odb_stream *stream, const git_oid *oid);
|
113
113
|
|
114
114
|
/**
|
115
115
|
* Free the stream's memory.
|
@@ -117,16 +117,16 @@ struct git_odb_stream {
|
|
117
117
|
* This method might be called without a call to `finalize_write` if
|
118
118
|
* an error occurs or if the object is already present in the ODB.
|
119
119
|
*/
|
120
|
-
void (
|
120
|
+
void GIT_CALLBACK(free)(git_odb_stream *stream);
|
121
121
|
};
|
122
122
|
|
123
123
|
/** A stream to write a pack file to the ODB */
|
124
124
|
struct git_odb_writepack {
|
125
125
|
git_odb_backend *backend;
|
126
126
|
|
127
|
-
int (
|
128
|
-
int (
|
129
|
-
void (
|
127
|
+
int GIT_CALLBACK(append)(git_odb_writepack *writepack, const void *data, size_t size, git_transfer_progress *stats);
|
128
|
+
int GIT_CALLBACK(commit)(git_odb_writepack *writepack, git_transfer_progress *stats);
|
129
|
+
void GIT_CALLBACK(free)(git_odb_writepack *writepack);
|
130
130
|
};
|
131
131
|
|
132
132
|
GIT_END_DECL
|
@@ -246,7 +246,7 @@ GIT_EXTERN(git_oid_shorten *) git_oid_shorten_new(size_t min_length);
|
|
246
246
|
* memory-efficient.
|
247
247
|
*
|
248
248
|
* Attempting to add more than those OIDs will result in a
|
249
|
-
*
|
249
|
+
* GIT_ERROR_INVALID error
|
250
250
|
*
|
251
251
|
* @param os a `git_oid_shorten` instance
|
252
252
|
* @param text_id an OID in text form
|
@@ -178,7 +178,7 @@ GIT_EXTERN(int) git_packbuilder_write(
|
|
178
178
|
*/
|
179
179
|
GIT_EXTERN(const git_oid *) git_packbuilder_hash(git_packbuilder *pb);
|
180
180
|
|
181
|
-
typedef int (
|
181
|
+
typedef int GIT_CALLBACK(git_packbuilder_foreach_cb)(void *buf, size_t size, void *payload);
|
182
182
|
|
183
183
|
/**
|
184
184
|
* Create the new pack and pass each object to the callback
|
@@ -207,7 +207,7 @@ GIT_EXTERN(size_t) git_packbuilder_object_count(git_packbuilder *pb);
|
|
207
207
|
GIT_EXTERN(size_t) git_packbuilder_written(git_packbuilder *pb);
|
208
208
|
|
209
209
|
/** Packbuilder progress notification function */
|
210
|
-
typedef int (
|
210
|
+
typedef int GIT_CALLBACK(git_packbuilder_progress)(
|
211
211
|
int stage,
|
212
212
|
uint32_t current,
|
213
213
|
uint32_t total,
|
@@ -64,8 +64,8 @@ typedef struct {
|
|
64
64
|
/**
|
65
65
|
* If cert verification fails, this will be called to let the
|
66
66
|
* user make the final decision of whether to allow the
|
67
|
-
* connection to proceed. Returns
|
68
|
-
*
|
67
|
+
* connection to proceed. Returns 0 to allow the connection
|
68
|
+
* or a negative value to indicate an error.
|
69
69
|
*/
|
70
70
|
git_transport_certificate_check_cb certificate_check;
|
71
71
|
|
@@ -80,10 +80,14 @@ typedef struct {
|
|
80
80
|
#define GIT_PROXY_OPTIONS_INIT {GIT_PROXY_OPTIONS_VERSION}
|
81
81
|
|
82
82
|
/**
|
83
|
-
* Initialize
|
83
|
+
* Initialize git_proxy_options structure
|
84
84
|
*
|
85
|
-
*
|
86
|
-
*
|
85
|
+
* Initializes a `git_proxy_options` with default values. Equivalent to
|
86
|
+
* creating an instance with `GIT_PROXY_OPTIONS_INIT`.
|
87
|
+
*
|
88
|
+
* @param opts The `git_proxy_options` struct to initialize.
|
89
|
+
* @param version The struct version; pass `GIT_PROXY_OPTIONS_VERSION`.
|
90
|
+
* @return Zero on success; -1 on failure.
|
87
91
|
*/
|
88
92
|
GIT_EXTERN(int) git_proxy_init_options(git_proxy_options *opts, unsigned int version);
|
89
93
|
|
@@ -11,6 +11,8 @@
|
|
11
11
|
#include "types.h"
|
12
12
|
#include "oid.h"
|
13
13
|
#include "annotated_commit.h"
|
14
|
+
#include "merge.h"
|
15
|
+
#include "checkout.h"
|
14
16
|
|
15
17
|
/**
|
16
18
|
* @file git2/rebase.h
|
@@ -145,12 +147,13 @@ typedef struct {
|
|
145
147
|
} git_rebase_operation;
|
146
148
|
|
147
149
|
/**
|
150
|
+
* Initialize git_rebase_options structure
|
151
|
+
*
|
148
152
|
* Initializes a `git_rebase_options` with default values. Equivalent to
|
149
|
-
* creating an instance with GIT_REBASE_OPTIONS_INIT
|
153
|
+
* creating an instance with `GIT_REBASE_OPTIONS_INIT`.
|
150
154
|
*
|
151
|
-
* @param opts
|
152
|
-
* @param version
|
153
|
-
* `GIT_REBASE_OPTIONS_VERSION` here.
|
155
|
+
* @param opts The `git_rebase_options` struct to initialize.
|
156
|
+
* @param version The struct version; pass `GIT_REBASE_OPTIONS_VERSION`.
|
154
157
|
* @return Zero on success; -1 on failure.
|
155
158
|
*/
|
156
159
|
GIT_EXTERN(int) git_rebase_init_options(
|
@@ -263,12 +263,12 @@ GIT_EXTERN(const char *) git_reference_symbolic_target(const git_reference *ref)
|
|
263
263
|
/**
|
264
264
|
* Get the type of a reference.
|
265
265
|
*
|
266
|
-
* Either direct (
|
266
|
+
* Either direct (GIT_REFERENCE_DIRECT) or symbolic (GIT_REFERENCE_SYMBOLIC)
|
267
267
|
*
|
268
268
|
* @param ref The reference
|
269
269
|
* @return the type
|
270
270
|
*/
|
271
|
-
GIT_EXTERN(
|
271
|
+
GIT_EXTERN(git_reference_t) git_reference_type(const git_reference *ref);
|
272
272
|
|
273
273
|
/**
|
274
274
|
* Get the full name of a reference.
|
@@ -422,8 +422,8 @@ GIT_EXTERN(int) git_reference_remove(git_repository *repo, const char *name);
|
|
422
422
|
*/
|
423
423
|
GIT_EXTERN(int) git_reference_list(git_strarray *array, git_repository *repo);
|
424
424
|
|
425
|
-
typedef int (
|
426
|
-
typedef int (
|
425
|
+
typedef int GIT_CALLBACK(git_reference_foreach_cb)(git_reference *reference, void *payload);
|
426
|
+
typedef int GIT_CALLBACK(git_reference_foreach_name_cb)(const char *name, void *payload);
|
427
427
|
|
428
428
|
/**
|
429
429
|
* Perform a callback on each reference in the repository.
|
@@ -640,7 +640,7 @@ typedef enum {
|
|
640
640
|
/**
|
641
641
|
* No particular normalization.
|
642
642
|
*/
|
643
|
-
|
643
|
+
GIT_REFERENCE_FORMAT_NORMAL = 0u,
|
644
644
|
|
645
645
|
/**
|
646
646
|
* Control whether one-level refnames are accepted
|
@@ -648,7 +648,7 @@ typedef enum {
|
|
648
648
|
* components). Those are expected to be written only using
|
649
649
|
* uppercase letters and underscore (FETCH_HEAD, ...)
|
650
650
|
*/
|
651
|
-
|
651
|
+
GIT_REFERENCE_FORMAT_ALLOW_ONELEVEL = (1u << 0),
|
652
652
|
|
653
653
|
/**
|
654
654
|
* Interpret the provided name as a reference pattern for a
|
@@ -657,15 +657,15 @@ typedef enum {
|
|
657
657
|
* in place of a one full pathname component
|
658
658
|
* (e.g., foo/<star>/bar but not foo/bar<star>).
|
659
659
|
*/
|
660
|
-
|
660
|
+
GIT_REFERENCE_FORMAT_REFSPEC_PATTERN = (1u << 1),
|
661
661
|
|
662
662
|
/**
|
663
663
|
* Interpret the name as part of a refspec in shorthand form
|
664
664
|
* so the `ONELEVEL` naming rules aren't enforced and 'master'
|
665
665
|
* becomes a valid name.
|
666
666
|
*/
|
667
|
-
|
668
|
-
}
|
667
|
+
GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND = (1u << 2),
|
668
|
+
} git_reference_format_t;
|
669
669
|
|
670
670
|
/**
|
671
671
|
* Normalize reference name and check validity.
|
@@ -683,7 +683,7 @@ typedef enum {
|
|
683
683
|
* @param buffer_size Size of buffer_out
|
684
684
|
* @param name Reference name to be checked.
|
685
685
|
* @param flags Flags to constrain name validation rules - see the
|
686
|
-
*
|
686
|
+
* GIT_REFERENCE_FORMAT constants above.
|
687
687
|
* @return 0 on success, GIT_EBUFS if buffer is too small, GIT_EINVALIDSPEC
|
688
688
|
* or an error code.
|
689
689
|
*/
|
@@ -699,19 +699,19 @@ GIT_EXTERN(int) git_reference_normalize_name(
|
|
699
699
|
* The retrieved `peeled` object is owned by the repository
|
700
700
|
* and should be closed with the `git_object_free` method.
|
701
701
|
*
|
702
|
-
* If you pass `
|
702
|
+
* If you pass `GIT_OBJECT_ANY` as the target type, then the object
|
703
703
|
* will be peeled until a non-tag object is met.
|
704
704
|
*
|
705
705
|
* @param out Pointer to the peeled git_object
|
706
706
|
* @param ref The reference to be processed
|
707
|
-
* @param type The type of the requested object (
|
708
|
-
*
|
707
|
+
* @param type The type of the requested object (GIT_OBJECT_COMMIT,
|
708
|
+
* GIT_OBJECT_TAG, GIT_OBJECT_TREE, GIT_OBJECT_BLOB or GIT_OBJECT_ANY).
|
709
709
|
* @return 0 on success, GIT_EAMBIGUOUS, GIT_ENOTFOUND or an error code
|
710
710
|
*/
|
711
711
|
GIT_EXTERN(int) git_reference_peel(
|
712
712
|
git_object **out,
|
713
713
|
const git_reference *ref,
|
714
|
-
|
714
|
+
git_object_t type);
|
715
715
|
|
716
716
|
/**
|
717
717
|
* Ensure the reference name is well-formed.
|
@@ -743,7 +743,6 @@ GIT_EXTERN(int) git_reference_is_valid_name(const char *refname);
|
|
743
743
|
*/
|
744
744
|
GIT_EXTERN(const char *) git_reference_shorthand(const git_reference *ref);
|
745
745
|
|
746
|
-
|
747
746
|
/** @} */
|
748
747
|
GIT_END_DECL
|
749
748
|
#endif
|