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
@@ -29,8 +29,8 @@
|
|
29
29
|
|
30
30
|
typedef struct git_pobject {
|
31
31
|
git_oid id;
|
32
|
-
|
33
|
-
|
32
|
+
git_otype type;
|
33
|
+
git_off_t offset;
|
34
34
|
|
35
35
|
size_t size;
|
36
36
|
|
@@ -52,6 +52,12 @@ typedef struct git_pobject {
|
|
52
52
|
filled:1;
|
53
53
|
} git_pobject;
|
54
54
|
|
55
|
+
typedef struct {
|
56
|
+
git_oid id;
|
57
|
+
unsigned int uninteresting:1,
|
58
|
+
seen:1;
|
59
|
+
} git_walk_object;
|
60
|
+
|
55
61
|
struct git_packbuilder {
|
56
62
|
git_repository *repo; /* associated repository */
|
57
63
|
git_odb *odb; /* associated object database */
|
data/vendor/libgit2/src/pack.c
CHANGED
@@ -11,23 +11,20 @@
|
|
11
11
|
#include "delta.h"
|
12
12
|
#include "sha1_lookup.h"
|
13
13
|
#include "mwindow.h"
|
14
|
-
#include "
|
14
|
+
#include "fileops.h"
|
15
15
|
#include "oid.h"
|
16
16
|
|
17
17
|
#include <zlib.h>
|
18
18
|
|
19
|
-
/* Option to bypass checking existence of '.keep' files */
|
20
|
-
bool git_disable_pack_keep_file_checks = false;
|
21
|
-
|
22
19
|
static int packfile_open(struct git_pack_file *p);
|
23
|
-
static
|
20
|
+
static git_off_t nth_packed_object_offset(const struct git_pack_file *p, uint32_t n);
|
24
21
|
static int packfile_unpack_compressed(
|
25
22
|
git_rawobj *obj,
|
26
23
|
struct git_pack_file *p,
|
27
24
|
git_mwindow **w_curs,
|
28
|
-
|
25
|
+
git_off_t *curpos,
|
29
26
|
size_t size,
|
30
|
-
|
27
|
+
git_otype type);
|
31
28
|
|
32
29
|
/* Can find the offset of an object given
|
33
30
|
* a prefix of an identifier.
|
@@ -37,7 +34,7 @@ static int packfile_unpack_compressed(
|
|
37
34
|
* GIT_OID_MINPREFIXLEN and GIT_OID_HEXSZ.
|
38
35
|
*/
|
39
36
|
static int pack_entry_find_offset(
|
40
|
-
|
37
|
+
git_off_t *offset_out,
|
41
38
|
git_oid *found_oid,
|
42
39
|
struct git_pack_file *p,
|
43
40
|
const git_oid *short_oid,
|
@@ -45,7 +42,7 @@ static int pack_entry_find_offset(
|
|
45
42
|
|
46
43
|
static int packfile_error(const char *message)
|
47
44
|
{
|
48
|
-
|
45
|
+
giterr_set(GITERR_ODB, "invalid pack file - %s", message);
|
49
46
|
return -1;
|
50
47
|
}
|
51
48
|
|
@@ -92,13 +89,13 @@ static void cache_free(git_pack_cache *cache)
|
|
92
89
|
|
93
90
|
static int cache_init(git_pack_cache *cache)
|
94
91
|
{
|
95
|
-
|
96
|
-
|
92
|
+
cache->entries = git_offmap_alloc();
|
93
|
+
GITERR_CHECK_ALLOC(cache->entries);
|
97
94
|
|
98
95
|
cache->memory_limit = GIT_PACK_CACHE_MEMORY_LIMIT;
|
99
96
|
|
100
97
|
if (git_mutex_init(&cache->lock)) {
|
101
|
-
|
98
|
+
giterr_set(GITERR_OS, "failed to initialize pack cache mutex");
|
102
99
|
|
103
100
|
git__free(cache->entries);
|
104
101
|
cache->entries = NULL;
|
@@ -109,14 +106,17 @@ static int cache_init(git_pack_cache *cache)
|
|
109
106
|
return 0;
|
110
107
|
}
|
111
108
|
|
112
|
-
static git_pack_cache_entry *cache_get(git_pack_cache *cache,
|
109
|
+
static git_pack_cache_entry *cache_get(git_pack_cache *cache, git_off_t offset)
|
113
110
|
{
|
114
|
-
|
111
|
+
khiter_t k;
|
112
|
+
git_pack_cache_entry *entry = NULL;
|
115
113
|
|
116
114
|
if (git_mutex_lock(&cache->lock) < 0)
|
117
115
|
return NULL;
|
118
116
|
|
119
|
-
|
117
|
+
k = git_offmap_lookup_index(cache->entries, offset);
|
118
|
+
if (git_offmap_valid_index(cache->entries, k)) { /* found it */
|
119
|
+
entry = git_offmap_value_at(cache->entries, k);
|
120
120
|
git_atomic_inc(&entry->refcount);
|
121
121
|
entry->last_usage = cache->use_ctr++;
|
122
122
|
}
|
@@ -128,7 +128,7 @@ static git_pack_cache_entry *cache_get(git_pack_cache *cache, off64_t offset)
|
|
128
128
|
/* Run with the cache lock held */
|
129
129
|
static void free_lowest_entry(git_pack_cache *cache)
|
130
130
|
{
|
131
|
-
|
131
|
+
git_off_t offset;
|
132
132
|
git_pack_cache_entry *entry;
|
133
133
|
|
134
134
|
git_offmap_foreach(cache->entries, offset, entry, {
|
@@ -144,10 +144,11 @@ static int cache_add(
|
|
144
144
|
git_pack_cache_entry **cached_out,
|
145
145
|
git_pack_cache *cache,
|
146
146
|
git_rawobj *base,
|
147
|
-
|
147
|
+
git_off_t offset)
|
148
148
|
{
|
149
149
|
git_pack_cache_entry *entry;
|
150
|
-
int exists;
|
150
|
+
int error, exists = 0;
|
151
|
+
khiter_t k;
|
151
152
|
|
152
153
|
if (base->len > GIT_PACK_CACHE_SIZE_LIMIT)
|
153
154
|
return -1;
|
@@ -155,7 +156,7 @@ static int cache_add(
|
|
155
156
|
entry = new_cache_object(base);
|
156
157
|
if (entry) {
|
157
158
|
if (git_mutex_lock(&cache->lock) < 0) {
|
158
|
-
|
159
|
+
giterr_set(GITERR_OS, "failed to lock cache");
|
159
160
|
git__free(entry);
|
160
161
|
return -1;
|
161
162
|
}
|
@@ -165,7 +166,9 @@ static int cache_add(
|
|
165
166
|
while (cache->memory_used + base->len > cache->memory_limit)
|
166
167
|
free_lowest_entry(cache);
|
167
168
|
|
168
|
-
|
169
|
+
k = git_offmap_put(cache->entries, offset, &error);
|
170
|
+
assert(error != 0);
|
171
|
+
git_offmap_set_value_at(cache->entries, k, entry);
|
169
172
|
cache->memory_used += entry->raw.len;
|
170
173
|
|
171
174
|
*cached_out = entry;
|
@@ -214,7 +217,7 @@ static int pack_index_check(const char *path, struct git_pack_file *p)
|
|
214
217
|
|
215
218
|
if (p_fstat(fd, &st) < 0) {
|
216
219
|
p_close(fd);
|
217
|
-
|
220
|
+
giterr_set(GITERR_OS, "unable to stat pack index '%s'", path);
|
218
221
|
return -1;
|
219
222
|
}
|
220
223
|
|
@@ -223,7 +226,7 @@ static int pack_index_check(const char *path, struct git_pack_file *p)
|
|
223
226
|
(idx_size = (size_t)st.st_size) < 4 * 256 + 20 + 20)
|
224
227
|
{
|
225
228
|
p_close(fd);
|
226
|
-
|
229
|
+
giterr_set(GITERR_ODB, "invalid pack index '%s'", path);
|
227
230
|
return -1;
|
228
231
|
}
|
229
232
|
|
@@ -323,19 +326,19 @@ static int pack_index_open(struct git_pack_file *p)
|
|
323
326
|
git_buf_put(&idx_name, p->pack_name, name_len - strlen(".pack"));
|
324
327
|
git_buf_puts(&idx_name, ".idx");
|
325
328
|
if (git_buf_oom(&idx_name)) {
|
326
|
-
|
329
|
+
git_buf_free(&idx_name);
|
327
330
|
return -1;
|
328
331
|
}
|
329
332
|
|
330
333
|
if ((error = git_mutex_lock(&p->lock)) < 0) {
|
331
|
-
|
334
|
+
git_buf_free(&idx_name);
|
332
335
|
return error;
|
333
336
|
}
|
334
337
|
|
335
338
|
if (p->index_version == -1)
|
336
339
|
error = pack_index_check(idx_name.ptr, p);
|
337
340
|
|
338
|
-
|
341
|
+
git_buf_free(&idx_name);
|
339
342
|
|
340
343
|
git_mutex_unlock(&p->lock);
|
341
344
|
|
@@ -345,7 +348,7 @@ static int pack_index_open(struct git_pack_file *p)
|
|
345
348
|
static unsigned char *pack_window_open(
|
346
349
|
struct git_pack_file *p,
|
347
350
|
git_mwindow **w_cursor,
|
348
|
-
|
351
|
+
git_off_t offset,
|
349
352
|
unsigned int *left)
|
350
353
|
{
|
351
354
|
if (p->mwf.fd == -1 && packfile_open(p) < 0)
|
@@ -375,12 +378,12 @@ static unsigned char *pack_window_open(
|
|
375
378
|
* - each byte afterwards: low seven bits are size continuation,
|
376
379
|
* with the high bit being "size continues"
|
377
380
|
*/
|
378
|
-
size_t git_packfile__object_header(unsigned char *hdr, size_t size,
|
381
|
+
size_t git_packfile__object_header(unsigned char *hdr, size_t size, git_otype type)
|
379
382
|
{
|
380
383
|
unsigned char *hdr_base;
|
381
384
|
unsigned char c;
|
382
385
|
|
383
|
-
assert(type >=
|
386
|
+
assert(type >= GIT_OBJ_COMMIT && type <= GIT_OBJ_REF_DELTA);
|
384
387
|
|
385
388
|
/* TODO: add support for chunked objects; see git.git 6c0d19b1 */
|
386
389
|
|
@@ -402,7 +405,7 @@ size_t git_packfile__object_header(unsigned char *hdr, size_t size, git_object_t
|
|
402
405
|
static int packfile_unpack_header1(
|
403
406
|
unsigned long *usedp,
|
404
407
|
size_t *sizep,
|
405
|
-
|
408
|
+
git_otype *type,
|
406
409
|
const unsigned char *buf,
|
407
410
|
unsigned long len)
|
408
411
|
{
|
@@ -416,13 +419,13 @@ static int packfile_unpack_header1(
|
|
416
419
|
shift = 4;
|
417
420
|
while (c & 0x80) {
|
418
421
|
if (len <= used) {
|
419
|
-
|
422
|
+
giterr_set(GITERR_ODB, "buffer too small");
|
420
423
|
return GIT_EBUFS;
|
421
424
|
}
|
422
425
|
|
423
426
|
if (bitsizeof(long) <= shift) {
|
424
427
|
*usedp = 0;
|
425
|
-
|
428
|
+
giterr_set(GITERR_ODB, "packfile corrupted");
|
426
429
|
return -1;
|
427
430
|
}
|
428
431
|
|
@@ -438,10 +441,10 @@ static int packfile_unpack_header1(
|
|
438
441
|
|
439
442
|
int git_packfile_unpack_header(
|
440
443
|
size_t *size_p,
|
441
|
-
|
444
|
+
git_otype *type_p,
|
442
445
|
git_mwindow_file *mwf,
|
443
446
|
git_mwindow **w_curs,
|
444
|
-
|
447
|
+
git_off_t *curpos)
|
445
448
|
{
|
446
449
|
unsigned char *base;
|
447
450
|
unsigned int left;
|
@@ -472,22 +475,22 @@ int git_packfile_unpack_header(
|
|
472
475
|
|
473
476
|
int git_packfile_resolve_header(
|
474
477
|
size_t *size_p,
|
475
|
-
|
478
|
+
git_otype *type_p,
|
476
479
|
struct git_pack_file *p,
|
477
|
-
|
480
|
+
git_off_t offset)
|
478
481
|
{
|
479
482
|
git_mwindow *w_curs = NULL;
|
480
|
-
|
483
|
+
git_off_t curpos = offset;
|
481
484
|
size_t size;
|
482
|
-
|
483
|
-
|
485
|
+
git_otype type;
|
486
|
+
git_off_t base_offset;
|
484
487
|
int error;
|
485
488
|
|
486
489
|
error = git_packfile_unpack_header(&size, &type, &p->mwf, &w_curs, &curpos);
|
487
490
|
if (error < 0)
|
488
491
|
return error;
|
489
492
|
|
490
|
-
if (type ==
|
493
|
+
if (type == GIT_OBJ_OFS_DELTA || type == GIT_OBJ_REF_DELTA) {
|
491
494
|
size_t base_size;
|
492
495
|
git_packfile_stream stream;
|
493
496
|
|
@@ -496,7 +499,7 @@ int git_packfile_resolve_header(
|
|
496
499
|
if ((error = git_packfile_stream_open(&stream, p, curpos)) < 0)
|
497
500
|
return error;
|
498
501
|
error = git_delta_read_header_fromstream(&base_size, size_p, &stream);
|
499
|
-
|
502
|
+
git_packfile_stream_free(&stream);
|
500
503
|
if (error < 0)
|
501
504
|
return error;
|
502
505
|
} else {
|
@@ -504,12 +507,12 @@ int git_packfile_resolve_header(
|
|
504
507
|
base_offset = 0;
|
505
508
|
}
|
506
509
|
|
507
|
-
while (type ==
|
510
|
+
while (type == GIT_OBJ_OFS_DELTA || type == GIT_OBJ_REF_DELTA) {
|
508
511
|
curpos = base_offset;
|
509
512
|
error = git_packfile_unpack_header(&size, &type, &p->mwf, &w_curs, &curpos);
|
510
513
|
if (error < 0)
|
511
514
|
return error;
|
512
|
-
if (type !=
|
515
|
+
if (type != GIT_OBJ_OFS_DELTA && type != GIT_OBJ_REF_DELTA)
|
513
516
|
break;
|
514
517
|
base_offset = get_delta_base(p, &w_curs, &curpos, type, base_offset);
|
515
518
|
git_mwindow_close(&w_curs);
|
@@ -528,16 +531,16 @@ int git_packfile_resolve_header(
|
|
528
531
|
* cache, we stop calculating there.
|
529
532
|
*/
|
530
533
|
static int pack_dependency_chain(git_dependency_chain *chain_out,
|
531
|
-
git_pack_cache_entry **cached_out,
|
534
|
+
git_pack_cache_entry **cached_out, git_off_t *cached_off,
|
532
535
|
struct pack_chain_elem *small_stack, size_t *stack_sz,
|
533
|
-
struct git_pack_file *p,
|
536
|
+
struct git_pack_file *p, git_off_t obj_offset)
|
534
537
|
{
|
535
538
|
git_dependency_chain chain = GIT_ARRAY_INIT;
|
536
539
|
git_mwindow *w_curs = NULL;
|
537
|
-
|
540
|
+
git_off_t curpos = obj_offset, base_offset;
|
538
541
|
int error = 0, use_heap = 0;
|
539
542
|
size_t size, elem_pos;
|
540
|
-
|
543
|
+
git_otype type;
|
541
544
|
|
542
545
|
elem_pos = 0;
|
543
546
|
while (true) {
|
@@ -554,7 +557,7 @@ static int pack_dependency_chain(git_dependency_chain *chain_out,
|
|
554
557
|
/* if we run out of space on the small stack, use the array */
|
555
558
|
if (elem_pos == SMALL_STACK_SIZE) {
|
556
559
|
git_array_init_to_size(chain, elem_pos);
|
557
|
-
|
560
|
+
GITERR_CHECK_ARRAY(chain);
|
558
561
|
memcpy(chain.ptr, small_stack, elem_pos * sizeof(struct pack_chain_elem));
|
559
562
|
chain.size = elem_pos;
|
560
563
|
use_heap = 1;
|
@@ -583,7 +586,7 @@ static int pack_dependency_chain(git_dependency_chain *chain_out,
|
|
583
586
|
elem->type = type;
|
584
587
|
elem->base_key = obj_offset;
|
585
588
|
|
586
|
-
if (type !=
|
589
|
+
if (type != GIT_OBJ_OFS_DELTA && type != GIT_OBJ_REF_DELTA)
|
587
590
|
break;
|
588
591
|
|
589
592
|
base_offset = get_delta_base(p, &w_curs, &curpos, type, obj_offset);
|
@@ -606,7 +609,7 @@ static int pack_dependency_chain(git_dependency_chain *chain_out,
|
|
606
609
|
elem_pos++;
|
607
610
|
}
|
608
611
|
|
609
|
-
|
612
|
+
|
610
613
|
*stack_sz = elem_pos + 1;
|
611
614
|
*chain_out = chain;
|
612
615
|
return error;
|
@@ -619,17 +622,17 @@ on_error:
|
|
619
622
|
int git_packfile_unpack(
|
620
623
|
git_rawobj *obj,
|
621
624
|
struct git_pack_file *p,
|
622
|
-
|
625
|
+
git_off_t *obj_offset)
|
623
626
|
{
|
624
627
|
git_mwindow *w_curs = NULL;
|
625
|
-
|
628
|
+
git_off_t curpos = *obj_offset;
|
626
629
|
int error, free_base = 0;
|
627
630
|
git_dependency_chain chain = GIT_ARRAY_INIT;
|
628
631
|
struct pack_chain_elem *elem = NULL, *stack;
|
629
632
|
git_pack_cache_entry *cached = NULL;
|
630
633
|
struct pack_chain_elem small_stack[SMALL_STACK_SIZE];
|
631
634
|
size_t stack_size = 0, elem_pos, alloclen;
|
632
|
-
|
635
|
+
git_otype base_type;
|
633
636
|
|
634
637
|
/*
|
635
638
|
* TODO: optionally check the CRC on the packfile
|
@@ -641,7 +644,7 @@ int git_packfile_unpack(
|
|
641
644
|
|
642
645
|
obj->data = NULL;
|
643
646
|
obj->len = 0;
|
644
|
-
obj->type =
|
647
|
+
obj->type = GIT_OBJ_BAD;
|
645
648
|
|
646
649
|
/* let's point to the right stack */
|
647
650
|
stack = chain.ptr ? chain.ptr : small_stack;
|
@@ -657,10 +660,10 @@ int git_packfile_unpack(
|
|
657
660
|
}
|
658
661
|
|
659
662
|
switch (base_type) {
|
660
|
-
case
|
661
|
-
case
|
662
|
-
case
|
663
|
-
case
|
663
|
+
case GIT_OBJ_COMMIT:
|
664
|
+
case GIT_OBJ_TREE:
|
665
|
+
case GIT_OBJ_BLOB:
|
666
|
+
case GIT_OBJ_TAG:
|
664
667
|
if (!cached) {
|
665
668
|
curpos = elem->offset;
|
666
669
|
error = packfile_unpack_compressed(obj, p, &w_curs, &curpos, elem->size, elem->type);
|
@@ -670,8 +673,8 @@ int git_packfile_unpack(
|
|
670
673
|
if (error < 0)
|
671
674
|
goto cleanup;
|
672
675
|
break;
|
673
|
-
case
|
674
|
-
case
|
676
|
+
case GIT_OBJ_OFS_DELTA:
|
677
|
+
case GIT_OBJ_REF_DELTA:
|
675
678
|
error = packfile_error("dependency chain ends in a delta");
|
676
679
|
goto cleanup;
|
677
680
|
default:
|
@@ -688,9 +691,9 @@ int git_packfile_unpack(
|
|
688
691
|
if (cached && stack_size == 1) {
|
689
692
|
void *data = obj->data;
|
690
693
|
|
691
|
-
|
694
|
+
GITERR_CHECK_ALLOC_ADD(&alloclen, obj->len, 1);
|
692
695
|
obj->data = git__malloc(alloclen);
|
693
|
-
|
696
|
+
GITERR_CHECK_ALLOC(obj->data);
|
694
697
|
|
695
698
|
memcpy(obj->data, data, obj->len + 1);
|
696
699
|
git_atomic_dec(&cached->refcount);
|
@@ -723,7 +726,7 @@ int git_packfile_unpack(
|
|
723
726
|
base = *obj;
|
724
727
|
obj->data = NULL;
|
725
728
|
obj->len = 0;
|
726
|
-
obj->type =
|
729
|
+
obj->type = GIT_OBJ_BAD;
|
727
730
|
|
728
731
|
error = git_delta_apply(&obj->data, &obj->len, base.data, base.len, delta.data, delta.len);
|
729
732
|
obj->type = base_type;
|
@@ -777,7 +780,7 @@ static void use_git_free(void *opaq, void *ptr)
|
|
777
780
|
git__free(ptr);
|
778
781
|
}
|
779
782
|
|
780
|
-
int git_packfile_stream_open(git_packfile_stream *obj, struct git_pack_file *p,
|
783
|
+
int git_packfile_stream_open(git_packfile_stream *obj, struct git_pack_file *p, git_off_t curpos)
|
781
784
|
{
|
782
785
|
int st;
|
783
786
|
|
@@ -790,7 +793,7 @@ int git_packfile_stream_open(git_packfile_stream *obj, struct git_pack_file *p,
|
|
790
793
|
obj->zstream.next_out = Z_NULL;
|
791
794
|
st = inflateInit(&obj->zstream);
|
792
795
|
if (st != Z_OK) {
|
793
|
-
|
796
|
+
giterr_set(GITERR_ZLIB, "failed to init packfile stream");
|
794
797
|
return -1;
|
795
798
|
}
|
796
799
|
|
@@ -821,7 +824,7 @@ ssize_t git_packfile_stream_read(git_packfile_stream *obj, void *buffer, size_t
|
|
821
824
|
written = len - obj->zstream.avail_out;
|
822
825
|
|
823
826
|
if (st != Z_OK && st != Z_STREAM_END) {
|
824
|
-
|
827
|
+
giterr_set(GITERR_ZLIB, "error reading from the zlib stream");
|
825
828
|
return -1;
|
826
829
|
}
|
827
830
|
|
@@ -837,7 +840,7 @@ ssize_t git_packfile_stream_read(git_packfile_stream *obj, void *buffer, size_t
|
|
837
840
|
|
838
841
|
}
|
839
842
|
|
840
|
-
void
|
843
|
+
void git_packfile_stream_free(git_packfile_stream *obj)
|
841
844
|
{
|
842
845
|
inflateEnd(&obj->zstream);
|
843
846
|
}
|
@@ -846,18 +849,18 @@ static int packfile_unpack_compressed(
|
|
846
849
|
git_rawobj *obj,
|
847
850
|
struct git_pack_file *p,
|
848
851
|
git_mwindow **w_curs,
|
849
|
-
|
852
|
+
git_off_t *curpos,
|
850
853
|
size_t size,
|
851
|
-
|
854
|
+
git_otype type)
|
852
855
|
{
|
853
856
|
size_t buf_size;
|
854
857
|
int st;
|
855
858
|
z_stream stream;
|
856
859
|
unsigned char *buffer, *in;
|
857
860
|
|
858
|
-
|
861
|
+
GITERR_CHECK_ALLOC_ADD(&buf_size, size, 1);
|
859
862
|
buffer = git__calloc(1, buf_size);
|
860
|
-
|
863
|
+
GITERR_CHECK_ALLOC(buffer);
|
861
864
|
|
862
865
|
memset(&stream, 0, sizeof(stream));
|
863
866
|
stream.next_out = buffer;
|
@@ -868,7 +871,7 @@ static int packfile_unpack_compressed(
|
|
868
871
|
st = inflateInit(&stream);
|
869
872
|
if (st != Z_OK) {
|
870
873
|
git__free(buffer);
|
871
|
-
|
874
|
+
giterr_set(GITERR_ZLIB, "failed to init zlib stream on unpack");
|
872
875
|
|
873
876
|
return -1;
|
874
877
|
}
|
@@ -895,7 +898,7 @@ static int packfile_unpack_compressed(
|
|
895
898
|
|
896
899
|
if ((st != Z_STREAM_END) || stream.total_out != size) {
|
897
900
|
git__free(buffer);
|
898
|
-
|
901
|
+
giterr_set(GITERR_ZLIB, "error inflating zlib stream");
|
899
902
|
return -1;
|
900
903
|
}
|
901
904
|
|
@@ -909,16 +912,16 @@ static int packfile_unpack_compressed(
|
|
909
912
|
* curpos is where the data starts, delta_obj_offset is the where the
|
910
913
|
* header starts
|
911
914
|
*/
|
912
|
-
|
915
|
+
git_off_t get_delta_base(
|
913
916
|
struct git_pack_file *p,
|
914
917
|
git_mwindow **w_curs,
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
+
git_off_t *curpos,
|
919
|
+
git_otype type,
|
920
|
+
git_off_t delta_obj_offset)
|
918
921
|
{
|
919
922
|
unsigned int left = 0;
|
920
923
|
unsigned char *base_info;
|
921
|
-
|
924
|
+
git_off_t base_offset;
|
922
925
|
git_oid unused;
|
923
926
|
|
924
927
|
base_info = pack_window_open(p, w_curs, *curpos, &left);
|
@@ -931,7 +934,7 @@ off64_t get_delta_base(
|
|
931
934
|
* that is assured. An OFS_DELTA longer than the hash size
|
932
935
|
* is stupid, as then a REF_DELTA would be smaller to store.
|
933
936
|
*/
|
934
|
-
if (type ==
|
937
|
+
if (type == GIT_OBJ_OFS_DELTA) {
|
935
938
|
unsigned used = 0;
|
936
939
|
unsigned char c = base_info[used++];
|
937
940
|
size_t unsigned_base_offset = c & 127;
|
@@ -948,16 +951,17 @@ off64_t get_delta_base(
|
|
948
951
|
return 0; /* out of bound */
|
949
952
|
base_offset = delta_obj_offset - unsigned_base_offset;
|
950
953
|
*curpos += used;
|
951
|
-
} else if (type ==
|
954
|
+
} else if (type == GIT_OBJ_REF_DELTA) {
|
952
955
|
/* If we have the cooperative cache, search in it first */
|
953
956
|
if (p->has_cache) {
|
954
|
-
|
957
|
+
khiter_t k;
|
955
958
|
git_oid oid;
|
956
959
|
|
957
960
|
git_oid_fromraw(&oid, base_info);
|
958
|
-
|
961
|
+
k = git_oidmap_lookup_index(p->idx_cache, &oid);
|
962
|
+
if (git_oidmap_valid_index(p->idx_cache, k)) {
|
959
963
|
*curpos += 20;
|
960
|
-
return
|
964
|
+
return ((struct git_pack_entry *)git_oidmap_value_at(p->idx_cache, k))->offset;
|
961
965
|
} else {
|
962
966
|
/* If we're building an index, don't try to find the pack
|
963
967
|
* entry; we just haven't seen it yet. We'll make
|
@@ -1045,7 +1049,7 @@ static int packfile_open(struct git_pack_file *p)
|
|
1045
1049
|
if (!p->mwf.size) {
|
1046
1050
|
if (!S_ISREG(st.st_mode))
|
1047
1051
|
goto cleanup;
|
1048
|
-
p->mwf.size = (
|
1052
|
+
p->mwf.size = (git_off_t)st.st_size;
|
1049
1053
|
} else if (p->mwf.size != st.st_size)
|
1050
1054
|
goto cleanup;
|
1051
1055
|
|
@@ -1083,7 +1087,7 @@ static int packfile_open(struct git_pack_file *p)
|
|
1083
1087
|
return 0;
|
1084
1088
|
|
1085
1089
|
cleanup:
|
1086
|
-
|
1090
|
+
giterr_set(GITERR_OS, "invalid packfile '%s'", p->pack_name);
|
1087
1091
|
|
1088
1092
|
if (p->mwf.fd >= 0)
|
1089
1093
|
p_close(p->mwf.fd);
|
@@ -1122,11 +1126,11 @@ int git_packfile_alloc(struct git_pack_file **pack_out, const char *path)
|
|
1122
1126
|
if (path_len < strlen(".idx"))
|
1123
1127
|
return git_odb__error_notfound("invalid packfile path", NULL, 0);
|
1124
1128
|
|
1125
|
-
|
1126
|
-
|
1129
|
+
GITERR_CHECK_ALLOC_ADD(&alloc_len, sizeof(*p), path_len);
|
1130
|
+
GITERR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, 2);
|
1127
1131
|
|
1128
1132
|
p = git__calloc(1, alloc_len);
|
1129
|
-
|
1133
|
+
GITERR_CHECK_ALLOC(p);
|
1130
1134
|
|
1131
1135
|
memcpy(p->pack_name, path, path_len + 1);
|
1132
1136
|
|
@@ -1137,11 +1141,9 @@ int git_packfile_alloc(struct git_pack_file **pack_out, const char *path)
|
|
1137
1141
|
if (git__suffixcmp(path, ".idx") == 0) {
|
1138
1142
|
size_t root_len = path_len - strlen(".idx");
|
1139
1143
|
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
p->pack_keep = 1;
|
1144
|
-
}
|
1144
|
+
memcpy(p->pack_name + root_len, ".keep", sizeof(".keep"));
|
1145
|
+
if (git_path_exists(p->pack_name) == true)
|
1146
|
+
p->pack_keep = 1;
|
1145
1147
|
|
1146
1148
|
memcpy(p->pack_name + root_len, ".pack", sizeof(".pack"));
|
1147
1149
|
}
|
@@ -1161,7 +1163,7 @@ int git_packfile_alloc(struct git_pack_file **pack_out, const char *path)
|
|
1161
1163
|
p->index_version = -1;
|
1162
1164
|
|
1163
1165
|
if (git_mutex_init(&p->lock)) {
|
1164
|
-
|
1166
|
+
giterr_set(GITERR_OS, "failed to initialize packfile mutex");
|
1165
1167
|
git__free(p);
|
1166
1168
|
return -1;
|
1167
1169
|
}
|
@@ -1182,7 +1184,7 @@ int git_packfile_alloc(struct git_pack_file **pack_out, const char *path)
|
|
1182
1184
|
*
|
1183
1185
|
***********************************************************/
|
1184
1186
|
|
1185
|
-
static
|
1187
|
+
static git_off_t nth_packed_object_offset(const struct git_pack_file *p, uint32_t n)
|
1186
1188
|
{
|
1187
1189
|
const unsigned char *index = p->index_map.data;
|
1188
1190
|
const unsigned char *end = index + p->index_map.len;
|
@@ -1264,13 +1266,13 @@ int git_pack_foreach_entry(
|
|
1264
1266
|
|
1265
1267
|
for (i = 0; i < p->num_objects; i++)
|
1266
1268
|
if ((error = cb(p->oids[i], data)) != 0)
|
1267
|
-
return
|
1269
|
+
return giterr_set_after_callback(error);
|
1268
1270
|
|
1269
1271
|
return error;
|
1270
1272
|
}
|
1271
1273
|
|
1272
1274
|
static int pack_entry_find_offset(
|
1273
|
-
|
1275
|
+
git_off_t *offset_out,
|
1274
1276
|
git_oid *found_oid,
|
1275
1277
|
struct git_pack_file *p,
|
1276
1278
|
const git_oid *short_oid,
|
@@ -1280,7 +1282,7 @@ static int pack_entry_find_offset(
|
|
1280
1282
|
const unsigned char *index;
|
1281
1283
|
unsigned hi, lo, stride;
|
1282
1284
|
int pos, found = 0;
|
1283
|
-
|
1285
|
+
git_off_t offset;
|
1284
1286
|
const unsigned char *current = 0;
|
1285
1287
|
|
1286
1288
|
*offset_out = 0;
|
@@ -1350,7 +1352,7 @@ static int pack_entry_find_offset(
|
|
1350
1352
|
return git_odb__error_ambiguous("found multiple offsets for pack entry");
|
1351
1353
|
|
1352
1354
|
if ((offset = nth_packed_object_offset(p, pos)) < 0) {
|
1353
|
-
|
1355
|
+
giterr_set(GITERR_ODB, "packfile index is corrupt");
|
1354
1356
|
return -1;
|
1355
1357
|
}
|
1356
1358
|
|
@@ -1375,7 +1377,7 @@ int git_pack_entry_find(
|
|
1375
1377
|
const git_oid *short_oid,
|
1376
1378
|
size_t len)
|
1377
1379
|
{
|
1378
|
-
|
1380
|
+
git_off_t offset;
|
1379
1381
|
git_oid found_oid;
|
1380
1382
|
int error;
|
1381
1383
|
|