rugged 1.1.1 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -0
- data/README.md +1 -1
- data/ext/rugged/extconf.rb +2 -2
- data/ext/rugged/rugged.c +7 -4
- data/ext/rugged/rugged_config.c +7 -2
- data/ext/rugged/rugged_object.c +1 -1
- data/ext/rugged/rugged_remote.c +17 -0
- data/ext/rugged/rugged_repo.c +3 -3
- data/lib/rugged/repository.rb +2 -2
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/CMakeLists.txt +103 -271
- data/vendor/libgit2/COPYING +149 -24
- data/vendor/libgit2/cmake/AddCFlagIfSupported.cmake +21 -21
- data/vendor/libgit2/cmake/DefaultCFlags.cmake +154 -0
- data/vendor/libgit2/cmake/EnableWarnings.cmake +13 -13
- data/vendor/libgit2/cmake/FindCoreFoundation.cmake +13 -13
- data/vendor/libgit2/cmake/FindGSSAPI.cmake +171 -287
- data/vendor/libgit2/cmake/FindGSSFramework.cmake +13 -13
- data/vendor/libgit2/cmake/{FindHTTP_Parser.cmake → FindHTTPParser.cmake} +17 -17
- data/vendor/libgit2/cmake/FindIconv.cmake +27 -27
- data/vendor/libgit2/cmake/FindLibSSH2.cmake +13 -0
- data/vendor/libgit2/cmake/FindPCRE.cmake +13 -13
- data/vendor/libgit2/cmake/FindPCRE2.cmake +12 -12
- data/vendor/libgit2/cmake/FindPkgLibraries.cmake +19 -19
- data/vendor/libgit2/cmake/FindSecurity.cmake +14 -14
- data/vendor/libgit2/cmake/FindStatNsec.cmake +12 -18
- data/vendor/libgit2/cmake/Findfutimens.cmake +14 -0
- data/vendor/libgit2/cmake/FindmbedTLS.cmake +63 -70
- data/vendor/libgit2/cmake/IdeSplitSources.cmake +18 -18
- data/vendor/libgit2/cmake/PkgBuildConfig.cmake +60 -60
- data/vendor/libgit2/cmake/SanitizeBool.cmake +20 -20
- data/vendor/libgit2/cmake/SelectGSSAPI.cmake +37 -37
- data/vendor/libgit2/cmake/SelectHTTPParser.cmake +19 -0
- data/vendor/libgit2/cmake/SelectHTTPSBackend.cmake +100 -96
- data/vendor/libgit2/cmake/SelectHashes.cmake +39 -48
- data/vendor/libgit2/cmake/SelectRegex.cmake +51 -0
- data/vendor/libgit2/cmake/SelectSSH.cmake +41 -0
- data/vendor/libgit2/cmake/SelectWinHTTP.cmake +17 -0
- data/vendor/libgit2/cmake/SelectZlib.cmake +34 -0
- data/vendor/libgit2/deps/chromium-zlib/CMakeLists.txt +101 -0
- data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +32 -20
- data/vendor/libgit2/deps/ntlmclient/crypt.h +14 -9
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +20 -20
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +3 -3
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +37 -36
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +4 -3
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +178 -51
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +74 -5
- data/vendor/libgit2/deps/ntlmclient/ntlm.c +154 -122
- data/vendor/libgit2/deps/ntlmclient/ntlm.h +17 -13
- data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +17 -4
- data/vendor/libgit2/deps/ntlmclient/unicode.h +10 -4
- data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +16 -27
- data/vendor/libgit2/deps/ntlmclient/unicode_builtin.h +20 -0
- data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +28 -52
- data/vendor/libgit2/deps/ntlmclient/unicode_iconv.h +22 -0
- data/vendor/libgit2/deps/pcre/CMakeLists.txt +88 -88
- data/vendor/libgit2/deps/winhttp/CMakeLists.txt +14 -16
- data/vendor/libgit2/include/git2/apply.h +16 -2
- data/vendor/libgit2/include/git2/attr.h +106 -2
- data/vendor/libgit2/include/git2/blame.h +97 -43
- data/vendor/libgit2/include/git2/blob.h +33 -2
- data/vendor/libgit2/include/git2/branch.h +27 -0
- data/vendor/libgit2/include/git2/buffer.h +18 -78
- data/vendor/libgit2/include/git2/cert.h +43 -6
- data/vendor/libgit2/include/git2/checkout.h +32 -13
- data/vendor/libgit2/include/git2/clone.h +4 -4
- data/vendor/libgit2/include/git2/commit.h +37 -19
- data/vendor/libgit2/include/git2/common.h +46 -5
- data/vendor/libgit2/include/git2/config.h +19 -3
- data/vendor/libgit2/include/git2/credential.h +2 -1
- data/vendor/libgit2/include/git2/credential_helpers.h +1 -0
- data/vendor/libgit2/include/git2/deprecated.h +326 -6
- data/vendor/libgit2/include/git2/describe.h +7 -2
- data/vendor/libgit2/include/git2/diff.h +50 -121
- data/vendor/libgit2/include/git2/email.h +127 -0
- data/vendor/libgit2/include/git2/errors.h +7 -6
- data/vendor/libgit2/include/git2/filter.h +69 -18
- data/vendor/libgit2/include/git2/graph.h +21 -2
- data/vendor/libgit2/include/git2/ignore.h +1 -1
- data/vendor/libgit2/include/git2/index.h +13 -7
- data/vendor/libgit2/include/git2/indexer.h +19 -0
- data/vendor/libgit2/include/git2/merge.h +23 -3
- data/vendor/libgit2/include/git2/message.h +2 -0
- data/vendor/libgit2/include/git2/notes.h +2 -2
- data/vendor/libgit2/include/git2/object.h +23 -0
- data/vendor/libgit2/include/git2/odb.h +65 -6
- data/vendor/libgit2/include/git2/odb_backend.h +1 -1
- data/vendor/libgit2/include/git2/oidarray.h +5 -8
- data/vendor/libgit2/include/git2/pack.h +24 -8
- data/vendor/libgit2/include/git2/patch.h +16 -0
- data/vendor/libgit2/include/git2/pathspec.h +1 -1
- data/vendor/libgit2/include/git2/proxy.h +1 -1
- data/vendor/libgit2/include/git2/rebase.h +34 -2
- data/vendor/libgit2/include/git2/refdb.h +3 -0
- data/vendor/libgit2/include/git2/reflog.h +1 -1
- data/vendor/libgit2/include/git2/refs.h +8 -4
- data/vendor/libgit2/include/git2/remote.h +246 -46
- data/vendor/libgit2/include/git2/repository.h +25 -18
- data/vendor/libgit2/include/git2/reset.h +2 -2
- data/vendor/libgit2/include/git2/revparse.h +5 -5
- data/vendor/libgit2/include/git2/revwalk.h +4 -1
- data/vendor/libgit2/include/git2/signature.h +1 -1
- data/vendor/libgit2/include/git2/stash.h +4 -4
- data/vendor/libgit2/include/git2/status.h +124 -62
- data/vendor/libgit2/include/git2/stdint.h +3 -3
- data/vendor/libgit2/include/git2/submodule.h +16 -2
- data/vendor/libgit2/include/git2/sys/commit_graph.h +174 -0
- data/vendor/libgit2/include/git2/sys/email.h +45 -0
- data/vendor/libgit2/include/git2/sys/filter.h +49 -28
- data/vendor/libgit2/include/git2/sys/midx.h +74 -0
- data/vendor/libgit2/include/git2/sys/odb_backend.h +9 -5
- data/vendor/libgit2/include/git2/sys/remote.h +31 -0
- data/vendor/libgit2/include/git2/sys/stream.h +1 -1
- data/vendor/libgit2/include/git2/sys/transport.h +26 -34
- data/vendor/libgit2/include/git2/tag.h +13 -0
- data/vendor/libgit2/include/git2/tree.h +4 -17
- data/vendor/libgit2/include/git2/types.h +16 -7
- data/vendor/libgit2/include/git2/version.h +4 -4
- data/vendor/libgit2/include/git2/worktree.h +13 -2
- data/vendor/libgit2/include/git2.h +1 -0
- data/vendor/libgit2/src/CMakeLists.txt +192 -290
- data/vendor/libgit2/src/alloc.c +21 -8
- data/vendor/libgit2/src/allocators/failalloc.c +92 -0
- data/vendor/libgit2/src/allocators/failalloc.h +23 -0
- data/vendor/libgit2/src/allocators/stdalloc.c +41 -10
- data/vendor/libgit2/src/allocators/win32_leakcheck.c +118 -0
- data/vendor/libgit2/src/allocators/{win32_crtdbg.h → win32_leakcheck.h} +3 -3
- data/vendor/libgit2/src/annotated_commit.c +21 -9
- data/vendor/libgit2/src/annotated_commit.h +1 -1
- data/vendor/libgit2/src/apply.c +34 -25
- data/vendor/libgit2/src/apply.h +2 -2
- data/vendor/libgit2/src/array.h +11 -11
- data/vendor/libgit2/src/attr.c +204 -82
- data/vendor/libgit2/src/attr_file.c +105 -52
- data/vendor/libgit2/src/attr_file.h +36 -15
- data/vendor/libgit2/src/attrcache.c +55 -45
- data/vendor/libgit2/src/attrcache.h +4 -5
- data/vendor/libgit2/src/blame.c +15 -9
- data/vendor/libgit2/src/blame_git.c +2 -2
- data/vendor/libgit2/src/blob.c +76 -52
- data/vendor/libgit2/src/blob.h +1 -1
- data/vendor/libgit2/src/branch.c +203 -110
- data/vendor/libgit2/src/branch.h +15 -3
- data/vendor/libgit2/src/buf.c +126 -0
- data/vendor/libgit2/src/buf.h +50 -0
- data/vendor/libgit2/src/cache.c +2 -2
- data/vendor/libgit2/src/cache.h +7 -7
- data/vendor/libgit2/src/cc-compat.h +11 -9
- data/vendor/libgit2/src/checkout.c +118 -91
- data/vendor/libgit2/src/cherrypick.c +16 -12
- data/vendor/libgit2/src/clone.c +97 -103
- data/vendor/libgit2/src/commit.c +167 -84
- data/vendor/libgit2/src/commit.h +24 -1
- data/vendor/libgit2/src/commit_graph.c +1224 -0
- data/vendor/libgit2/src/commit_graph.h +169 -0
- data/vendor/libgit2/src/commit_list.c +48 -3
- data/vendor/libgit2/src/commit_list.h +2 -0
- data/vendor/libgit2/src/common.h +35 -5
- data/vendor/libgit2/src/config.c +119 -64
- data/vendor/libgit2/src/config.h +15 -2
- data/vendor/libgit2/src/config_cache.c +5 -3
- data/vendor/libgit2/src/config_file.c +120 -100
- data/vendor/libgit2/src/config_mem.c +9 -9
- data/vendor/libgit2/src/config_parse.c +29 -27
- data/vendor/libgit2/src/crlf.c +36 -23
- data/vendor/libgit2/src/date.c +13 -19
- data/vendor/libgit2/src/date.h +33 -0
- data/vendor/libgit2/src/delta.c +1 -1
- data/vendor/libgit2/src/describe.c +32 -21
- data/vendor/libgit2/src/diff.c +71 -183
- data/vendor/libgit2/src/diff.h +2 -4
- data/vendor/libgit2/src/diff_driver.c +53 -51
- data/vendor/libgit2/src/diff_driver.h +3 -3
- data/vendor/libgit2/src/diff_file.c +31 -26
- data/vendor/libgit2/src/diff_generate.c +76 -23
- data/vendor/libgit2/src/diff_generate.h +5 -3
- data/vendor/libgit2/src/diff_print.c +120 -95
- data/vendor/libgit2/src/diff_stats.c +47 -34
- data/vendor/libgit2/src/{message.h → diff_stats.h} +7 -6
- data/vendor/libgit2/src/diff_tform.c +18 -16
- data/vendor/libgit2/src/diff_xdiff.c +7 -10
- data/vendor/libgit2/src/diff_xdiff.h +1 -1
- data/vendor/libgit2/src/email.c +315 -0
- data/vendor/libgit2/src/email.h +25 -0
- data/vendor/libgit2/src/errors.c +37 -32
- data/vendor/libgit2/src/features.h.in +11 -2
- data/vendor/libgit2/src/fetch.c +77 -26
- data/vendor/libgit2/src/fetch.h +1 -1
- data/vendor/libgit2/src/fetchhead.c +27 -23
- data/vendor/libgit2/src/filebuf.c +36 -34
- data/vendor/libgit2/src/filebuf.h +1 -1
- data/vendor/libgit2/src/filter.c +278 -132
- data/vendor/libgit2/src/filter.h +46 -6
- data/vendor/libgit2/src/fs_path.c +2071 -0
- data/vendor/libgit2/src/fs_path.h +772 -0
- data/vendor/libgit2/src/futils.c +96 -90
- data/vendor/libgit2/src/futils.h +27 -15
- data/vendor/libgit2/src/graph.c +64 -9
- data/vendor/libgit2/src/hash/sha1/collisiondetect.c +5 -5
- data/vendor/libgit2/src/hash/sha1/common_crypto.c +5 -5
- data/vendor/libgit2/src/hash/sha1/generic.c +2 -2
- data/vendor/libgit2/src/hash/sha1/generic.h +1 -1
- data/vendor/libgit2/src/hash/sha1/mbedtls.c +13 -13
- data/vendor/libgit2/src/hash/sha1/openssl.c +5 -5
- data/vendor/libgit2/src/hash/sha1/sha1dc/sha1.c +9 -11
- data/vendor/libgit2/src/hash/sha1/win32.c +21 -17
- data/vendor/libgit2/src/hash/sha1.h +3 -1
- data/vendor/libgit2/src/hash.c +71 -36
- data/vendor/libgit2/src/hash.h +13 -13
- data/vendor/libgit2/src/hashsig.c +23 -10
- data/vendor/libgit2/src/ident.c +30 -20
- data/vendor/libgit2/src/ignore.c +63 -46
- data/vendor/libgit2/src/ignore.h +2 -2
- data/vendor/libgit2/src/index.c +184 -149
- data/vendor/libgit2/src/index.h +7 -4
- data/vendor/libgit2/src/indexer.c +143 -89
- data/vendor/libgit2/src/integer.h +64 -2
- data/vendor/libgit2/src/iterator.c +93 -73
- data/vendor/libgit2/src/iterator.h +6 -6
- data/vendor/libgit2/src/khash.h +3 -12
- data/vendor/libgit2/src/{settings.c → libgit2.c} +165 -56
- data/vendor/libgit2/src/libgit2.h +15 -0
- data/vendor/libgit2/src/mailmap.c +60 -45
- data/vendor/libgit2/src/map.h +3 -3
- data/vendor/libgit2/src/merge.c +104 -61
- data/vendor/libgit2/src/merge.h +3 -15
- data/vendor/libgit2/src/merge_driver.c +21 -15
- data/vendor/libgit2/src/merge_file.c +24 -6
- data/vendor/libgit2/src/message.c +21 -8
- data/vendor/libgit2/src/midx.c +501 -18
- data/vendor/libgit2/src/midx.h +29 -2
- data/vendor/libgit2/src/mwindow.c +103 -59
- data/vendor/libgit2/src/mwindow.h +3 -3
- data/vendor/libgit2/src/net.c +405 -71
- data/vendor/libgit2/src/net.h +26 -5
- data/vendor/libgit2/src/netops.c +7 -5
- data/vendor/libgit2/src/netops.h +3 -3
- data/vendor/libgit2/src/notes.c +40 -49
- data/vendor/libgit2/src/object.c +68 -20
- data/vendor/libgit2/src/object.h +1 -1
- data/vendor/libgit2/src/odb.c +320 -80
- data/vendor/libgit2/src/odb.h +17 -3
- data/vendor/libgit2/src/odb_loose.c +96 -86
- data/vendor/libgit2/src/odb_mempack.c +19 -6
- data/vendor/libgit2/src/odb_pack.c +402 -125
- data/vendor/libgit2/src/oid.c +16 -8
- data/vendor/libgit2/src/oid.h +15 -0
- data/vendor/libgit2/src/oidarray.c +10 -1
- data/vendor/libgit2/src/pack-objects.c +90 -69
- data/vendor/libgit2/src/pack-objects.h +11 -6
- data/vendor/libgit2/src/pack.c +337 -127
- data/vendor/libgit2/src/pack.h +25 -7
- data/vendor/libgit2/src/patch.c +17 -10
- data/vendor/libgit2/src/patch.h +1 -0
- data/vendor/libgit2/src/patch_generate.c +29 -13
- data/vendor/libgit2/src/patch_generate.h +5 -5
- data/vendor/libgit2/src/patch_parse.c +26 -25
- data/vendor/libgit2/src/path.c +86 -1768
- data/vendor/libgit2/src/path.h +39 -635
- data/vendor/libgit2/src/pathspec.c +12 -12
- data/vendor/libgit2/src/pathspec.h +2 -2
- data/vendor/libgit2/src/pool.c +13 -7
- data/vendor/libgit2/src/posix.c +14 -6
- data/vendor/libgit2/src/posix.h +1 -0
- data/vendor/libgit2/src/pqueue.h +1 -1
- data/vendor/libgit2/src/proxy.c +4 -1
- data/vendor/libgit2/src/proxy.h +1 -1
- data/vendor/libgit2/src/push.c +30 -35
- data/vendor/libgit2/src/push.h +4 -16
- data/vendor/libgit2/src/rand.c +226 -0
- data/vendor/libgit2/src/rand.h +37 -0
- data/vendor/libgit2/src/reader.c +18 -14
- data/vendor/libgit2/src/reader.h +2 -2
- data/vendor/libgit2/src/rebase.c +177 -132
- data/vendor/libgit2/src/refdb.c +30 -13
- data/vendor/libgit2/src/refdb_fs.c +548 -222
- data/vendor/libgit2/src/reflog.c +19 -14
- data/vendor/libgit2/src/refs.c +107 -72
- data/vendor/libgit2/src/refs.h +2 -2
- data/vendor/libgit2/src/refspec.c +53 -38
- data/vendor/libgit2/src/refspec.h +5 -2
- data/vendor/libgit2/src/regexp.c +1 -1
- data/vendor/libgit2/src/remote.c +960 -486
- data/vendor/libgit2/src/remote.h +16 -10
- data/vendor/libgit2/src/repository.c +702 -422
- data/vendor/libgit2/src/repository.h +26 -8
- data/vendor/libgit2/src/reset.c +16 -12
- data/vendor/libgit2/src/revert.c +16 -12
- data/vendor/libgit2/src/revparse.c +66 -48
- data/vendor/libgit2/src/revwalk.c +39 -22
- data/vendor/libgit2/src/runtime.c +162 -0
- data/vendor/libgit2/src/runtime.h +62 -0
- data/vendor/libgit2/src/settings.h +11 -0
- data/vendor/libgit2/src/signature.c +18 -11
- data/vendor/libgit2/src/signature.h +1 -1
- data/vendor/libgit2/src/sortedcache.c +1 -1
- data/vendor/libgit2/src/sortedcache.h +10 -8
- data/vendor/libgit2/src/stash.c +39 -38
- data/vendor/libgit2/src/status.c +11 -5
- data/vendor/libgit2/src/{buffer.c → str.c} +459 -136
- data/vendor/libgit2/src/str.h +357 -0
- data/vendor/libgit2/src/strarray.c +2 -1
- data/vendor/libgit2/src/streams/mbedtls.c +22 -23
- data/vendor/libgit2/src/streams/mbedtls.h +1 -1
- data/vendor/libgit2/src/streams/openssl.c +101 -201
- data/vendor/libgit2/src/streams/openssl.h +9 -1
- data/vendor/libgit2/src/streams/openssl_dynamic.c +309 -0
- data/vendor/libgit2/src/streams/openssl_dynamic.h +348 -0
- data/vendor/libgit2/src/streams/openssl_legacy.c +203 -0
- data/vendor/libgit2/src/streams/openssl_legacy.h +63 -0
- data/vendor/libgit2/src/streams/registry.c +5 -6
- data/vendor/libgit2/src/streams/socket.c +6 -2
- data/vendor/libgit2/src/streams/stransport.c +6 -3
- data/vendor/libgit2/src/streams/tls.c +5 -3
- data/vendor/libgit2/src/submodule.c +290 -212
- data/vendor/libgit2/src/submodule.h +10 -10
- data/vendor/libgit2/src/sysdir.c +70 -56
- data/vendor/libgit2/src/sysdir.h +15 -10
- data/vendor/libgit2/src/tag.c +72 -34
- data/vendor/libgit2/src/thread.c +140 -0
- data/vendor/libgit2/src/thread.h +479 -0
- data/vendor/libgit2/src/threadstate.c +84 -0
- data/vendor/libgit2/src/threadstate.h +24 -0
- data/vendor/libgit2/src/trace.c +3 -16
- data/vendor/libgit2/src/trace.h +17 -30
- data/vendor/libgit2/src/trailer.c +2 -2
- data/vendor/libgit2/src/transaction.c +20 -9
- data/vendor/libgit2/src/transport.c +13 -13
- data/vendor/libgit2/src/transports/auth.c +8 -10
- data/vendor/libgit2/src/transports/auth.h +2 -3
- data/vendor/libgit2/src/transports/auth_negotiate.c +23 -17
- data/vendor/libgit2/src/transports/auth_ntlm.c +20 -16
- data/vendor/libgit2/src/transports/auth_ntlm.h +0 -1
- data/vendor/libgit2/src/transports/credential.c +15 -7
- data/vendor/libgit2/src/transports/git.c +10 -14
- data/vendor/libgit2/src/transports/http.c +56 -34
- data/vendor/libgit2/src/transports/http.h +3 -3
- data/vendor/libgit2/src/transports/httpclient.c +106 -79
- data/vendor/libgit2/src/transports/httpclient.h +1 -1
- data/vendor/libgit2/src/transports/local.c +127 -119
- data/vendor/libgit2/src/transports/smart.c +61 -144
- data/vendor/libgit2/src/transports/smart.h +26 -32
- data/vendor/libgit2/src/transports/smart_pkt.c +33 -33
- data/vendor/libgit2/src/transports/smart_protocol.c +68 -44
- data/vendor/libgit2/src/transports/ssh.c +100 -131
- data/vendor/libgit2/src/transports/winhttp.c +86 -82
- data/vendor/libgit2/src/tree-cache.c +5 -5
- data/vendor/libgit2/src/tree-cache.h +2 -2
- data/vendor/libgit2/src/tree.c +150 -116
- data/vendor/libgit2/src/tree.h +1 -0
- data/vendor/libgit2/src/tsort.c +0 -2
- data/vendor/libgit2/src/unix/map.c +3 -3
- data/vendor/libgit2/src/unix/posix.h +1 -4
- data/vendor/libgit2/src/unix/pthread.h +2 -1
- data/vendor/libgit2/src/unix/realpath.c +0 -2
- data/vendor/libgit2/src/utf8.c +150 -0
- data/vendor/libgit2/src/utf8.h +52 -0
- data/vendor/libgit2/src/util.c +68 -144
- data/vendor/libgit2/src/util.h +36 -68
- data/vendor/libgit2/src/vector.c +23 -19
- data/vendor/libgit2/src/vector.h +5 -3
- data/vendor/libgit2/src/win32/findfile.c +172 -114
- data/vendor/libgit2/src/win32/findfile.h +7 -4
- data/vendor/libgit2/src/win32/map.c +1 -1
- data/vendor/libgit2/src/win32/msvc-compat.h +9 -1
- data/vendor/libgit2/src/win32/path_w32.c +162 -33
- data/vendor/libgit2/src/win32/path_w32.h +2 -1
- data/vendor/libgit2/src/win32/posix.h +6 -7
- data/vendor/libgit2/src/win32/posix_w32.c +26 -33
- data/vendor/libgit2/src/win32/precompiled.h +0 -1
- data/vendor/libgit2/src/win32/reparse.h +4 -4
- data/vendor/libgit2/src/win32/thread.c +24 -15
- data/vendor/libgit2/src/win32/thread.h +1 -1
- data/vendor/libgit2/src/win32/w32_buffer.c +5 -6
- data/vendor/libgit2/src/win32/w32_buffer.h +2 -3
- data/vendor/libgit2/src/win32/w32_common.h +18 -9
- data/vendor/libgit2/src/win32/{w32_crtdbg_stacktrace.c → w32_leakcheck.c} +269 -33
- data/vendor/libgit2/src/win32/w32_leakcheck.h +222 -0
- data/vendor/libgit2/src/win32/w32_util.h +6 -6
- data/vendor/libgit2/src/worktree.c +138 -105
- data/vendor/libgit2/src/worktree.h +1 -1
- data/vendor/libgit2/src/xdiff/git-xdiff.h +53 -0
- data/vendor/libgit2/src/xdiff/xdiff.h +15 -15
- data/vendor/libgit2/src/xdiff/xdiffi.c +134 -108
- data/vendor/libgit2/src/xdiff/xemit.c +23 -7
- data/vendor/libgit2/src/xdiff/xhistogram.c +87 -78
- data/vendor/libgit2/src/xdiff/xinclude.h +1 -12
- data/vendor/libgit2/src/xdiff/xmerge.c +104 -117
- data/vendor/libgit2/src/xdiff/xpatience.c +6 -17
- data/vendor/libgit2/src/xdiff/xprepare.c +15 -20
- data/vendor/libgit2/src/xdiff/xutils.c +18 -7
- data/vendor/libgit2/src/zstream.c +6 -6
- data/vendor/libgit2/src/zstream.h +4 -4
- metadata +60 -24
- data/vendor/libgit2/src/allocators/win32_crtdbg.c +0 -118
- data/vendor/libgit2/src/buf_text.c +0 -316
- data/vendor/libgit2/src/buf_text.h +0 -122
- data/vendor/libgit2/src/buffer.h +0 -222
- data/vendor/libgit2/src/global.c +0 -363
- data/vendor/libgit2/src/global.h +0 -41
- data/vendor/libgit2/src/thread-utils.c +0 -58
- data/vendor/libgit2/src/thread-utils.h +0 -369
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +0 -127
- data/vendor/libgit2/src/win32/w32_stack.c +0 -188
- data/vendor/libgit2/src/win32/w32_stack.h +0 -140
@@ -0,0 +1,174 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
|
+
*
|
4
|
+
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
|
+
* a Linking Exception. For full terms see the included COPYING file.
|
6
|
+
*/
|
7
|
+
#ifndef INCLUDE_sys_git_commit_graph_h__
|
8
|
+
#define INCLUDE_sys_git_commit_graph_h__
|
9
|
+
|
10
|
+
#include "git2/common.h"
|
11
|
+
#include "git2/types.h"
|
12
|
+
|
13
|
+
/**
|
14
|
+
* @file git2/sys/commit_graph.h
|
15
|
+
* @brief Git commit-graph
|
16
|
+
* @defgroup git_commit_graph Git commit-graph APIs
|
17
|
+
* @ingroup Git
|
18
|
+
* @{
|
19
|
+
*/
|
20
|
+
GIT_BEGIN_DECL
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Opens a `git_commit_graph` from a path to an objects directory.
|
24
|
+
*
|
25
|
+
* This finds, opens, and validates the `commit-graph` file.
|
26
|
+
*
|
27
|
+
* @param cgraph_out the `git_commit_graph` struct to initialize.
|
28
|
+
* @param objects_dir the path to a git objects directory.
|
29
|
+
* @return Zero on success; -1 on failure.
|
30
|
+
*/
|
31
|
+
GIT_EXTERN(int) git_commit_graph_open(git_commit_graph **cgraph_out, const char *objects_dir);
|
32
|
+
|
33
|
+
/**
|
34
|
+
* Frees commit-graph data. This should only be called when memory allocated
|
35
|
+
* using `git_commit_graph_open` is not returned to libgit2 because it was not
|
36
|
+
* associated with the ODB through a successful call to
|
37
|
+
* `git_odb_set_commit_graph`.
|
38
|
+
*
|
39
|
+
* @param cgraph the commit-graph object to free. If NULL, no action is taken.
|
40
|
+
*/
|
41
|
+
GIT_EXTERN(void) git_commit_graph_free(git_commit_graph *cgraph);
|
42
|
+
|
43
|
+
/**
|
44
|
+
* Create a new writer for `commit-graph` files.
|
45
|
+
*
|
46
|
+
* @param out Location to store the writer pointer.
|
47
|
+
* @param objects_info_dir The `objects/info` directory.
|
48
|
+
* The `commit-graph` file will be written in this directory.
|
49
|
+
* @return 0 or an error code
|
50
|
+
*/
|
51
|
+
GIT_EXTERN(int) git_commit_graph_writer_new(
|
52
|
+
git_commit_graph_writer **out,
|
53
|
+
const char *objects_info_dir);
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Free the commit-graph writer and its resources.
|
57
|
+
*
|
58
|
+
* @param w The writer to free. If NULL no action is taken.
|
59
|
+
*/
|
60
|
+
GIT_EXTERN(void) git_commit_graph_writer_free(git_commit_graph_writer *w);
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Add an `.idx` file (associated to a packfile) to the writer.
|
64
|
+
*
|
65
|
+
* @param w The writer.
|
66
|
+
* @param repo The repository that owns the `.idx` file.
|
67
|
+
* @param idx_path The path of an `.idx` file.
|
68
|
+
* @return 0 or an error code
|
69
|
+
*/
|
70
|
+
GIT_EXTERN(int) git_commit_graph_writer_add_index_file(
|
71
|
+
git_commit_graph_writer *w,
|
72
|
+
git_repository *repo,
|
73
|
+
const char *idx_path);
|
74
|
+
|
75
|
+
/**
|
76
|
+
* Add a revwalk to the writer. This will add all the commits from the revwalk
|
77
|
+
* to the commit-graph.
|
78
|
+
*
|
79
|
+
* @param w The writer.
|
80
|
+
* @param walk The git_revwalk.
|
81
|
+
* @return 0 or an error code
|
82
|
+
*/
|
83
|
+
GIT_EXTERN(int) git_commit_graph_writer_add_revwalk(
|
84
|
+
git_commit_graph_writer *w,
|
85
|
+
git_revwalk *walk);
|
86
|
+
|
87
|
+
|
88
|
+
/**
|
89
|
+
* The strategy to use when adding a new set of commits to a pre-existing
|
90
|
+
* commit-graph chain.
|
91
|
+
*/
|
92
|
+
typedef enum {
|
93
|
+
/**
|
94
|
+
* Do not split commit-graph files. The other split strategy-related option
|
95
|
+
* fields are ignored.
|
96
|
+
*/
|
97
|
+
GIT_COMMIT_GRAPH_SPLIT_STRATEGY_SINGLE_FILE = 0
|
98
|
+
} git_commit_graph_split_strategy_t;
|
99
|
+
|
100
|
+
/**
|
101
|
+
* Options structure for
|
102
|
+
* `git_commit_graph_writer_commit`/`git_commit_graph_writer_dump`.
|
103
|
+
*
|
104
|
+
* Initialize with `GIT_COMMIT_GRAPH_WRITER_OPTIONS_INIT`. Alternatively, you
|
105
|
+
* can use `git_commit_graph_writer_options_init`.
|
106
|
+
*/
|
107
|
+
typedef struct {
|
108
|
+
unsigned int version;
|
109
|
+
|
110
|
+
/**
|
111
|
+
* The strategy to use when adding new commits to a pre-existing commit-graph
|
112
|
+
* chain.
|
113
|
+
*/
|
114
|
+
git_commit_graph_split_strategy_t split_strategy;
|
115
|
+
|
116
|
+
/**
|
117
|
+
* The number of commits in level N is less than X times the number of
|
118
|
+
* commits in level N + 1. Default is 2.
|
119
|
+
*/
|
120
|
+
float size_multiple;
|
121
|
+
|
122
|
+
/**
|
123
|
+
* The number of commits in level N + 1 is more than C commits.
|
124
|
+
* Default is 64000.
|
125
|
+
*/
|
126
|
+
size_t max_commits;
|
127
|
+
} git_commit_graph_writer_options;
|
128
|
+
|
129
|
+
#define GIT_COMMIT_GRAPH_WRITER_OPTIONS_VERSION 1
|
130
|
+
#define GIT_COMMIT_GRAPH_WRITER_OPTIONS_INIT { \
|
131
|
+
GIT_COMMIT_GRAPH_WRITER_OPTIONS_VERSION \
|
132
|
+
}
|
133
|
+
|
134
|
+
/**
|
135
|
+
* Initialize git_commit_graph_writer_options structure
|
136
|
+
*
|
137
|
+
* Initializes a `git_commit_graph_writer_options` with default values. Equivalent to
|
138
|
+
* creating an instance with `GIT_COMMIT_GRAPH_WRITER_OPTIONS_INIT`.
|
139
|
+
*
|
140
|
+
* @param opts The `git_commit_graph_writer_options` struct to initialize.
|
141
|
+
* @param version The struct version; pass `GIT_COMMIT_GRAPH_WRITER_OPTIONS_VERSION`.
|
142
|
+
* @return Zero on success; -1 on failure.
|
143
|
+
*/
|
144
|
+
GIT_EXTERN(int) git_commit_graph_writer_options_init(
|
145
|
+
git_commit_graph_writer_options *opts,
|
146
|
+
unsigned int version);
|
147
|
+
|
148
|
+
/**
|
149
|
+
* Write a `commit-graph` file to a file.
|
150
|
+
*
|
151
|
+
* @param w The writer
|
152
|
+
* @param opts Pointer to git_commit_graph_writer_options struct.
|
153
|
+
* @return 0 or an error code
|
154
|
+
*/
|
155
|
+
GIT_EXTERN(int) git_commit_graph_writer_commit(
|
156
|
+
git_commit_graph_writer *w,
|
157
|
+
git_commit_graph_writer_options *opts);
|
158
|
+
|
159
|
+
/**
|
160
|
+
* Dump the contents of the `commit-graph` to an in-memory buffer.
|
161
|
+
*
|
162
|
+
* @param buffer Buffer where to store the contents of the `commit-graph`.
|
163
|
+
* @param w The writer.
|
164
|
+
* @param opts Pointer to git_commit_graph_writer_options struct.
|
165
|
+
* @return 0 or an error code
|
166
|
+
*/
|
167
|
+
GIT_EXTERN(int) git_commit_graph_writer_dump(
|
168
|
+
git_buf *buffer,
|
169
|
+
git_commit_graph_writer *w,
|
170
|
+
git_commit_graph_writer_options *opts);
|
171
|
+
|
172
|
+
/** @} */
|
173
|
+
GIT_END_DECL
|
174
|
+
#endif
|
@@ -0,0 +1,45 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
|
+
*
|
4
|
+
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
|
+
* a Linking Exception. For full terms see the included COPYING file.
|
6
|
+
*/
|
7
|
+
#ifndef INCLUDE_sys_git_email_h__
|
8
|
+
#define INCLUDE_sys_git_email_h__
|
9
|
+
|
10
|
+
/**
|
11
|
+
* @file git2/sys/email.h
|
12
|
+
* @brief Advanced git email creation routines
|
13
|
+
* @defgroup git_email Advanced git email creation routines
|
14
|
+
* @ingroup Git
|
15
|
+
* @{
|
16
|
+
*/
|
17
|
+
GIT_BEGIN_DECL
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Create a diff for a commit in mbox format for sending via email.
|
21
|
+
*
|
22
|
+
* @param out buffer to store the e-mail patch in
|
23
|
+
* @param diff the changes to include in the email
|
24
|
+
* @param patch_idx the patch index
|
25
|
+
* @param patch_count the total number of patches that will be included
|
26
|
+
* @param commit_id the commit id for this change
|
27
|
+
* @param summary the commit message for this change
|
28
|
+
* @param body optional text to include above the diffstat
|
29
|
+
* @param author the person who authored this commit
|
30
|
+
* @param opts email creation options
|
31
|
+
*/
|
32
|
+
GIT_EXTERN(int) git_email_create_from_diff(
|
33
|
+
git_buf *out,
|
34
|
+
git_diff *diff,
|
35
|
+
size_t patch_idx,
|
36
|
+
size_t patch_count,
|
37
|
+
const git_oid *commit_id,
|
38
|
+
const char *summary,
|
39
|
+
const char *body,
|
40
|
+
const git_signature *author,
|
41
|
+
const git_email_create_options *opts);
|
42
|
+
|
43
|
+
/** @} */
|
44
|
+
GIT_END_DECL
|
45
|
+
#endif
|
@@ -167,17 +167,18 @@ typedef void GIT_CALLBACK(git_filter_shutdown_fn)(git_filter *self);
|
|
167
167
|
*
|
168
168
|
* The `payload` will be a pointer to a reference payload for the filter.
|
169
169
|
* This will start as NULL, but `check` can assign to this pointer for
|
170
|
-
* later use by the `
|
171
|
-
* allocated (not stack), so that it doesn't go away before the `
|
170
|
+
* later use by the `stream` callback. Note that the value should be heap
|
171
|
+
* allocated (not stack), so that it doesn't go away before the `stream`
|
172
172
|
* callback can use it. If a filter allocates and assigns a value to the
|
173
173
|
* `payload`, it will need a `cleanup` callback to free the payload.
|
174
174
|
*/
|
175
175
|
typedef int GIT_CALLBACK(git_filter_check_fn)(
|
176
|
-
git_filter
|
177
|
-
void
|
176
|
+
git_filter *self,
|
177
|
+
void **payload, /* NULL on entry, may be set */
|
178
178
|
const git_filter_source *src,
|
179
|
-
const char
|
179
|
+
const char **attr_values);
|
180
180
|
|
181
|
+
#ifndef GIT_DEPRECATE_HARD
|
181
182
|
/**
|
182
183
|
* Callback to actually perform the data filtering
|
183
184
|
*
|
@@ -189,32 +190,45 @@ typedef int GIT_CALLBACK(git_filter_check_fn)(
|
|
189
190
|
*
|
190
191
|
* The `payload` value will refer to any payload that was set by the
|
191
192
|
* `check` callback. It may be read from or written to as needed.
|
193
|
+
*
|
194
|
+
* @deprecated use git_filter_stream_fn
|
192
195
|
*/
|
193
196
|
typedef int GIT_CALLBACK(git_filter_apply_fn)(
|
194
|
-
git_filter
|
195
|
-
void
|
196
|
-
git_buf
|
197
|
-
const git_buf
|
197
|
+
git_filter *self,
|
198
|
+
void **payload, /* may be read and/or set */
|
199
|
+
git_buf *to,
|
200
|
+
const git_buf *from,
|
198
201
|
const git_filter_source *src);
|
202
|
+
#endif
|
199
203
|
|
204
|
+
/**
|
205
|
+
* Callback to perform the data filtering.
|
206
|
+
*
|
207
|
+
* Specified as `filter.stream`, this is a callback that filters data
|
208
|
+
* in a streaming manner. This function will provide a
|
209
|
+
* `git_writestream` that will the original data will be written to;
|
210
|
+
* with that data, the `git_writestream` will then perform the filter
|
211
|
+
* translation and stream the filtered data out to the `next` location.
|
212
|
+
*/
|
200
213
|
typedef int GIT_CALLBACK(git_filter_stream_fn)(
|
201
|
-
git_writestream
|
202
|
-
git_filter
|
203
|
-
void
|
214
|
+
git_writestream **out,
|
215
|
+
git_filter *self,
|
216
|
+
void **payload,
|
204
217
|
const git_filter_source *src,
|
205
|
-
git_writestream
|
218
|
+
git_writestream *next);
|
206
219
|
|
207
220
|
/**
|
208
221
|
* Callback to clean up after filtering has been applied
|
209
222
|
*
|
210
223
|
* Specified as `filter.cleanup`, this is an optional callback invoked
|
211
|
-
* after the filter has been applied. If the `check
|
212
|
-
* allocated a `payload` to keep per-source filter
|
213
|
-
* callback to free that payload and release resources
|
224
|
+
* after the filter has been applied. If the `check`, `apply`, or
|
225
|
+
* `stream` callbacks allocated a `payload` to keep per-source filter
|
226
|
+
* state, use this callback to free that payload and release resources
|
227
|
+
* as required.
|
214
228
|
*/
|
215
229
|
typedef void GIT_CALLBACK(git_filter_cleanup_fn)(
|
216
|
-
git_filter
|
217
|
-
void
|
230
|
+
git_filter *self,
|
231
|
+
void *payload);
|
218
232
|
|
219
233
|
/**
|
220
234
|
* Filter structure used to register custom filters.
|
@@ -248,21 +262,28 @@ struct git_filter {
|
|
248
262
|
/**
|
249
263
|
* Called to determine whether the filter should be invoked for a
|
250
264
|
* given file. If this function returns `GIT_PASSTHROUGH` then the
|
251
|
-
* `apply`
|
252
|
-
* through unmodified.
|
265
|
+
* `stream` or `apply` functions will not be invoked and the
|
266
|
+
* contents will be passed through unmodified.
|
253
267
|
*/
|
254
268
|
git_filter_check_fn check;
|
255
269
|
|
270
|
+
#ifdef GIT_DEPRECATE_HARD
|
271
|
+
void *reserved;
|
272
|
+
#else
|
256
273
|
/**
|
257
|
-
*
|
258
|
-
*
|
259
|
-
*
|
274
|
+
* Provided for backward compatibility; this will apply the
|
275
|
+
* filter to the given contents in a `git_buf`. Callers should
|
276
|
+
* provide a `stream` function instead.
|
260
277
|
*/
|
261
278
|
git_filter_apply_fn apply;
|
279
|
+
#endif
|
262
280
|
|
263
281
|
/**
|
264
|
-
* Called to apply the filter
|
265
|
-
*
|
282
|
+
* Called to apply the filter, this function will provide a
|
283
|
+
* `git_writestream` that will the original data will be
|
284
|
+
* written to; with that data, the `git_writestream` will then
|
285
|
+
* perform the filter translation and stream the filtered data
|
286
|
+
* out to the `next` location.
|
266
287
|
*/
|
267
288
|
git_filter_stream_fn stream;
|
268
289
|
|
@@ -289,9 +310,9 @@ GIT_EXTERN(int) git_filter_init(git_filter *filter, unsigned int version);
|
|
289
310
|
* As mentioned elsewhere, the initialize callback will not be invoked
|
290
311
|
* immediately. It is deferred until the filter is used in some way.
|
291
312
|
*
|
292
|
-
* A filter's attribute checks and `check` and `
|
293
|
-
* issued in order of `priority` on smudge (to
|
294
|
-
* order of `priority` on clean (to odb).
|
313
|
+
* A filter's attribute checks and `check` and `stream` (or `apply`)
|
314
|
+
* callbacks will be issued in order of `priority` on smudge (to
|
315
|
+
* workdir), and in reverse order of `priority` on clean (to odb).
|
295
316
|
*
|
296
317
|
* Two filters are preregistered with libgit2:
|
297
318
|
* - GIT_FILTER_CRLF with priority 0
|
@@ -0,0 +1,74 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
|
+
*
|
4
|
+
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
|
+
* a Linking Exception. For full terms see the included COPYING file.
|
6
|
+
*/
|
7
|
+
#ifndef INCLUDE_sys_git_midx_h__
|
8
|
+
#define INCLUDE_sys_git_midx_h__
|
9
|
+
|
10
|
+
#include "git2/common.h"
|
11
|
+
#include "git2/types.h"
|
12
|
+
|
13
|
+
/**
|
14
|
+
* @file git2/midx.h
|
15
|
+
* @brief Git multi-pack-index routines
|
16
|
+
* @defgroup git_midx Git multi-pack-index routines
|
17
|
+
* @ingroup Git
|
18
|
+
* @{
|
19
|
+
*/
|
20
|
+
GIT_BEGIN_DECL
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Create a new writer for `multi-pack-index` files.
|
24
|
+
*
|
25
|
+
* @param out location to store the writer pointer.
|
26
|
+
* @param pack_dir the directory where the `.pack` and `.idx` files are. The
|
27
|
+
* `multi-pack-index` file will be written in this directory, too.
|
28
|
+
* @return 0 or an error code
|
29
|
+
*/
|
30
|
+
GIT_EXTERN(int) git_midx_writer_new(
|
31
|
+
git_midx_writer **out,
|
32
|
+
const char *pack_dir);
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Free the multi-pack-index writer and its resources.
|
36
|
+
*
|
37
|
+
* @param w the writer to free. If NULL no action is taken.
|
38
|
+
*/
|
39
|
+
GIT_EXTERN(void) git_midx_writer_free(git_midx_writer *w);
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Add an `.idx` file to the writer.
|
43
|
+
*
|
44
|
+
* @param w the writer
|
45
|
+
* @param idx_path the path of an `.idx` file.
|
46
|
+
* @return 0 or an error code
|
47
|
+
*/
|
48
|
+
GIT_EXTERN(int) git_midx_writer_add(
|
49
|
+
git_midx_writer *w,
|
50
|
+
const char *idx_path);
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Write a `multi-pack-index` file to a file.
|
54
|
+
*
|
55
|
+
* @param w the writer
|
56
|
+
* @return 0 or an error code
|
57
|
+
*/
|
58
|
+
GIT_EXTERN(int) git_midx_writer_commit(
|
59
|
+
git_midx_writer *w);
|
60
|
+
|
61
|
+
/**
|
62
|
+
* Dump the contents of the `multi-pack-index` to an in-memory buffer.
|
63
|
+
*
|
64
|
+
* @param midx Buffer where to store the contents of the `multi-pack-index`.
|
65
|
+
* @param w the writer
|
66
|
+
* @return 0 or an error code
|
67
|
+
*/
|
68
|
+
GIT_EXTERN(int) git_midx_writer_dump(
|
69
|
+
git_buf *midx,
|
70
|
+
git_midx_writer *w);
|
71
|
+
|
72
|
+
/** @} */
|
73
|
+
GIT_END_DECL
|
74
|
+
#endif
|
@@ -69,11 +69,8 @@ struct git_odb_backend {
|
|
69
69
|
* If the backend implements a refreshing mechanism, it should be exposed
|
70
70
|
* through this endpoint. Each call to `git_odb_refresh()` will invoke it.
|
71
71
|
*
|
72
|
-
*
|
73
|
-
*
|
74
|
-
* `git_odb_refresh()`. For instance, a potential strategy for the backend
|
75
|
-
* implementation to achieve this could be to internally invoke this
|
76
|
-
* endpoint on failed lookups (ie. `exists()`, `read()`, `read_header()`).
|
72
|
+
* The odb layer will automatically call this when needed on failed
|
73
|
+
* lookups (ie. `exists()`, `read()`, `read_header()`).
|
77
74
|
*/
|
78
75
|
int GIT_CALLBACK(refresh)(git_odb_backend *);
|
79
76
|
|
@@ -84,6 +81,13 @@ struct git_odb_backend {
|
|
84
81
|
git_odb_writepack **, git_odb_backend *, git_odb *odb,
|
85
82
|
git_indexer_progress_cb progress_cb, void *progress_payload);
|
86
83
|
|
84
|
+
/**
|
85
|
+
* If the backend supports pack files, this will create a
|
86
|
+
* `multi-pack-index` file which will contain an index of all objects
|
87
|
+
* across all the `.pack` files.
|
88
|
+
*/
|
89
|
+
int GIT_CALLBACK(writemidx)(git_odb_backend *);
|
90
|
+
|
87
91
|
/**
|
88
92
|
* "Freshens" an already existing object, updating its last-used
|
89
93
|
* time. This occurs when `git_odb_write` was called, but the
|
@@ -0,0 +1,31 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
|
+
*
|
4
|
+
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
|
+
* a Linking Exception. For full terms see the included COPYING file.
|
6
|
+
*/
|
7
|
+
|
8
|
+
#ifndef INCLUDE_sys_git_remote_h
|
9
|
+
#define INCLUDE_sys_git_remote_h
|
10
|
+
|
11
|
+
/**
|
12
|
+
* @file git2/sys/remote.h
|
13
|
+
* @brief Low-level remote functionality for custom transports
|
14
|
+
* @defgroup git_remote Low-level remote functionality
|
15
|
+
* @ingroup Git
|
16
|
+
* @{
|
17
|
+
*/
|
18
|
+
|
19
|
+
GIT_BEGIN_DECL
|
20
|
+
|
21
|
+
typedef enum {
|
22
|
+
/** Remote supports fetching an advertised object by ID. */
|
23
|
+
GIT_REMOTE_CAPABILITY_TIP_OID = (1 << 0),
|
24
|
+
|
25
|
+
/** Remote supports fetching an individual reachable object. */
|
26
|
+
GIT_REMOTE_CAPABILITY_REACHABLE_OID = (1 << 1),
|
27
|
+
} git_remote_capability_t;
|
28
|
+
|
29
|
+
/** @} */
|
30
|
+
GIT_END_DECL
|
31
|
+
#endif
|
@@ -9,6 +9,7 @@
|
|
9
9
|
#define INCLUDE_sys_git_transport_h
|
10
10
|
|
11
11
|
#include "git2/net.h"
|
12
|
+
#include "git2/transport.h"
|
12
13
|
#include "git2/types.h"
|
13
14
|
#include "git2/strarray.h"
|
14
15
|
#include "git2/proxy.h"
|
@@ -23,31 +24,9 @@
|
|
23
24
|
|
24
25
|
GIT_BEGIN_DECL
|
25
26
|
|
26
|
-
/**
|
27
|
-
* Flags to pass to transport
|
28
|
-
*
|
29
|
-
* Currently unused.
|
30
|
-
*/
|
31
|
-
typedef enum {
|
32
|
-
GIT_TRANSPORTFLAGS_NONE = 0,
|
33
|
-
} git_transport_flags_t;
|
34
|
-
|
35
27
|
struct git_transport {
|
36
28
|
unsigned int version; /**< The struct version */
|
37
29
|
|
38
|
-
/** Set progress and error callbacks */
|
39
|
-
int GIT_CALLBACK(set_callbacks)(
|
40
|
-
git_transport *transport,
|
41
|
-
git_transport_message_cb progress_cb,
|
42
|
-
git_transport_message_cb error_cb,
|
43
|
-
git_transport_certificate_check_cb certificate_check_cb,
|
44
|
-
void *payload);
|
45
|
-
|
46
|
-
/** Set custom headers for HTTP requests */
|
47
|
-
int GIT_CALLBACK(set_custom_headers)(
|
48
|
-
git_transport *transport,
|
49
|
-
const git_strarray *custom_headers);
|
50
|
-
|
51
30
|
/**
|
52
31
|
* Connect the transport to the remote repository, using the given
|
53
32
|
* direction.
|
@@ -55,11 +34,27 @@ struct git_transport {
|
|
55
34
|
int GIT_CALLBACK(connect)(
|
56
35
|
git_transport *transport,
|
57
36
|
const char *url,
|
58
|
-
git_credential_acquire_cb cred_acquire_cb,
|
59
|
-
void *cred_acquire_payload,
|
60
|
-
const git_proxy_options *proxy_opts,
|
61
37
|
int direction,
|
62
|
-
|
38
|
+
const git_remote_connect_options *connect_opts);
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Resets the connect options for the given transport. This
|
42
|
+
* is useful for updating settings or callbacks for an already
|
43
|
+
* connected transport.
|
44
|
+
*/
|
45
|
+
int GIT_CALLBACK(set_connect_opts)(
|
46
|
+
git_transport *transport,
|
47
|
+
const git_remote_connect_options *connect_opts);
|
48
|
+
|
49
|
+
/**
|
50
|
+
* Gets the capabilities for this remote repository.
|
51
|
+
*
|
52
|
+
* This function may be called after a successful call to
|
53
|
+
* `connect()`.
|
54
|
+
*/
|
55
|
+
int GIT_CALLBACK(capabilities)(
|
56
|
+
unsigned int *capabilities,
|
57
|
+
git_transport *transport);
|
63
58
|
|
64
59
|
/**
|
65
60
|
* Get the list of available references in the remote repository.
|
@@ -74,7 +69,9 @@ struct git_transport {
|
|
74
69
|
git_transport *transport);
|
75
70
|
|
76
71
|
/** Executes the push whose context is in the git_push object. */
|
77
|
-
int GIT_CALLBACK(push)(
|
72
|
+
int GIT_CALLBACK(push)(
|
73
|
+
git_transport *transport,
|
74
|
+
git_push *push);
|
78
75
|
|
79
76
|
/**
|
80
77
|
* Negotiate a fetch with the remote repository.
|
@@ -98,16 +95,11 @@ struct git_transport {
|
|
98
95
|
int GIT_CALLBACK(download_pack)(
|
99
96
|
git_transport *transport,
|
100
97
|
git_repository *repo,
|
101
|
-
git_indexer_progress *stats
|
102
|
-
git_indexer_progress_cb progress_cb,
|
103
|
-
void *progress_payload);
|
98
|
+
git_indexer_progress *stats);
|
104
99
|
|
105
100
|
/** Checks to see if the transport is connected */
|
106
101
|
int GIT_CALLBACK(is_connected)(git_transport *transport);
|
107
102
|
|
108
|
-
/** Reads the flags value previously passed into connect() */
|
109
|
-
int GIT_CALLBACK(read_flags)(git_transport *transport, int *flags);
|
110
|
-
|
111
103
|
/** Cancels any outstanding transport operation */
|
112
104
|
void GIT_CALLBACK(cancel)(git_transport *transport);
|
113
105
|
|
@@ -288,7 +280,7 @@ typedef enum {
|
|
288
280
|
GIT_SERVICE_UPLOADPACK_LS = 1,
|
289
281
|
GIT_SERVICE_UPLOADPACK = 2,
|
290
282
|
GIT_SERVICE_RECEIVEPACK_LS = 3,
|
291
|
-
GIT_SERVICE_RECEIVEPACK = 4
|
283
|
+
GIT_SERVICE_RECEIVEPACK = 4
|
292
284
|
} git_smart_service_t;
|
293
285
|
|
294
286
|
typedef struct git_smart_subtransport git_smart_subtransport;
|
@@ -362,9 +362,22 @@ GIT_EXTERN(int) git_tag_peel(
|
|
362
362
|
*
|
363
363
|
* @param out Pointer to store the copy of the tag
|
364
364
|
* @param source Original tag to copy
|
365
|
+
* @return 0
|
365
366
|
*/
|
366
367
|
GIT_EXTERN(int) git_tag_dup(git_tag **out, git_tag *source);
|
367
368
|
|
369
|
+
/**
|
370
|
+
* Determine whether a tag name is valid, meaning that (when prefixed
|
371
|
+
* with `refs/tags/`) that it is a valid reference name, and that any
|
372
|
+
* additional tag name restrictions are imposed (eg, it cannot start
|
373
|
+
* with a `-`).
|
374
|
+
*
|
375
|
+
* @param valid output pointer to set with validity of given tag name
|
376
|
+
* @param name a tag name to test
|
377
|
+
* @return 0 on success or an error code
|
378
|
+
*/
|
379
|
+
GIT_EXTERN(int) git_tag_name_is_valid(int *valid, const char *name);
|
380
|
+
|
368
381
|
/** @} */
|
369
382
|
GIT_END_DECL
|
370
383
|
#endif
|
@@ -255,7 +255,7 @@ GIT_EXTERN(int) git_treebuilder_new(
|
|
255
255
|
git_treebuilder **out, git_repository *repo, const git_tree *source);
|
256
256
|
|
257
257
|
/**
|
258
|
-
* Clear all the
|
258
|
+
* Clear all the entries in the builder
|
259
259
|
*
|
260
260
|
* @param bld Builder to clear
|
261
261
|
* @return 0 on success; error code otherwise
|
@@ -379,20 +379,6 @@ GIT_EXTERN(int) git_treebuilder_filter(
|
|
379
379
|
GIT_EXTERN(int) git_treebuilder_write(
|
380
380
|
git_oid *id, git_treebuilder *bld);
|
381
381
|
|
382
|
-
/**
|
383
|
-
* Write the contents of the tree builder as a tree object
|
384
|
-
* using a shared git_buf.
|
385
|
-
*
|
386
|
-
* @see git_treebuilder_write
|
387
|
-
*
|
388
|
-
* @param oid Pointer to store the OID of the newly written tree
|
389
|
-
* @param bld Tree builder to write
|
390
|
-
* @param tree Shared buffer for writing the tree. Will be grown as necessary.
|
391
|
-
* @return 0 or an error code
|
392
|
-
*/
|
393
|
-
GIT_EXTERN(int) git_treebuilder_write_with_buffer(
|
394
|
-
git_oid *oid, git_treebuilder *bld, git_buf *tree);
|
395
|
-
|
396
382
|
/** Callback for the tree traversal method */
|
397
383
|
typedef int GIT_CALLBACK(git_treewalk_cb)(
|
398
384
|
const char *root, const git_tree_entry *entry, void *payload);
|
@@ -400,7 +386,7 @@ typedef int GIT_CALLBACK(git_treewalk_cb)(
|
|
400
386
|
/** Tree traversal modes */
|
401
387
|
typedef enum {
|
402
388
|
GIT_TREEWALK_PRE = 0, /* Pre-order */
|
403
|
-
GIT_TREEWALK_POST = 1
|
389
|
+
GIT_TREEWALK_POST = 1 /* Post-order */
|
404
390
|
} git_treewalk_mode;
|
405
391
|
|
406
392
|
/**
|
@@ -432,6 +418,7 @@ GIT_EXTERN(int) git_tree_walk(
|
|
432
418
|
*
|
433
419
|
* @param out Pointer to store the copy of the tree
|
434
420
|
* @param source Original tree to copy
|
421
|
+
* @return 0
|
435
422
|
*/
|
436
423
|
GIT_EXTERN(int) git_tree_dup(git_tree **out, git_tree *source);
|
437
424
|
|
@@ -442,7 +429,7 @@ typedef enum {
|
|
442
429
|
/** Update or insert an entry at the specified path */
|
443
430
|
GIT_TREE_UPDATE_UPSERT,
|
444
431
|
/** Remove an entry from the specified path */
|
445
|
-
GIT_TREE_UPDATE_REMOVE
|
432
|
+
GIT_TREE_UPDATE_REMOVE
|
446
433
|
} git_tree_update_t;
|
447
434
|
|
448
435
|
/**
|