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