rugged 0.27.7 → 0.27.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/AUTHORS +1 -0
- data/vendor/libgit2/CMakeLists.txt +99 -51
- data/vendor/libgit2/COPYING +28 -0
- data/vendor/libgit2/cmake/Modules/AddCFlagIfSupported.cmake +15 -1
- data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in +29 -0
- data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake +96 -0
- data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +9 -8
- data/vendor/libgit2/cmake/Modules/FindCoreFoundation.cmake +2 -2
- data/vendor/libgit2/cmake/Modules/FindGSSAPI.cmake +1 -1
- data/vendor/libgit2/cmake/Modules/FindGSSFramework.cmake +28 -0
- data/vendor/libgit2/cmake/Modules/FindIconv.cmake +11 -6
- data/vendor/libgit2/cmake/Modules/FindPCRE.cmake +38 -0
- data/vendor/libgit2/cmake/Modules/FindPCRE2.cmake +37 -0
- data/vendor/libgit2/cmake/Modules/FindSecurity.cmake +2 -2
- data/vendor/libgit2/cmake/Modules/FindStatNsec.cmake +6 -0
- data/vendor/libgit2/cmake/Modules/PkgBuildConfig.cmake +110 -0
- data/vendor/libgit2/cmake/Modules/SelectGSSAPI.cmake +53 -0
- data/vendor/libgit2/cmake/Modules/SelectHTTPSBackend.cmake +124 -0
- data/vendor/libgit2/cmake/Modules/SelectHashes.cmake +66 -0
- data/vendor/libgit2/deps/http-parser/http_parser.c +11 -6
- data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +21 -0
- data/vendor/libgit2/deps/ntlmclient/compat.h +33 -0
- data/vendor/libgit2/deps/ntlmclient/crypt.h +64 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +120 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +18 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +145 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +18 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +130 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +21 -0
- data/vendor/libgit2/deps/ntlmclient/ntlm.c +1420 -0
- data/vendor/libgit2/deps/ntlmclient/ntlm.h +174 -0
- data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +320 -0
- data/vendor/libgit2/deps/ntlmclient/unicode.h +36 -0
- data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +445 -0
- data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +201 -0
- data/vendor/libgit2/deps/ntlmclient/utf8.h +1257 -0
- data/vendor/libgit2/deps/ntlmclient/util.c +21 -0
- data/vendor/libgit2/deps/ntlmclient/util.h +14 -0
- data/vendor/libgit2/deps/pcre/CMakeLists.txt +140 -0
- data/vendor/libgit2/deps/pcre/COPYING +5 -0
- data/vendor/libgit2/deps/pcre/cmake/COPYING-CMAKE-SCRIPTS +22 -0
- data/vendor/libgit2/deps/pcre/cmake/FindEditline.cmake +17 -0
- data/vendor/libgit2/deps/pcre/cmake/FindPackageHandleStandardArgs.cmake +58 -0
- data/vendor/libgit2/deps/pcre/cmake/FindReadline.cmake +29 -0
- data/vendor/libgit2/deps/pcre/config.h.in +57 -0
- data/vendor/libgit2/deps/pcre/pcre.h +641 -0
- data/vendor/libgit2/deps/pcre/pcre_byte_order.c +319 -0
- data/vendor/libgit2/deps/pcre/pcre_chartables.c +198 -0
- data/vendor/libgit2/deps/pcre/pcre_compile.c +9800 -0
- data/vendor/libgit2/deps/pcre/pcre_config.c +190 -0
- data/vendor/libgit2/deps/pcre/pcre_dfa_exec.c +3676 -0
- data/vendor/libgit2/deps/pcre/pcre_exec.c +7173 -0
- data/vendor/libgit2/deps/pcre/pcre_fullinfo.c +245 -0
- data/vendor/libgit2/deps/pcre/pcre_get.c +669 -0
- data/vendor/libgit2/deps/pcre/pcre_globals.c +86 -0
- data/vendor/libgit2/deps/pcre/pcre_internal.h +2787 -0
- data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +11913 -0
- data/vendor/libgit2/deps/pcre/pcre_maketables.c +156 -0
- data/vendor/libgit2/deps/pcre/pcre_newline.c +210 -0
- data/vendor/libgit2/deps/pcre/pcre_ord2utf8.c +94 -0
- data/vendor/libgit2/deps/pcre/pcre_printint.c +834 -0
- data/vendor/libgit2/deps/pcre/pcre_refcount.c +92 -0
- data/vendor/libgit2/deps/pcre/pcre_string_utils.c +211 -0
- data/vendor/libgit2/deps/pcre/pcre_study.c +1686 -0
- data/vendor/libgit2/deps/pcre/pcre_tables.c +727 -0
- data/vendor/libgit2/deps/pcre/pcre_ucd.c +3644 -0
- data/vendor/libgit2/deps/pcre/pcre_valid_utf8.c +301 -0
- data/vendor/libgit2/deps/pcre/pcre_version.c +98 -0
- data/vendor/libgit2/deps/pcre/pcre_xclass.c +268 -0
- data/vendor/libgit2/deps/pcre/pcreposix.c +421 -0
- data/vendor/libgit2/deps/pcre/pcreposix.h +117 -0
- data/vendor/libgit2/deps/pcre/ucp.h +224 -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/deps/zlib/adler32.c +0 -7
- data/vendor/libgit2/deps/zlib/crc32.c +0 -7
- data/vendor/libgit2/include/git2/annotated_commit.h +9 -0
- data/vendor/libgit2/include/git2/apply.h +149 -0
- data/vendor/libgit2/include/git2/attr.h +20 -13
- data/vendor/libgit2/include/git2/blame.h +4 -4
- data/vendor/libgit2/include/git2/blob.h +44 -12
- data/vendor/libgit2/include/git2/buffer.h +20 -26
- data/vendor/libgit2/include/git2/cert.h +135 -0
- data/vendor/libgit2/include/git2/checkout.h +53 -21
- data/vendor/libgit2/include/git2/cherrypick.h +3 -3
- data/vendor/libgit2/include/git2/clone.h +5 -5
- data/vendor/libgit2/include/git2/commit.h +25 -3
- data/vendor/libgit2/include/git2/common.h +35 -10
- data/vendor/libgit2/include/git2/config.h +29 -19
- data/vendor/libgit2/include/git2/cred.h +308 -0
- data/vendor/libgit2/include/git2/deprecated.h +493 -0
- data/vendor/libgit2/include/git2/describe.h +4 -4
- data/vendor/libgit2/include/git2/diff.h +177 -135
- data/vendor/libgit2/include/git2/errors.h +53 -46
- data/vendor/libgit2/include/git2/filter.h +8 -0
- data/vendor/libgit2/include/git2/index.h +74 -52
- data/vendor/libgit2/include/git2/indexer.h +76 -6
- data/vendor/libgit2/include/git2/merge.h +25 -10
- data/vendor/libgit2/include/git2/net.h +0 -5
- data/vendor/libgit2/include/git2/notes.h +1 -1
- data/vendor/libgit2/include/git2/object.h +17 -29
- data/vendor/libgit2/include/git2/odb.h +12 -11
- data/vendor/libgit2/include/git2/odb_backend.h +10 -9
- data/vendor/libgit2/include/git2/oid.h +2 -2
- data/vendor/libgit2/include/git2/pack.h +14 -3
- data/vendor/libgit2/include/git2/proxy.h +5 -3
- data/vendor/libgit2/include/git2/rebase.h +46 -2
- data/vendor/libgit2/include/git2/refs.h +34 -16
- data/vendor/libgit2/include/git2/remote.h +111 -14
- data/vendor/libgit2/include/git2/repository.h +69 -34
- data/vendor/libgit2/include/git2/revert.h +1 -1
- 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 +5 -5
- data/vendor/libgit2/include/git2/status.h +26 -17
- data/vendor/libgit2/include/git2/submodule.h +23 -6
- data/vendor/libgit2/include/git2/sys/alloc.h +18 -18
- 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/cred.h +90 -0
- data/vendor/libgit2/include/git2/sys/filter.h +6 -6
- data/vendor/libgit2/include/git2/sys/merge.h +3 -3
- data/vendor/libgit2/include/git2/sys/odb_backend.h +66 -22
- data/vendor/libgit2/include/git2/sys/path.h +14 -5
- data/vendor/libgit2/include/git2/sys/refdb_backend.h +76 -40
- data/vendor/libgit2/include/git2/sys/repository.h +5 -1
- data/vendor/libgit2/include/git2/sys/stream.h +92 -12
- data/vendor/libgit2/include/git2/sys/transport.h +129 -83
- data/vendor/libgit2/include/git2/tag.h +13 -4
- data/vendor/libgit2/include/git2/trace.h +2 -2
- data/vendor/libgit2/include/git2/transport.h +11 -311
- data/vendor/libgit2/include/git2/tree.h +4 -4
- data/vendor/libgit2/include/git2/types.h +25 -106
- data/vendor/libgit2/include/git2/version.h +3 -3
- data/vendor/libgit2/include/git2/worktree.h +5 -5
- data/vendor/libgit2/include/git2.h +4 -0
- data/vendor/libgit2/src/CMakeLists.txt +104 -235
- data/vendor/libgit2/src/alloc.c +14 -18
- data/vendor/libgit2/src/{stdalloc.c → allocators/stdalloc.c} +7 -8
- data/vendor/libgit2/src/{stdalloc.h → allocators/stdalloc.h} +4 -4
- data/vendor/libgit2/src/allocators/win32_crtdbg.c +118 -0
- data/vendor/libgit2/src/{transports/cred.h → allocators/win32_crtdbg.h} +5 -4
- data/vendor/libgit2/src/annotated_commit.c +18 -11
- data/vendor/libgit2/src/apply.c +535 -28
- data/vendor/libgit2/src/apply.h +3 -1
- data/vendor/libgit2/src/array.h +2 -2
- data/vendor/libgit2/src/attr.c +77 -71
- data/vendor/libgit2/src/attr_file.c +203 -117
- data/vendor/libgit2/src/attr_file.h +9 -9
- data/vendor/libgit2/src/attrcache.c +49 -51
- data/vendor/libgit2/src/attrcache.h +2 -1
- data/vendor/libgit2/src/blame.c +38 -18
- data/vendor/libgit2/src/blame.h +1 -1
- data/vendor/libgit2/src/blame_git.c +29 -15
- data/vendor/libgit2/src/blob.c +123 -37
- data/vendor/libgit2/src/blob.h +19 -2
- data/vendor/libgit2/src/branch.c +47 -23
- data/vendor/libgit2/src/buf_text.c +7 -6
- data/vendor/libgit2/src/buffer.c +60 -53
- data/vendor/libgit2/src/cache.c +38 -45
- data/vendor/libgit2/src/cache.h +3 -3
- data/vendor/libgit2/src/cc-compat.h +20 -3
- data/vendor/libgit2/src/checkout.c +77 -67
- data/vendor/libgit2/src/cherrypick.c +12 -6
- data/vendor/libgit2/src/clone.c +36 -14
- data/vendor/libgit2/src/clone.h +4 -0
- data/vendor/libgit2/src/commit.c +103 -48
- data/vendor/libgit2/src/commit.h +7 -0
- data/vendor/libgit2/src/commit_list.c +36 -78
- data/vendor/libgit2/src/commit_list.h +2 -2
- data/vendor/libgit2/src/common.h +24 -90
- data/vendor/libgit2/src/config.c +203 -176
- data/vendor/libgit2/src/config.h +8 -20
- data/vendor/libgit2/src/config_backend.h +96 -0
- data/vendor/libgit2/src/config_cache.c +41 -35
- data/vendor/libgit2/src/config_entries.c +229 -0
- data/vendor/libgit2/src/config_entries.h +24 -0
- data/vendor/libgit2/src/config_file.c +422 -680
- data/vendor/libgit2/src/config_mem.c +220 -0
- data/vendor/libgit2/src/config_parse.c +96 -68
- data/vendor/libgit2/src/config_parse.h +15 -14
- data/vendor/libgit2/src/config_snapshot.c +206 -0
- data/vendor/libgit2/src/crlf.c +219 -196
- data/vendor/libgit2/src/delta.c +25 -18
- data/vendor/libgit2/src/describe.c +42 -41
- data/vendor/libgit2/src/diff.c +52 -67
- data/vendor/libgit2/src/diff.h +2 -1
- data/vendor/libgit2/src/diff_driver.c +44 -46
- data/vendor/libgit2/src/diff_file.c +16 -14
- data/vendor/libgit2/src/diff_file.h +1 -1
- data/vendor/libgit2/src/diff_generate.c +158 -103
- data/vendor/libgit2/src/diff_generate.h +3 -3
- data/vendor/libgit2/src/diff_parse.c +4 -4
- data/vendor/libgit2/src/diff_print.c +34 -22
- data/vendor/libgit2/src/diff_stats.c +22 -7
- data/vendor/libgit2/src/diff_tform.c +18 -16
- data/vendor/libgit2/src/diff_xdiff.c +3 -3
- data/vendor/libgit2/src/errors.c +51 -39
- data/vendor/libgit2/src/errors.h +81 -0
- data/vendor/libgit2/src/features.h.in +9 -3
- data/vendor/libgit2/src/fetch.c +8 -3
- data/vendor/libgit2/src/fetchhead.c +12 -12
- data/vendor/libgit2/src/filebuf.c +28 -32
- data/vendor/libgit2/src/filebuf.h +2 -2
- data/vendor/libgit2/src/filter.c +47 -33
- data/vendor/libgit2/src/filter.h +0 -10
- data/vendor/libgit2/src/{fileops.c → futils.c} +70 -63
- data/vendor/libgit2/src/{fileops.h → futils.h} +6 -6
- data/vendor/libgit2/src/global.c +35 -55
- data/vendor/libgit2/src/global.h +0 -2
- data/vendor/libgit2/src/hash/sha1/collisiondetect.c +48 -0
- data/vendor/libgit2/src/hash/sha1/collisiondetect.h +19 -0
- data/vendor/libgit2/src/hash/{hash_common_crypto.h → sha1/common_crypto.c} +17 -17
- data/vendor/libgit2/src/hash/sha1/common_crypto.h +19 -0
- data/vendor/libgit2/src/hash/{hash_generic.c → sha1/generic.c} +22 -10
- data/vendor/libgit2/src/hash/{hash_generic.h → sha1/generic.h} +4 -10
- data/vendor/libgit2/src/hash/{hash_mbedtls.c → sha1/mbedtls.c} +15 -7
- data/vendor/libgit2/src/hash/{hash_mbedtls.h → sha1/mbedtls.h} +6 -7
- data/vendor/libgit2/src/hash/sha1/openssl.c +59 -0
- data/vendor/libgit2/src/hash/sha1/openssl.h +19 -0
- data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.c +14 -3
- data/vendor/libgit2/src/hash/{hash_win32.c → sha1/win32.c} +47 -37
- data/vendor/libgit2/src/hash/{hash_win32.h → sha1/win32.h} +6 -19
- data/vendor/libgit2/src/hash/sha1.h +38 -0
- data/vendor/libgit2/src/hash.c +61 -0
- data/vendor/libgit2/src/hash.h +20 -21
- data/vendor/libgit2/src/hashsig.c +5 -5
- data/vendor/libgit2/src/idxmap.c +107 -61
- data/vendor/libgit2/src/idxmap.h +153 -31
- data/vendor/libgit2/src/ignore.c +38 -42
- data/vendor/libgit2/src/index.c +264 -199
- data/vendor/libgit2/src/index.h +7 -1
- data/vendor/libgit2/src/indexer.c +338 -167
- data/vendor/libgit2/src/integer.h +71 -26
- data/vendor/libgit2/src/iterator.c +134 -62
- data/vendor/libgit2/src/iterator.h +15 -0
- data/vendor/libgit2/src/mailmap.c +8 -8
- data/vendor/libgit2/src/map.h +1 -1
- data/vendor/libgit2/src/merge.c +137 -93
- data/vendor/libgit2/src/merge_driver.c +11 -11
- data/vendor/libgit2/src/merge_file.c +2 -2
- data/vendor/libgit2/src/mwindow.c +24 -29
- data/vendor/libgit2/src/mwindow.h +4 -4
- data/vendor/libgit2/src/net.c +184 -0
- data/vendor/libgit2/src/net.h +36 -0
- data/vendor/libgit2/src/netops.c +55 -156
- data/vendor/libgit2/src/netops.h +3 -23
- data/vendor/libgit2/src/notes.c +14 -9
- data/vendor/libgit2/src/object.c +120 -69
- data/vendor/libgit2/src/object.h +22 -9
- data/vendor/libgit2/src/object_api.c +8 -8
- data/vendor/libgit2/src/odb.c +111 -88
- data/vendor/libgit2/src/odb.h +8 -7
- data/vendor/libgit2/src/odb_loose.c +58 -47
- data/vendor/libgit2/src/odb_mempack.c +21 -34
- data/vendor/libgit2/src/odb_pack.c +17 -13
- data/vendor/libgit2/src/offmap.c +53 -35
- data/vendor/libgit2/src/offmap.h +108 -21
- data/vendor/libgit2/src/oid.c +12 -7
- data/vendor/libgit2/src/oidmap.c +49 -47
- data/vendor/libgit2/src/oidmap.h +101 -24
- data/vendor/libgit2/src/pack-objects.c +87 -86
- data/vendor/libgit2/src/pack-objects.h +2 -8
- data/vendor/libgit2/src/pack.c +94 -96
- data/vendor/libgit2/src/pack.h +16 -18
- data/vendor/libgit2/src/parse.c +17 -4
- data/vendor/libgit2/src/parse.h +3 -3
- data/vendor/libgit2/src/patch.c +3 -3
- data/vendor/libgit2/src/patch_generate.c +18 -18
- data/vendor/libgit2/src/patch_parse.c +147 -79
- data/vendor/libgit2/src/path.c +207 -62
- data/vendor/libgit2/src/path.h +14 -0
- data/vendor/libgit2/src/pathspec.c +18 -18
- data/vendor/libgit2/src/pool.c +26 -22
- data/vendor/libgit2/src/pool.h +7 -7
- data/vendor/libgit2/src/posix.c +10 -10
- data/vendor/libgit2/src/posix.h +12 -1
- data/vendor/libgit2/src/proxy.c +8 -3
- data/vendor/libgit2/src/push.c +35 -29
- 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 +97 -38
- data/vendor/libgit2/src/refdb.c +15 -3
- data/vendor/libgit2/src/refdb_fs.c +318 -222
- data/vendor/libgit2/src/reflog.c +13 -15
- data/vendor/libgit2/src/refs.c +122 -89
- data/vendor/libgit2/src/refs.h +5 -3
- data/vendor/libgit2/src/refspec.c +27 -33
- data/vendor/libgit2/src/regexp.c +221 -0
- data/vendor/libgit2/src/regexp.h +97 -0
- data/vendor/libgit2/src/remote.c +229 -178
- data/vendor/libgit2/src/remote.h +11 -2
- data/vendor/libgit2/src/repository.c +227 -172
- data/vendor/libgit2/src/repository.h +52 -40
- data/vendor/libgit2/src/reset.c +7 -7
- data/vendor/libgit2/src/revert.c +11 -6
- data/vendor/libgit2/src/revparse.c +46 -46
- data/vendor/libgit2/src/revwalk.c +89 -54
- data/vendor/libgit2/src/revwalk.h +20 -0
- data/vendor/libgit2/src/settings.c +22 -9
- data/vendor/libgit2/src/signature.c +15 -13
- data/vendor/libgit2/src/sortedcache.c +22 -36
- data/vendor/libgit2/src/sortedcache.h +1 -1
- data/vendor/libgit2/src/stash.c +56 -76
- data/vendor/libgit2/src/status.c +27 -21
- data/vendor/libgit2/src/stream.h +17 -2
- data/vendor/libgit2/src/streams/mbedtls.c +100 -80
- data/vendor/libgit2/src/streams/mbedtls.h +5 -2
- data/vendor/libgit2/src/streams/openssl.c +93 -81
- data/vendor/libgit2/src/streams/openssl.h +5 -2
- 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 +55 -30
- 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 +48 -20
- data/vendor/libgit2/src/streams/tls.h +12 -4
- data/vendor/libgit2/src/strmap.c +47 -74
- data/vendor/libgit2/src/strmap.h +108 -33
- data/vendor/libgit2/src/submodule.c +190 -169
- data/vendor/libgit2/src/submodule.h +1 -1
- data/vendor/libgit2/src/sysdir.c +25 -15
- data/vendor/libgit2/src/tag.c +39 -26
- data/vendor/libgit2/src/tag.h +2 -1
- data/vendor/libgit2/src/trace.c +2 -2
- data/vendor/libgit2/src/trace.h +2 -2
- data/vendor/libgit2/src/trailer.c +46 -32
- data/vendor/libgit2/src/transaction.c +30 -29
- data/vendor/libgit2/src/transport.c +3 -3
- data/vendor/libgit2/src/transports/auth.c +14 -10
- data/vendor/libgit2/src/transports/auth.h +10 -3
- data/vendor/libgit2/src/transports/auth_negotiate.c +31 -16
- data/vendor/libgit2/src/transports/auth_negotiate.h +2 -2
- data/vendor/libgit2/src/transports/auth_ntlm.c +223 -0
- data/vendor/libgit2/src/transports/auth_ntlm.h +35 -0
- data/vendor/libgit2/src/transports/cred.c +24 -24
- data/vendor/libgit2/src/transports/git.c +25 -30
- data/vendor/libgit2/src/transports/http.c +871 -335
- data/vendor/libgit2/src/transports/http.h +2 -0
- data/vendor/libgit2/src/transports/local.c +28 -28
- data/vendor/libgit2/src/transports/smart.c +64 -46
- data/vendor/libgit2/src/transports/smart.h +5 -6
- data/vendor/libgit2/src/transports/smart_pkt.c +162 -151
- data/vendor/libgit2/src/transports/smart_protocol.c +64 -94
- data/vendor/libgit2/src/transports/ssh.c +76 -65
- data/vendor/libgit2/src/transports/winhttp.c +328 -319
- data/vendor/libgit2/src/tree-cache.c +21 -14
- data/vendor/libgit2/src/tree.c +119 -112
- data/vendor/libgit2/src/tree.h +1 -0
- data/vendor/libgit2/src/unix/map.c +3 -3
- data/vendor/libgit2/src/unix/posix.h +1 -11
- data/vendor/libgit2/src/userdiff.h +3 -1
- data/vendor/libgit2/src/util.c +154 -93
- data/vendor/libgit2/src/util.h +19 -23
- data/vendor/libgit2/src/vector.c +15 -10
- data/vendor/libgit2/src/wildmatch.c +320 -0
- data/vendor/libgit2/src/wildmatch.h +23 -0
- data/vendor/libgit2/src/win32/dir.c +3 -3
- data/vendor/libgit2/src/win32/findfile.c +1 -1
- data/vendor/libgit2/src/win32/map.c +9 -11
- data/vendor/libgit2/src/win32/msvc-compat.h +6 -0
- data/vendor/libgit2/src/win32/path_w32.c +113 -9
- data/vendor/libgit2/src/win32/path_w32.h +18 -29
- data/vendor/libgit2/src/win32/posix.h +1 -4
- data/vendor/libgit2/src/win32/posix_w32.c +69 -44
- data/vendor/libgit2/src/win32/precompiled.h +0 -2
- data/vendor/libgit2/src/win32/thread.c +5 -10
- data/vendor/libgit2/src/win32/w32_buffer.c +9 -5
- data/vendor/libgit2/src/win32/w32_common.h +39 -0
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +2 -95
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +0 -2
- data/vendor/libgit2/src/win32/w32_stack.c +6 -11
- data/vendor/libgit2/src/win32/w32_stack.h +3 -3
- data/vendor/libgit2/src/win32/w32_util.c +27 -64
- data/vendor/libgit2/src/win32/w32_util.h +5 -49
- data/vendor/libgit2/src/worktree.c +44 -30
- data/vendor/libgit2/src/xdiff/xdiffi.c +5 -5
- data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
- data/vendor/libgit2/src/xdiff/xmerge.c +27 -15
- data/vendor/libgit2/src/xdiff/xpatience.c +3 -0
- data/vendor/libgit2/src/zstream.c +4 -4
- metadata +115 -38
- data/vendor/libgit2/deps/regex/CMakeLists.txt +0 -2
- data/vendor/libgit2/deps/regex/config.h +0 -7
- data/vendor/libgit2/deps/regex/regcomp.c +0 -3857
- data/vendor/libgit2/deps/regex/regex.c +0 -92
- data/vendor/libgit2/deps/regex/regex.h +0 -582
- data/vendor/libgit2/deps/regex/regex_internal.c +0 -1744
- data/vendor/libgit2/deps/regex/regex_internal.h +0 -819
- data/vendor/libgit2/deps/regex/regexec.c +0 -4369
- data/vendor/libgit2/include/git2/inttypes.h +0 -309
- data/vendor/libgit2/include/git2/sys/time.h +0 -31
- data/vendor/libgit2/libgit2.pc.in +0 -13
- data/vendor/libgit2/src/config_file.h +0 -73
- data/vendor/libgit2/src/fnmatch.c +0 -248
- data/vendor/libgit2/src/fnmatch.h +0 -48
- data/vendor/libgit2/src/hash/hash_collisiondetect.h +0 -47
- data/vendor/libgit2/src/hash/hash_openssl.h +0 -59
- data/vendor/libgit2/src/streams/curl.c +0 -385
- data/vendor/libgit2/src/streams/curl.h +0 -17
- /data/vendor/libgit2/deps/http-parser/{LICENSE-MIT → COPYING} +0 -0
- /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.h +0 -0
- /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.c +0 -0
- /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.h +0 -0
data/vendor/libgit2/src/odb.c
CHANGED
|
@@ -10,11 +10,12 @@
|
|
|
10
10
|
#include <zlib.h>
|
|
11
11
|
#include "git2/object.h"
|
|
12
12
|
#include "git2/sys/odb_backend.h"
|
|
13
|
-
#include "
|
|
13
|
+
#include "futils.h"
|
|
14
14
|
#include "hash.h"
|
|
15
15
|
#include "delta.h"
|
|
16
16
|
#include "filter.h"
|
|
17
17
|
#include "repository.h"
|
|
18
|
+
#include "blob.h"
|
|
18
19
|
|
|
19
20
|
#include "git2/odb_backend.h"
|
|
20
21
|
#include "git2/oid.h"
|
|
@@ -51,34 +52,34 @@ static git_cache *odb_cache(git_odb *odb)
|
|
|
51
52
|
return &odb->own_cache;
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
static int odb_otype_fast(
|
|
55
|
+
static int odb_otype_fast(git_object_t *type_p, git_odb *db, const git_oid *id);
|
|
55
56
|
static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_depth);
|
|
56
57
|
static int error_null_oid(int error, const char *message);
|
|
57
58
|
|
|
58
|
-
static
|
|
59
|
+
static git_object_t odb_hardcoded_type(const git_oid *id)
|
|
59
60
|
{
|
|
60
61
|
static git_oid empty_tree = {{ 0x4b, 0x82, 0x5d, 0xc6, 0x42, 0xcb, 0x6e, 0xb9, 0xa0, 0x60,
|
|
61
62
|
0xe5, 0x4b, 0xf8, 0xd6, 0x92, 0x88, 0xfb, 0xee, 0x49, 0x04 }};
|
|
62
63
|
|
|
63
64
|
if (!git_oid_cmp(id, &empty_tree))
|
|
64
|
-
return
|
|
65
|
+
return GIT_OBJECT_TREE;
|
|
65
66
|
|
|
66
|
-
return
|
|
67
|
+
return GIT_OBJECT_INVALID;
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
static int odb_read_hardcoded(bool *found, git_rawobj *raw, const git_oid *id)
|
|
70
71
|
{
|
|
71
|
-
|
|
72
|
+
git_object_t type;
|
|
72
73
|
|
|
73
74
|
*found = false;
|
|
74
75
|
|
|
75
|
-
if ((type = odb_hardcoded_type(id)) ==
|
|
76
|
+
if ((type = odb_hardcoded_type(id)) == GIT_OBJECT_INVALID)
|
|
76
77
|
return 0;
|
|
77
78
|
|
|
78
79
|
raw->type = type;
|
|
79
80
|
raw->len = 0;
|
|
80
81
|
raw->data = git__calloc(1, sizeof(uint8_t));
|
|
81
|
-
|
|
82
|
+
GIT_ERROR_CHECK_ALLOC(raw->data);
|
|
82
83
|
|
|
83
84
|
*found = true;
|
|
84
85
|
return 0;
|
|
@@ -88,17 +89,17 @@ int git_odb__format_object_header(
|
|
|
88
89
|
size_t *written,
|
|
89
90
|
char *hdr,
|
|
90
91
|
size_t hdr_size,
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
git_object_size_t obj_len,
|
|
93
|
+
git_object_t obj_type)
|
|
93
94
|
{
|
|
94
95
|
const char *type_str = git_object_type2string(obj_type);
|
|
95
96
|
int hdr_max = (hdr_size > INT_MAX-2) ? (INT_MAX-2) : (int)hdr_size;
|
|
96
97
|
int len;
|
|
97
98
|
|
|
98
|
-
len = p_snprintf(hdr, hdr_max, "%s %
|
|
99
|
+
len = p_snprintf(hdr, hdr_max, "%s %"PRId64, type_str, (int64_t)obj_len);
|
|
99
100
|
|
|
100
101
|
if (len < 0 || len >= hdr_max) {
|
|
101
|
-
|
|
102
|
+
git_error_set(GIT_ERROR_OS, "object header creation failed");
|
|
102
103
|
return -1;
|
|
103
104
|
}
|
|
104
105
|
|
|
@@ -116,12 +117,12 @@ int git_odb__hashobj(git_oid *id, git_rawobj *obj)
|
|
|
116
117
|
assert(id && obj);
|
|
117
118
|
|
|
118
119
|
if (!git_object_typeisloose(obj->type)) {
|
|
119
|
-
|
|
120
|
+
git_error_set(GIT_ERROR_INVALID, "invalid object type");
|
|
120
121
|
return -1;
|
|
121
122
|
}
|
|
122
123
|
|
|
123
124
|
if (!obj->data && obj->len != 0) {
|
|
124
|
-
|
|
125
|
+
git_error_set(GIT_ERROR_INVALID, "invalid object");
|
|
125
126
|
return -1;
|
|
126
127
|
}
|
|
127
128
|
|
|
@@ -175,7 +176,7 @@ size_t git_odb_object_size(git_odb_object *object)
|
|
|
175
176
|
return object->cached.size;
|
|
176
177
|
}
|
|
177
178
|
|
|
178
|
-
|
|
179
|
+
git_object_t git_odb_object_type(git_odb_object *object)
|
|
179
180
|
{
|
|
180
181
|
return object->cached.type;
|
|
181
182
|
}
|
|
@@ -195,7 +196,7 @@ void git_odb_object_free(git_odb_object *object)
|
|
|
195
196
|
git_cached_obj_decref(object);
|
|
196
197
|
}
|
|
197
198
|
|
|
198
|
-
int git_odb__hashfd(git_oid *out, git_file fd, size_t size,
|
|
199
|
+
int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_object_t type)
|
|
199
200
|
{
|
|
200
201
|
size_t hdr_len;
|
|
201
202
|
char hdr[64], buffer[FILEIO_BUFSIZE];
|
|
@@ -204,7 +205,7 @@ int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_otype type)
|
|
|
204
205
|
int error = 0;
|
|
205
206
|
|
|
206
207
|
if (!git_object_typeisloose(type)) {
|
|
207
|
-
|
|
208
|
+
git_error_set(GIT_ERROR_INVALID, "invalid object type for hash");
|
|
208
209
|
return -1;
|
|
209
210
|
}
|
|
210
211
|
|
|
@@ -229,7 +230,7 @@ int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_otype type)
|
|
|
229
230
|
* If size is not zero, the file was truncated after we originally
|
|
230
231
|
* stat'd it, so we consider this a read failure too */
|
|
231
232
|
if (read_len < 0 || size > 0) {
|
|
232
|
-
|
|
233
|
+
git_error_set(GIT_ERROR_OS, "error reading file for hashing");
|
|
233
234
|
error = -1;
|
|
234
235
|
|
|
235
236
|
goto done;
|
|
@@ -243,7 +244,7 @@ done:
|
|
|
243
244
|
}
|
|
244
245
|
|
|
245
246
|
int git_odb__hashfd_filtered(
|
|
246
|
-
git_oid *out, git_file fd, size_t size,
|
|
247
|
+
git_oid *out, git_file fd, size_t size, git_object_t type, git_filter_list *fl)
|
|
247
248
|
{
|
|
248
249
|
int error;
|
|
249
250
|
git_buf raw = GIT_BUF_INIT;
|
|
@@ -281,7 +282,7 @@ int git_odb__hashlink(git_oid *out, const char *path)
|
|
|
281
282
|
return -1;
|
|
282
283
|
|
|
283
284
|
if (!git__is_int(st.st_size) || (int)st.st_size < 0) {
|
|
284
|
-
|
|
285
|
+
git_error_set(GIT_ERROR_FILESYSTEM, "file size overflow for 32-bit systems");
|
|
285
286
|
return -1;
|
|
286
287
|
}
|
|
287
288
|
|
|
@@ -292,50 +293,56 @@ int git_odb__hashlink(git_oid *out, const char *path)
|
|
|
292
293
|
int read_len;
|
|
293
294
|
size_t alloc_size;
|
|
294
295
|
|
|
295
|
-
|
|
296
|
+
GIT_ERROR_CHECK_ALLOC_ADD(&alloc_size, size, 1);
|
|
296
297
|
link_data = git__malloc(alloc_size);
|
|
297
|
-
|
|
298
|
+
GIT_ERROR_CHECK_ALLOC(link_data);
|
|
298
299
|
|
|
299
300
|
read_len = p_readlink(path, link_data, size);
|
|
300
301
|
link_data[size] = '\0';
|
|
301
302
|
if (read_len != size) {
|
|
302
|
-
|
|
303
|
+
git_error_set(GIT_ERROR_OS, "failed to read symlink data for '%s'", path);
|
|
303
304
|
git__free(link_data);
|
|
304
305
|
return -1;
|
|
305
306
|
}
|
|
306
307
|
|
|
307
|
-
result = git_odb_hash(out, link_data, size,
|
|
308
|
+
result = git_odb_hash(out, link_data, size, GIT_OBJECT_BLOB);
|
|
308
309
|
git__free(link_data);
|
|
309
310
|
} else {
|
|
310
311
|
int fd = git_futils_open_ro(path);
|
|
311
312
|
if (fd < 0)
|
|
312
313
|
return -1;
|
|
313
|
-
result = git_odb__hashfd(out, fd, size,
|
|
314
|
+
result = git_odb__hashfd(out, fd, size, GIT_OBJECT_BLOB);
|
|
314
315
|
p_close(fd);
|
|
315
316
|
}
|
|
316
317
|
|
|
317
318
|
return result;
|
|
318
319
|
}
|
|
319
320
|
|
|
320
|
-
int git_odb_hashfile(git_oid *out, const char *path,
|
|
321
|
+
int git_odb_hashfile(git_oid *out, const char *path, git_object_t type)
|
|
321
322
|
{
|
|
322
|
-
|
|
323
|
-
int
|
|
324
|
-
|
|
323
|
+
uint64_t size;
|
|
324
|
+
int fd, error = 0;
|
|
325
|
+
|
|
326
|
+
if ((fd = git_futils_open_ro(path)) < 0)
|
|
325
327
|
return fd;
|
|
326
328
|
|
|
327
|
-
if ((
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
329
|
+
if ((error = git_futils_filesize(&size, fd)) < 0)
|
|
330
|
+
goto done;
|
|
331
|
+
|
|
332
|
+
if (!git__is_sizet(size)) {
|
|
333
|
+
git_error_set(GIT_ERROR_OS, "file size overflow for 32-bit systems");
|
|
334
|
+
error = -1;
|
|
335
|
+
goto done;
|
|
331
336
|
}
|
|
332
337
|
|
|
333
|
-
|
|
338
|
+
error = git_odb__hashfd(out, fd, (size_t)size, type);
|
|
339
|
+
|
|
340
|
+
done:
|
|
334
341
|
p_close(fd);
|
|
335
|
-
return
|
|
342
|
+
return error;
|
|
336
343
|
}
|
|
337
344
|
|
|
338
|
-
int git_odb_hash(git_oid *id, const void *data, size_t len,
|
|
345
|
+
int git_odb_hash(git_oid *id, const void *data, size_t len, git_object_t type)
|
|
339
346
|
{
|
|
340
347
|
git_rawobj raw;
|
|
341
348
|
|
|
@@ -356,7 +363,7 @@ typedef struct {
|
|
|
356
363
|
git_odb_stream stream;
|
|
357
364
|
char *buffer;
|
|
358
365
|
size_t size, written;
|
|
359
|
-
|
|
366
|
+
git_object_t type;
|
|
360
367
|
} fake_wstream;
|
|
361
368
|
|
|
362
369
|
static int fake_wstream__fwrite(git_odb_stream *_stream, const git_oid *oid)
|
|
@@ -384,21 +391,20 @@ static void fake_wstream__free(git_odb_stream *_stream)
|
|
|
384
391
|
git__free(stream);
|
|
385
392
|
}
|
|
386
393
|
|
|
387
|
-
static int init_fake_wstream(git_odb_stream **stream_p, git_odb_backend *backend,
|
|
394
|
+
static int init_fake_wstream(git_odb_stream **stream_p, git_odb_backend *backend, git_object_size_t size, git_object_t type)
|
|
388
395
|
{
|
|
389
396
|
fake_wstream *stream;
|
|
397
|
+
size_t blobsize;
|
|
390
398
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
return -1;
|
|
394
|
-
}
|
|
399
|
+
GIT_ERROR_CHECK_BLOBSIZE(size);
|
|
400
|
+
blobsize = (size_t)size;
|
|
395
401
|
|
|
396
402
|
stream = git__calloc(1, sizeof(fake_wstream));
|
|
397
|
-
|
|
403
|
+
GIT_ERROR_CHECK_ALLOC(stream);
|
|
398
404
|
|
|
399
|
-
stream->size =
|
|
405
|
+
stream->size = blobsize;
|
|
400
406
|
stream->type = type;
|
|
401
|
-
stream->buffer = git__malloc(
|
|
407
|
+
stream->buffer = git__malloc(blobsize);
|
|
402
408
|
if (stream->buffer == NULL) {
|
|
403
409
|
git__free(stream);
|
|
404
410
|
return -1;
|
|
@@ -441,10 +447,14 @@ static int backend_sort_cmp(const void *a, const void *b)
|
|
|
441
447
|
int git_odb_new(git_odb **out)
|
|
442
448
|
{
|
|
443
449
|
git_odb *db = git__calloc(1, sizeof(*db));
|
|
444
|
-
|
|
450
|
+
GIT_ERROR_CHECK_ALLOC(db);
|
|
445
451
|
|
|
446
|
-
if (git_cache_init(&db->own_cache) < 0
|
|
447
|
-
|
|
452
|
+
if (git_cache_init(&db->own_cache) < 0) {
|
|
453
|
+
git__free(db);
|
|
454
|
+
return -1;
|
|
455
|
+
}
|
|
456
|
+
if (git_vector_init(&db->backends, 4, backend_sort_cmp) < 0) {
|
|
457
|
+
git_cache_dispose(&db->own_cache);
|
|
448
458
|
git__free(db);
|
|
449
459
|
return -1;
|
|
450
460
|
}
|
|
@@ -462,13 +472,13 @@ static int add_backend_internal(
|
|
|
462
472
|
|
|
463
473
|
assert(odb && backend);
|
|
464
474
|
|
|
465
|
-
|
|
475
|
+
GIT_ERROR_CHECK_VERSION(backend, GIT_ODB_BACKEND_VERSION, "git_odb_backend");
|
|
466
476
|
|
|
467
477
|
/* Check if the backend is already owned by another ODB */
|
|
468
478
|
assert(!backend->odb || backend->odb == odb);
|
|
469
479
|
|
|
470
480
|
internal = git__malloc(sizeof(backend_internal));
|
|
471
|
-
|
|
481
|
+
GIT_ERROR_CHECK_ALLOC(internal);
|
|
472
482
|
|
|
473
483
|
internal->backend = backend;
|
|
474
484
|
internal->priority = priority;
|
|
@@ -503,7 +513,7 @@ size_t git_odb_num_backends(git_odb *odb)
|
|
|
503
513
|
|
|
504
514
|
static int git_odb__error_unsupported_in_backend(const char *action)
|
|
505
515
|
{
|
|
506
|
-
|
|
516
|
+
git_error_set(GIT_ERROR_ODB,
|
|
507
517
|
"cannot %s - unsupported in the loaded odb backends", action);
|
|
508
518
|
return -1;
|
|
509
519
|
}
|
|
@@ -521,7 +531,7 @@ int git_odb_get_backend(git_odb_backend **out, git_odb *odb, size_t pos)
|
|
|
521
531
|
return 0;
|
|
522
532
|
}
|
|
523
533
|
|
|
524
|
-
|
|
534
|
+
git_error_set(GIT_ERROR_ODB, "no ODB backend loaded at index %" PRIuZ, pos);
|
|
525
535
|
return GIT_ENOTFOUND;
|
|
526
536
|
}
|
|
527
537
|
|
|
@@ -544,9 +554,10 @@ int git_odb__add_default_backends(
|
|
|
544
554
|
#else
|
|
545
555
|
if (p_stat(objects_dir, &st) < 0) {
|
|
546
556
|
if (as_alternates)
|
|
557
|
+
/* this should warn */
|
|
547
558
|
return 0;
|
|
548
559
|
|
|
549
|
-
|
|
560
|
+
git_error_set(GIT_ERROR_ODB, "failed to load object database in '%s'", objects_dir);
|
|
550
561
|
return -1;
|
|
551
562
|
}
|
|
552
563
|
|
|
@@ -657,11 +668,11 @@ int git_odb__set_caps(git_odb *odb, int caps)
|
|
|
657
668
|
int val;
|
|
658
669
|
|
|
659
670
|
if (!repo) {
|
|
660
|
-
|
|
671
|
+
git_error_set(GIT_ERROR_ODB, "cannot access repository to set odb caps");
|
|
661
672
|
return -1;
|
|
662
673
|
}
|
|
663
674
|
|
|
664
|
-
if (!
|
|
675
|
+
if (!git_repository__configmap_lookup(&val, repo, GIT_CONFIGMAP_FSYNCOBJECTFILES))
|
|
665
676
|
odb->do_fsync = !!val;
|
|
666
677
|
}
|
|
667
678
|
|
|
@@ -682,7 +693,7 @@ static void odb_free(git_odb *db)
|
|
|
682
693
|
}
|
|
683
694
|
|
|
684
695
|
git_vector_free(&db->backends);
|
|
685
|
-
|
|
696
|
+
git_cache_dispose(&db->own_cache);
|
|
686
697
|
|
|
687
698
|
git__memzero(db, sizeof(*db));
|
|
688
699
|
git__free(db);
|
|
@@ -762,7 +773,7 @@ int git_odb_exists(git_odb *db, const git_oid *id)
|
|
|
762
773
|
|
|
763
774
|
assert(db && id);
|
|
764
775
|
|
|
765
|
-
if (
|
|
776
|
+
if (git_oid_is_zero(id))
|
|
766
777
|
return 0;
|
|
767
778
|
|
|
768
779
|
if ((object = git_cache_get_raw(odb_cache(db), id)) != NULL) {
|
|
@@ -871,7 +882,7 @@ int git_odb_expand_ids(
|
|
|
871
882
|
int error = GIT_EAMBIGUOUS;
|
|
872
883
|
|
|
873
884
|
if (!query->type)
|
|
874
|
-
query->type =
|
|
885
|
+
query->type = GIT_OBJECT_ANY;
|
|
875
886
|
|
|
876
887
|
/* if we have a short OID, expand it first */
|
|
877
888
|
if (query->length >= GIT_OID_MINPREFIXLEN && query->length < GIT_OID_HEXSZ) {
|
|
@@ -889,11 +900,11 @@ int git_odb_expand_ids(
|
|
|
889
900
|
* or because the user passed a full OID. Ensure its type is right.
|
|
890
901
|
*/
|
|
891
902
|
if (query->length >= GIT_OID_HEXSZ) {
|
|
892
|
-
|
|
903
|
+
git_object_t actual_type;
|
|
893
904
|
|
|
894
905
|
error = odb_otype_fast(&actual_type, db, &query->id);
|
|
895
906
|
if (!error) {
|
|
896
|
-
if (query->type !=
|
|
907
|
+
if (query->type != GIT_OBJECT_ANY && query->type != actual_type)
|
|
897
908
|
error = GIT_ENOTFOUND;
|
|
898
909
|
else
|
|
899
910
|
query->type = actual_type;
|
|
@@ -919,11 +930,11 @@ int git_odb_expand_ids(
|
|
|
919
930
|
}
|
|
920
931
|
}
|
|
921
932
|
|
|
922
|
-
|
|
933
|
+
git_error_clear();
|
|
923
934
|
return 0;
|
|
924
935
|
}
|
|
925
936
|
|
|
926
|
-
int git_odb_read_header(size_t *len_p,
|
|
937
|
+
int git_odb_read_header(size_t *len_p, git_object_t *type_p, git_odb *db, const git_oid *id)
|
|
927
938
|
{
|
|
928
939
|
int error;
|
|
929
940
|
git_odb_object *object;
|
|
@@ -937,15 +948,15 @@ int git_odb_read_header(size_t *len_p, git_otype *type_p, git_odb *db, const git
|
|
|
937
948
|
}
|
|
938
949
|
|
|
939
950
|
static int odb_read_header_1(
|
|
940
|
-
size_t *len_p,
|
|
951
|
+
size_t *len_p, git_object_t *type_p, git_odb *db,
|
|
941
952
|
const git_oid *id, bool only_refreshed)
|
|
942
953
|
{
|
|
943
954
|
size_t i;
|
|
944
|
-
|
|
955
|
+
git_object_t ht;
|
|
945
956
|
bool passthrough = false;
|
|
946
957
|
int error;
|
|
947
958
|
|
|
948
|
-
if (!only_refreshed && (ht = odb_hardcoded_type(id)) !=
|
|
959
|
+
if (!only_refreshed && (ht = odb_hardcoded_type(id)) != GIT_OBJECT_INVALID) {
|
|
949
960
|
*type_p = ht;
|
|
950
961
|
*len_p = 0;
|
|
951
962
|
return 0;
|
|
@@ -980,7 +991,7 @@ static int odb_read_header_1(
|
|
|
980
991
|
}
|
|
981
992
|
|
|
982
993
|
int git_odb__read_header_or_object(
|
|
983
|
-
git_odb_object **out, size_t *len_p,
|
|
994
|
+
git_odb_object **out, size_t *len_p, git_object_t *type_p,
|
|
984
995
|
git_odb *db, const git_oid *id)
|
|
985
996
|
{
|
|
986
997
|
int error = GIT_ENOTFOUND;
|
|
@@ -990,7 +1001,7 @@ int git_odb__read_header_or_object(
|
|
|
990
1001
|
|
|
991
1002
|
*out = NULL;
|
|
992
1003
|
|
|
993
|
-
if (
|
|
1004
|
+
if (git_oid_is_zero(id))
|
|
994
1005
|
return error_null_oid(GIT_ENOTFOUND, "cannot read object");
|
|
995
1006
|
|
|
996
1007
|
if ((object = git_cache_get_raw(odb_cache(db), id)) != NULL) {
|
|
@@ -1075,7 +1086,7 @@ static int odb_read_1(git_odb_object **out, git_odb *db, const git_oid *id,
|
|
|
1075
1086
|
}
|
|
1076
1087
|
}
|
|
1077
1088
|
|
|
1078
|
-
|
|
1089
|
+
git_error_clear();
|
|
1079
1090
|
if ((object = odb_object__alloc(id, &raw)) == NULL) {
|
|
1080
1091
|
error = -1;
|
|
1081
1092
|
goto out;
|
|
@@ -1095,7 +1106,7 @@ int git_odb_read(git_odb_object **out, git_odb *db, const git_oid *id)
|
|
|
1095
1106
|
|
|
1096
1107
|
assert(out && db && id);
|
|
1097
1108
|
|
|
1098
|
-
if (
|
|
1109
|
+
if (git_oid_is_zero(id))
|
|
1099
1110
|
return error_null_oid(GIT_ENOTFOUND, "cannot read object");
|
|
1100
1111
|
|
|
1101
1112
|
*out = git_cache_get_raw(odb_cache(db), id);
|
|
@@ -1113,17 +1124,18 @@ int git_odb_read(git_odb_object **out, git_odb *db, const git_oid *id)
|
|
|
1113
1124
|
return error;
|
|
1114
1125
|
}
|
|
1115
1126
|
|
|
1116
|
-
static int odb_otype_fast(
|
|
1127
|
+
static int odb_otype_fast(git_object_t *type_p, git_odb *db, const git_oid *id)
|
|
1117
1128
|
{
|
|
1118
1129
|
git_odb_object *object;
|
|
1119
1130
|
size_t _unused;
|
|
1120
1131
|
int error;
|
|
1121
1132
|
|
|
1122
|
-
if (
|
|
1133
|
+
if (git_oid_is_zero(id))
|
|
1123
1134
|
return error_null_oid(GIT_ENOTFOUND, "cannot get object type");
|
|
1124
1135
|
|
|
1125
1136
|
if ((object = git_cache_get_raw(odb_cache(db), id)) != NULL) {
|
|
1126
1137
|
*type_p = object->cached.type;
|
|
1138
|
+
git_odb_object_free(object);
|
|
1127
1139
|
return 0;
|
|
1128
1140
|
}
|
|
1129
1141
|
|
|
@@ -1260,7 +1272,7 @@ int git_odb_foreach(git_odb *db, git_odb_foreach_cb cb, void *payload)
|
|
|
1260
1272
|
git_vector_foreach(&db->backends, i, internal) {
|
|
1261
1273
|
git_odb_backend *b = internal->backend;
|
|
1262
1274
|
int error = b->foreach(b, cb, payload);
|
|
1263
|
-
if (error
|
|
1275
|
+
if (error != 0)
|
|
1264
1276
|
return error;
|
|
1265
1277
|
}
|
|
1266
1278
|
|
|
@@ -1268,7 +1280,7 @@ int git_odb_foreach(git_odb *db, git_odb_foreach_cb cb, void *payload)
|
|
|
1268
1280
|
}
|
|
1269
1281
|
|
|
1270
1282
|
int git_odb_write(
|
|
1271
|
-
git_oid *oid, git_odb *db, const void *data, size_t len,
|
|
1283
|
+
git_oid *oid, git_odb *db, const void *data, size_t len, git_object_t type)
|
|
1272
1284
|
{
|
|
1273
1285
|
size_t i;
|
|
1274
1286
|
int error = GIT_ERROR;
|
|
@@ -1278,7 +1290,7 @@ int git_odb_write(
|
|
|
1278
1290
|
|
|
1279
1291
|
git_odb_hash(oid, data, len, type);
|
|
1280
1292
|
|
|
1281
|
-
if (
|
|
1293
|
+
if (git_oid_is_zero(oid))
|
|
1282
1294
|
return error_null_oid(GIT_EINVALID, "cannot write object");
|
|
1283
1295
|
|
|
1284
1296
|
if (git_odb__freshen(db, oid))
|
|
@@ -1313,7 +1325,7 @@ int git_odb_write(
|
|
|
1313
1325
|
return error;
|
|
1314
1326
|
}
|
|
1315
1327
|
|
|
1316
|
-
static int hash_header(git_hash_ctx *ctx,
|
|
1328
|
+
static int hash_header(git_hash_ctx *ctx, git_object_size_t size, git_object_t type)
|
|
1317
1329
|
{
|
|
1318
1330
|
char header[64];
|
|
1319
1331
|
size_t hdrlen;
|
|
@@ -1327,7 +1339,7 @@ static int hash_header(git_hash_ctx *ctx, git_off_t size, git_otype type)
|
|
|
1327
1339
|
}
|
|
1328
1340
|
|
|
1329
1341
|
int git_odb_open_wstream(
|
|
1330
|
-
git_odb_stream **stream, git_odb *db,
|
|
1342
|
+
git_odb_stream **stream, git_odb *db, git_object_size_t size, git_object_t type)
|
|
1331
1343
|
{
|
|
1332
1344
|
size_t i, writes = 0;
|
|
1333
1345
|
int error = GIT_ERROR;
|
|
@@ -1362,7 +1374,7 @@ int git_odb_open_wstream(
|
|
|
1362
1374
|
}
|
|
1363
1375
|
|
|
1364
1376
|
ctx = git__malloc(sizeof(git_hash_ctx));
|
|
1365
|
-
|
|
1377
|
+
GIT_ERROR_CHECK_ALLOC(ctx);
|
|
1366
1378
|
|
|
1367
1379
|
if ((error = git_hash_ctx_init(ctx)) < 0 ||
|
|
1368
1380
|
(error = hash_header(ctx, size, type)) < 0)
|
|
@@ -1382,10 +1394,10 @@ static int git_odb_stream__invalid_length(
|
|
|
1382
1394
|
const git_odb_stream *stream,
|
|
1383
1395
|
const char *action)
|
|
1384
1396
|
{
|
|
1385
|
-
|
|
1397
|
+
git_error_set(GIT_ERROR_ODB,
|
|
1386
1398
|
"cannot %s - "
|
|
1387
|
-
"Invalid length. %"
|
|
1388
|
-
"total size of the received chunks amounts to %"
|
|
1399
|
+
"Invalid length. %"PRId64" was expected. The "
|
|
1400
|
+
"total size of the received chunks amounts to %"PRId64".",
|
|
1389
1401
|
action, stream->declared_size, stream->received_bytes);
|
|
1390
1402
|
|
|
1391
1403
|
return -1;
|
|
@@ -1436,7 +1448,7 @@ void git_odb_stream_free(git_odb_stream *stream)
|
|
|
1436
1448
|
int git_odb_open_rstream(
|
|
1437
1449
|
git_odb_stream **stream,
|
|
1438
1450
|
size_t *len,
|
|
1439
|
-
|
|
1451
|
+
git_object_t *type,
|
|
1440
1452
|
git_odb *db,
|
|
1441
1453
|
const git_oid *oid)
|
|
1442
1454
|
{
|
|
@@ -1463,7 +1475,7 @@ int git_odb_open_rstream(
|
|
|
1463
1475
|
return error;
|
|
1464
1476
|
}
|
|
1465
1477
|
|
|
1466
|
-
int git_odb_write_pack(struct git_odb_writepack **out, git_odb *db,
|
|
1478
|
+
int git_odb_write_pack(struct git_odb_writepack **out, git_odb *db, git_indexer_progress_cb progress_cb, void *progress_payload)
|
|
1467
1479
|
{
|
|
1468
1480
|
size_t i, writes = 0;
|
|
1469
1481
|
int error = GIT_ERROR;
|
|
@@ -1492,12 +1504,23 @@ int git_odb_write_pack(struct git_odb_writepack **out, git_odb *db, git_transfer
|
|
|
1492
1504
|
return error;
|
|
1493
1505
|
}
|
|
1494
1506
|
|
|
1495
|
-
void *
|
|
1507
|
+
void *git_odb_backend_data_alloc(git_odb_backend *backend, size_t len)
|
|
1496
1508
|
{
|
|
1497
1509
|
GIT_UNUSED(backend);
|
|
1498
1510
|
return git__malloc(len);
|
|
1499
1511
|
}
|
|
1500
1512
|
|
|
1513
|
+
void *git_odb_backend_malloc(git_odb_backend *backend, size_t len)
|
|
1514
|
+
{
|
|
1515
|
+
return git_odb_backend_data_alloc(backend, len);
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
void git_odb_backend_data_free(git_odb_backend *backend, void *data)
|
|
1519
|
+
{
|
|
1520
|
+
GIT_UNUSED(backend);
|
|
1521
|
+
git__free(data);
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1501
1524
|
int git_odb_refresh(struct git_odb *db)
|
|
1502
1525
|
{
|
|
1503
1526
|
size_t i;
|
|
@@ -1524,7 +1547,7 @@ int git_odb__error_mismatch(const git_oid *expected, const git_oid *actual)
|
|
|
1524
1547
|
git_oid_tostr(expected_oid, sizeof(expected_oid), expected);
|
|
1525
1548
|
git_oid_tostr(actual_oid, sizeof(actual_oid), actual);
|
|
1526
1549
|
|
|
1527
|
-
|
|
1550
|
+
git_error_set(GIT_ERROR_ODB, "object hash mismatch - expected %s but got %s",
|
|
1528
1551
|
expected_oid, actual_oid);
|
|
1529
1552
|
|
|
1530
1553
|
return GIT_EMISMATCH;
|
|
@@ -1536,23 +1559,23 @@ int git_odb__error_notfound(
|
|
|
1536
1559
|
if (oid != NULL) {
|
|
1537
1560
|
char oid_str[GIT_OID_HEXSZ + 1];
|
|
1538
1561
|
git_oid_tostr(oid_str, oid_len+1, oid);
|
|
1539
|
-
|
|
1562
|
+
git_error_set(GIT_ERROR_ODB, "object not found - %s (%.*s)",
|
|
1540
1563
|
message, (int) oid_len, oid_str);
|
|
1541
1564
|
} else
|
|
1542
|
-
|
|
1565
|
+
git_error_set(GIT_ERROR_ODB, "object not found - %s", message);
|
|
1543
1566
|
|
|
1544
1567
|
return GIT_ENOTFOUND;
|
|
1545
1568
|
}
|
|
1546
1569
|
|
|
1547
1570
|
static int error_null_oid(int error, const char *message)
|
|
1548
1571
|
{
|
|
1549
|
-
|
|
1572
|
+
git_error_set(GIT_ERROR_ODB, "odb: %s: null OID cannot exist", message);
|
|
1550
1573
|
return error;
|
|
1551
1574
|
}
|
|
1552
1575
|
|
|
1553
1576
|
int git_odb__error_ambiguous(const char *message)
|
|
1554
1577
|
{
|
|
1555
|
-
|
|
1578
|
+
git_error_set(GIT_ERROR_ODB, "ambiguous SHA1 prefix - %s", message);
|
|
1556
1579
|
return GIT_EAMBIGUOUS;
|
|
1557
1580
|
}
|
|
1558
1581
|
|
data/vendor/libgit2/src/odb.h
CHANGED
|
@@ -28,7 +28,7 @@ extern bool git_odb__strict_hash_verification;
|
|
|
28
28
|
typedef struct {
|
|
29
29
|
void *data; /**< Raw, decompressed object data. */
|
|
30
30
|
size_t len; /**< Total number of bytes in data. */
|
|
31
|
-
|
|
31
|
+
git_object_t type; /**< Type of this object. */
|
|
32
32
|
} git_rawobj;
|
|
33
33
|
|
|
34
34
|
/* EXPORT */
|
|
@@ -70,7 +70,8 @@ int git_odb__hashobj(git_oid *id, git_rawobj *obj);
|
|
|
70
70
|
/*
|
|
71
71
|
* Format the object header such as it would appear in the on-disk object
|
|
72
72
|
*/
|
|
73
|
-
int git_odb__format_object_header(size_t *out_len, char *hdr, size_t hdr_size,
|
|
73
|
+
int git_odb__format_object_header(size_t *out_len, char *hdr, size_t hdr_size, git_object_size_t obj_len, git_object_t obj_type);
|
|
74
|
+
|
|
74
75
|
/*
|
|
75
76
|
* Hash an open file descriptor.
|
|
76
77
|
* This is a performance call when the contents of a fd need to be hashed,
|
|
@@ -81,22 +82,22 @@ int git_odb__format_object_header(size_t *out_len, char *hdr, size_t hdr_size, g
|
|
|
81
82
|
* The fd is never closed, not even on error. It must be opened and closed
|
|
82
83
|
* by the caller
|
|
83
84
|
*/
|
|
84
|
-
int git_odb__hashfd(git_oid *out, git_file fd, size_t size,
|
|
85
|
+
int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_object_t type);
|
|
85
86
|
|
|
86
87
|
/*
|
|
87
88
|
* Hash an open file descriptor applying an array of filters
|
|
88
89
|
* Acts just like git_odb__hashfd with the addition of filters...
|
|
89
90
|
*/
|
|
90
91
|
int git_odb__hashfd_filtered(
|
|
91
|
-
git_oid *out, git_file fd, size_t len,
|
|
92
|
+
git_oid *out, git_file fd, size_t len, git_object_t type, git_filter_list *fl);
|
|
92
93
|
|
|
93
94
|
/*
|
|
94
95
|
* Hash a `path`, assuming it could be a POSIX symlink: if the path is a
|
|
95
96
|
* symlink, then the raw contents of the symlink will be hashed. Otherwise,
|
|
96
97
|
* this will fallback to `git_odb__hashfd`.
|
|
97
98
|
*
|
|
98
|
-
* The hash type for this call is always `
|
|
99
|
-
* only point to blobs.
|
|
99
|
+
* The hash type for this call is always `GIT_OBJECT_BLOB` because
|
|
100
|
+
* symlinks may only point to blobs.
|
|
100
101
|
*/
|
|
101
102
|
int git_odb__hashlink(git_oid *out, const char *path);
|
|
102
103
|
|
|
@@ -122,7 +123,7 @@ int git_odb__error_ambiguous(const char *message);
|
|
|
122
123
|
* not be read.
|
|
123
124
|
*/
|
|
124
125
|
int git_odb__read_header_or_object(
|
|
125
|
-
git_odb_object **out, size_t *len_p,
|
|
126
|
+
git_odb_object **out, size_t *len_p, git_object_t *type_p,
|
|
126
127
|
git_odb *db, const git_oid *id);
|
|
127
128
|
|
|
128
129
|
/* freshen an entry in the object database */
|