rugged 1.6.3 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/rugged/rugged_allocator.c +0 -54
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/AUTHORS +1 -0
- data/vendor/libgit2/CMakeLists.txt +25 -17
- data/vendor/libgit2/COPYING +195 -1
- data/vendor/libgit2/cmake/CheckPrototypeDefinitionSafe.cmake +16 -0
- data/vendor/libgit2/cmake/{FindIconv.cmake → FindIntlIconv.cmake} +6 -0
- data/vendor/libgit2/cmake/FindLLHTTP.cmake +39 -0
- data/vendor/libgit2/cmake/SelectGSSAPI.cmake +4 -4
- data/vendor/libgit2/cmake/SelectHTTPParser.cmake +23 -8
- data/vendor/libgit2/cmake/SelectHTTPSBackend.cmake +34 -6
- data/vendor/libgit2/cmake/SelectHashes.cmake +32 -11
- data/vendor/libgit2/cmake/SelectRegex.cmake +6 -1
- data/vendor/libgit2/cmake/SelectSSH.cmake +22 -17
- data/vendor/libgit2/cmake/SelectXdiff.cmake +9 -0
- data/vendor/libgit2/cmake/SelectZlib.cmake +4 -0
- data/vendor/libgit2/deps/llhttp/CMakeLists.txt +8 -0
- data/vendor/libgit2/deps/llhttp/LICENSE-MIT +22 -0
- data/vendor/libgit2/deps/llhttp/api.c +510 -0
- data/vendor/libgit2/deps/llhttp/http.c +170 -0
- data/vendor/libgit2/deps/llhttp/llhttp.c +10168 -0
- data/vendor/libgit2/deps/llhttp/llhttp.h +897 -0
- data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +1 -1
- data/vendor/libgit2/deps/ntlmclient/crypt_builtin_md4.c +311 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +2 -1
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +0 -20
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +4 -4
- data/vendor/libgit2/deps/ntlmclient/ntlm.c +21 -21
- data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +5 -4
- data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +2 -1
- data/vendor/libgit2/deps/ntlmclient/utf8.h +1176 -721
- data/vendor/libgit2/deps/ntlmclient/util.h +11 -0
- data/vendor/libgit2/deps/pcre/CMakeLists.txt +1 -0
- data/vendor/libgit2/deps/pcre/LICENCE +5 -5
- data/vendor/libgit2/deps/pcre/pcre.h +2 -2
- data/vendor/libgit2/deps/pcre/pcre_compile.c +6 -3
- data/vendor/libgit2/deps/pcre/pcre_exec.c +2 -2
- data/vendor/libgit2/deps/xdiff/CMakeLists.txt +28 -0
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/git-xdiff.h +4 -1
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xdiffi.c +19 -18
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xdiffi.h +2 -4
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xemit.c +3 -3
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xhistogram.c +7 -18
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xmacros.h +18 -1
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xmerge.c +22 -20
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xpatience.c +21 -30
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xprepare.c +13 -30
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xutils.c +18 -1
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xutils.h +2 -1
- data/vendor/libgit2/deps/zlib/CMakeLists.txt +6 -1
- data/vendor/libgit2/deps/zlib/LICENSE +22 -0
- data/vendor/libgit2/deps/zlib/adler32.c +5 -27
- data/vendor/libgit2/deps/zlib/crc32.c +94 -167
- data/vendor/libgit2/deps/zlib/deflate.c +358 -435
- data/vendor/libgit2/deps/zlib/deflate.h +41 -10
- data/vendor/libgit2/deps/zlib/gzguts.h +13 -18
- data/vendor/libgit2/deps/zlib/infback.c +17 -30
- data/vendor/libgit2/deps/zlib/inffast.c +1 -4
- data/vendor/libgit2/deps/zlib/inffast.h +1 -1
- data/vendor/libgit2/deps/zlib/inflate.c +36 -102
- data/vendor/libgit2/deps/zlib/inftrees.c +6 -11
- data/vendor/libgit2/deps/zlib/inftrees.h +6 -6
- data/vendor/libgit2/deps/zlib/trees.c +287 -352
- data/vendor/libgit2/deps/zlib/zconf.h +23 -14
- data/vendor/libgit2/deps/zlib/zlib.h +202 -202
- data/vendor/libgit2/deps/zlib/zutil.c +18 -44
- data/vendor/libgit2/deps/zlib/zutil.h +13 -33
- data/vendor/libgit2/include/git2/annotated_commit.h +12 -5
- data/vendor/libgit2/include/git2/apply.h +27 -6
- data/vendor/libgit2/include/git2/attr.h +17 -4
- data/vendor/libgit2/include/git2/blame.h +133 -28
- data/vendor/libgit2/include/git2/blob.h +71 -28
- data/vendor/libgit2/include/git2/branch.h +22 -15
- data/vendor/libgit2/include/git2/buffer.h +6 -4
- data/vendor/libgit2/include/git2/cert.h +2 -1
- data/vendor/libgit2/include/git2/checkout.h +83 -32
- data/vendor/libgit2/include/git2/cherrypick.h +10 -3
- data/vendor/libgit2/include/git2/clone.h +25 -9
- data/vendor/libgit2/include/git2/commit.h +132 -3
- data/vendor/libgit2/include/git2/common.h +138 -56
- data/vendor/libgit2/include/git2/config.h +93 -23
- data/vendor/libgit2/include/git2/credential.h +30 -2
- data/vendor/libgit2/include/git2/credential_helpers.h +1 -0
- data/vendor/libgit2/include/git2/deprecated.h +133 -3
- data/vendor/libgit2/include/git2/describe.h +13 -1
- data/vendor/libgit2/include/git2/diff.h +77 -9
- data/vendor/libgit2/include/git2/email.h +9 -29
- data/vendor/libgit2/include/git2/errors.h +49 -74
- data/vendor/libgit2/include/git2/filter.h +14 -7
- data/vendor/libgit2/include/git2/global.h +8 -1
- data/vendor/libgit2/include/git2/graph.h +3 -2
- data/vendor/libgit2/include/git2/ignore.h +10 -0
- data/vendor/libgit2/include/git2/index.h +100 -6
- data/vendor/libgit2/include/git2/indexer.h +21 -4
- data/vendor/libgit2/include/git2/mailmap.h +7 -1
- data/vendor/libgit2/include/git2/merge.h +46 -1
- data/vendor/libgit2/include/git2/message.h +2 -2
- data/vendor/libgit2/include/git2/net.h +3 -1
- data/vendor/libgit2/include/git2/notes.h +9 -6
- data/vendor/libgit2/include/git2/object.h +9 -8
- data/vendor/libgit2/include/git2/odb.h +91 -49
- data/vendor/libgit2/include/git2/odb_backend.h +80 -52
- data/vendor/libgit2/include/git2/oid.h +24 -25
- data/vendor/libgit2/include/git2/oidarray.h +7 -1
- data/vendor/libgit2/include/git2/pack.h +13 -1
- data/vendor/libgit2/include/git2/patch.h +2 -3
- data/vendor/libgit2/include/git2/pathspec.h +9 -0
- data/vendor/libgit2/include/git2/proxy.h +10 -0
- data/vendor/libgit2/include/git2/rebase.h +9 -6
- data/vendor/libgit2/include/git2/refdb.h +2 -2
- data/vendor/libgit2/include/git2/reflog.h +3 -2
- data/vendor/libgit2/include/git2/refs.h +9 -6
- data/vendor/libgit2/include/git2/refspec.h +14 -4
- data/vendor/libgit2/include/git2/remote.h +112 -18
- data/vendor/libgit2/include/git2/repository.h +61 -15
- data/vendor/libgit2/include/git2/reset.h +16 -3
- data/vendor/libgit2/include/git2/revert.h +9 -4
- data/vendor/libgit2/include/git2/revparse.h +3 -3
- data/vendor/libgit2/include/git2/revwalk.h +3 -2
- data/vendor/libgit2/include/git2/signature.h +46 -1
- data/vendor/libgit2/include/git2/stash.h +17 -3
- data/vendor/libgit2/include/git2/status.h +10 -6
- data/vendor/libgit2/include/git2/stdint.h +87 -85
- data/vendor/libgit2/include/git2/strarray.h +2 -3
- data/vendor/libgit2/include/git2/submodule.h +20 -9
- data/vendor/libgit2/include/git2/sys/alloc.h +12 -34
- data/vendor/libgit2/include/git2/sys/commit.h +77 -3
- data/vendor/libgit2/include/git2/sys/commit_graph.h +109 -58
- data/vendor/libgit2/include/git2/sys/config.h +80 -4
- data/vendor/libgit2/include/git2/sys/credential.h +4 -3
- data/vendor/libgit2/include/git2/sys/diff.h +21 -1
- data/vendor/libgit2/include/git2/sys/email.h +7 -0
- data/vendor/libgit2/include/git2/sys/errors.h +76 -0
- data/vendor/libgit2/include/git2/sys/filter.h +66 -3
- data/vendor/libgit2/include/git2/sys/hashsig.h +11 -0
- data/vendor/libgit2/include/git2/sys/index.h +3 -2
- data/vendor/libgit2/include/git2/sys/mempack.h +32 -2
- data/vendor/libgit2/include/git2/sys/merge.h +55 -7
- data/vendor/libgit2/include/git2/sys/midx.h +47 -4
- data/vendor/libgit2/include/git2/sys/odb_backend.h +7 -3
- data/vendor/libgit2/include/git2/sys/openssl.h +8 -1
- data/vendor/libgit2/include/git2/sys/path.h +12 -1
- data/vendor/libgit2/include/git2/sys/refdb_backend.h +40 -36
- data/vendor/libgit2/include/git2/sys/refs.h +3 -2
- data/vendor/libgit2/include/git2/sys/remote.h +8 -1
- data/vendor/libgit2/include/git2/sys/repository.h +63 -3
- data/vendor/libgit2/include/git2/sys/stream.h +25 -2
- data/vendor/libgit2/include/git2/sys/transport.h +44 -5
- data/vendor/libgit2/include/git2/tag.h +3 -1
- data/vendor/libgit2/include/git2/trace.h +9 -3
- data/vendor/libgit2/include/git2/transaction.h +3 -2
- data/vendor/libgit2/include/git2/transport.h +11 -3
- data/vendor/libgit2/include/git2/tree.h +16 -5
- data/vendor/libgit2/include/git2/types.h +19 -3
- data/vendor/libgit2/include/git2/version.h +44 -8
- data/vendor/libgit2/include/git2/worktree.h +19 -7
- data/vendor/libgit2/src/CMakeLists.txt +40 -15
- data/vendor/libgit2/src/cli/CMakeLists.txt +2 -2
- data/vendor/libgit2/src/cli/cmd.c +1 -1
- data/vendor/libgit2/src/cli/cmd.h +4 -0
- data/vendor/libgit2/src/cli/cmd_blame.c +287 -0
- data/vendor/libgit2/src/cli/cmd_cat_file.c +6 -8
- data/vendor/libgit2/src/cli/cmd_clone.c +27 -13
- data/vendor/libgit2/src/cli/cmd_config.c +241 -0
- data/vendor/libgit2/src/cli/cmd_hash_object.c +6 -8
- data/vendor/libgit2/src/cli/cmd_help.c +6 -7
- data/vendor/libgit2/src/cli/cmd_index_pack.c +114 -0
- data/vendor/libgit2/src/cli/cmd_init.c +102 -0
- data/vendor/libgit2/src/cli/common.c +168 -0
- data/vendor/libgit2/src/cli/common.h +63 -0
- data/vendor/libgit2/src/cli/error.h +1 -1
- data/vendor/libgit2/src/cli/main.c +52 -24
- data/vendor/libgit2/src/cli/opt.c +29 -3
- data/vendor/libgit2/src/cli/opt.h +21 -3
- data/vendor/libgit2/src/cli/opt_usage.c +102 -33
- data/vendor/libgit2/src/cli/opt_usage.h +6 -1
- data/vendor/libgit2/src/cli/progress.c +60 -10
- data/vendor/libgit2/src/cli/progress.h +16 -4
- data/vendor/libgit2/src/cli/unix/sighandler.c +2 -1
- data/vendor/libgit2/src/cli/win32/precompiled.h +1 -1
- data/vendor/libgit2/src/cli/win32/sighandler.c +1 -1
- data/vendor/libgit2/src/libgit2/CMakeLists.txt +27 -27
- data/vendor/libgit2/src/libgit2/annotated_commit.c +2 -2
- data/vendor/libgit2/src/libgit2/annotated_commit.h +1 -1
- data/vendor/libgit2/src/libgit2/apply.c +14 -16
- data/vendor/libgit2/src/libgit2/attr.c +30 -13
- data/vendor/libgit2/src/libgit2/attr_file.c +7 -2
- data/vendor/libgit2/src/libgit2/attr_file.h +2 -0
- data/vendor/libgit2/src/libgit2/attrcache.c +69 -33
- data/vendor/libgit2/src/libgit2/attrcache.h +5 -9
- data/vendor/libgit2/src/libgit2/blame.c +152 -59
- data/vendor/libgit2/src/libgit2/blame.h +1 -0
- data/vendor/libgit2/src/libgit2/blame_git.c +0 -1
- data/vendor/libgit2/src/libgit2/branch.c +2 -2
- data/vendor/libgit2/src/libgit2/cache.c +22 -17
- data/vendor/libgit2/src/libgit2/cache.h +7 -9
- data/vendor/libgit2/src/libgit2/checkout.c +34 -24
- data/vendor/libgit2/src/libgit2/checkout.h +0 -2
- data/vendor/libgit2/src/libgit2/cherrypick.c +4 -5
- data/vendor/libgit2/src/libgit2/clone.c +186 -164
- data/vendor/libgit2/src/libgit2/clone.h +4 -1
- data/vendor/libgit2/src/libgit2/commit.c +123 -9
- data/vendor/libgit2/src/libgit2/commit_graph.c +166 -88
- data/vendor/libgit2/src/libgit2/commit_graph.h +21 -6
- data/vendor/libgit2/src/libgit2/commit_list.c +12 -5
- data/vendor/libgit2/src/libgit2/commit_list.h +1 -0
- data/vendor/libgit2/src/libgit2/config.c +394 -300
- data/vendor/libgit2/src/libgit2/config.cmake.in +3 -0
- data/vendor/libgit2/src/libgit2/config.h +9 -4
- data/vendor/libgit2/src/libgit2/config_backend.h +8 -10
- data/vendor/libgit2/src/libgit2/config_cache.c +4 -5
- data/vendor/libgit2/src/libgit2/config_file.c +113 -96
- data/vendor/libgit2/src/libgit2/config_list.c +285 -0
- data/vendor/libgit2/src/libgit2/config_list.h +32 -0
- data/vendor/libgit2/src/libgit2/config_mem.c +194 -40
- data/vendor/libgit2/src/libgit2/config_parse.c +10 -9
- data/vendor/libgit2/src/libgit2/config_snapshot.c +24 -31
- data/vendor/libgit2/src/libgit2/describe.c +34 -31
- data/vendor/libgit2/src/libgit2/diff.c +17 -8
- data/vendor/libgit2/src/libgit2/diff.h +6 -6
- data/vendor/libgit2/src/libgit2/diff_driver.c +12 -19
- data/vendor/libgit2/src/libgit2/diff_driver.h +2 -2
- data/vendor/libgit2/src/libgit2/diff_file.c +7 -7
- data/vendor/libgit2/src/libgit2/diff_generate.c +39 -18
- data/vendor/libgit2/src/libgit2/diff_parse.c +22 -6
- data/vendor/libgit2/src/libgit2/diff_print.c +88 -13
- data/vendor/libgit2/src/libgit2/diff_tform.c +40 -12
- data/vendor/libgit2/src/libgit2/diff_xdiff.h +1 -1
- data/vendor/libgit2/src/libgit2/email.c +5 -3
- data/vendor/libgit2/src/libgit2/fetch.c +39 -9
- data/vendor/libgit2/src/libgit2/fetch.h +0 -2
- data/vendor/libgit2/src/libgit2/fetchhead.c +11 -9
- data/vendor/libgit2/src/libgit2/filter.c +5 -5
- data/vendor/libgit2/src/libgit2/git2.rc +3 -3
- data/vendor/libgit2/src/libgit2/grafts.c +270 -0
- data/vendor/libgit2/src/libgit2/grafts.h +35 -0
- data/vendor/libgit2/src/libgit2/graph.c +1 -1
- data/vendor/libgit2/src/libgit2/hashmap_oid.h +30 -0
- data/vendor/libgit2/src/libgit2/ident.c +3 -3
- data/vendor/libgit2/src/libgit2/ignore.c +9 -5
- data/vendor/libgit2/src/libgit2/index.c +392 -208
- data/vendor/libgit2/src/libgit2/index.h +16 -3
- data/vendor/libgit2/src/libgit2/index_map.c +95 -0
- data/vendor/libgit2/src/libgit2/index_map.h +28 -0
- data/vendor/libgit2/src/libgit2/indexer.c +44 -41
- data/vendor/libgit2/src/libgit2/iterator.c +34 -13
- data/vendor/libgit2/src/libgit2/iterator.h +3 -0
- data/vendor/libgit2/src/libgit2/libgit2.c +155 -331
- data/vendor/libgit2/src/libgit2/mailmap.c +1 -1
- data/vendor/libgit2/src/libgit2/merge.c +56 -46
- data/vendor/libgit2/src/libgit2/merge_driver.c +2 -2
- data/vendor/libgit2/src/libgit2/merge_file.c +0 -2
- data/vendor/libgit2/src/libgit2/midx.c +86 -44
- data/vendor/libgit2/src/libgit2/midx.h +13 -3
- data/vendor/libgit2/src/libgit2/mwindow.c +38 -45
- data/vendor/libgit2/src/libgit2/mwindow.h +4 -0
- data/vendor/libgit2/src/libgit2/notes.c +9 -8
- data/vendor/libgit2/src/libgit2/object.c +42 -16
- data/vendor/libgit2/src/libgit2/object.h +6 -0
- data/vendor/libgit2/src/libgit2/odb.c +16 -9
- data/vendor/libgit2/src/libgit2/odb_mempack.c +49 -17
- data/vendor/libgit2/src/libgit2/odb_pack.c +28 -7
- data/vendor/libgit2/src/libgit2/oid.c +35 -2
- data/vendor/libgit2/src/libgit2/oid.h +11 -0
- data/vendor/libgit2/src/libgit2/oidarray.c +49 -3
- data/vendor/libgit2/src/libgit2/oidarray.h +5 -1
- data/vendor/libgit2/src/libgit2/pack-objects.c +77 -43
- data/vendor/libgit2/src/libgit2/pack-objects.h +17 -6
- data/vendor/libgit2/src/libgit2/pack.c +33 -27
- data/vendor/libgit2/src/libgit2/pack.h +15 -10
- data/vendor/libgit2/src/libgit2/parse.c +7 -4
- data/vendor/libgit2/src/libgit2/parse.h +1 -1
- data/vendor/libgit2/src/libgit2/patch.h +7 -1
- data/vendor/libgit2/src/libgit2/patch_generate.c +24 -5
- data/vendor/libgit2/src/libgit2/patch_parse.c +18 -10
- data/vendor/libgit2/src/libgit2/path.c +1 -1
- data/vendor/libgit2/src/libgit2/pathspec.c +1 -1
- data/vendor/libgit2/src/libgit2/push.c +81 -30
- data/vendor/libgit2/src/libgit2/push.h +1 -0
- data/vendor/libgit2/src/libgit2/reader.c +1 -1
- data/vendor/libgit2/src/libgit2/rebase.c +72 -84
- data/vendor/libgit2/src/libgit2/refdb_fs.c +146 -70
- data/vendor/libgit2/src/libgit2/reflog.c +1 -2
- data/vendor/libgit2/src/libgit2/reflog.h +2 -0
- data/vendor/libgit2/src/libgit2/refs.c +34 -8
- data/vendor/libgit2/src/libgit2/refs.h +6 -1
- data/vendor/libgit2/src/libgit2/refspec.c +28 -1
- data/vendor/libgit2/src/libgit2/refspec.h +8 -0
- data/vendor/libgit2/src/libgit2/remote.c +136 -67
- data/vendor/libgit2/src/libgit2/remote.h +1 -0
- data/vendor/libgit2/src/libgit2/repository.c +789 -330
- data/vendor/libgit2/src/libgit2/repository.h +22 -3
- data/vendor/libgit2/src/libgit2/reset.c +2 -2
- data/vendor/libgit2/src/libgit2/revert.c +9 -13
- data/vendor/libgit2/src/libgit2/revparse.c +6 -3
- data/vendor/libgit2/src/libgit2/revwalk.c +36 -11
- data/vendor/libgit2/src/libgit2/revwalk.h +3 -3
- data/vendor/libgit2/src/libgit2/settings.c +468 -0
- data/vendor/libgit2/src/libgit2/settings.h +6 -2
- data/vendor/libgit2/src/libgit2/signature.c +132 -15
- data/vendor/libgit2/src/libgit2/signature.h +0 -1
- data/vendor/libgit2/src/libgit2/stash.c +9 -8
- data/vendor/libgit2/src/libgit2/status.c +1 -1
- data/vendor/libgit2/src/libgit2/streams/mbedtls.c +54 -61
- data/vendor/libgit2/src/libgit2/streams/openssl.c +40 -23
- data/vendor/libgit2/src/libgit2/streams/openssl.h +2 -0
- data/vendor/libgit2/src/libgit2/streams/openssl_dynamic.c +4 -0
- data/vendor/libgit2/src/libgit2/streams/openssl_dynamic.h +3 -0
- data/vendor/libgit2/src/libgit2/streams/schannel.c +715 -0
- data/vendor/libgit2/src/libgit2/streams/schannel.h +28 -0
- data/vendor/libgit2/src/libgit2/streams/socket.c +237 -51
- data/vendor/libgit2/src/libgit2/streams/socket.h +3 -1
- data/vendor/libgit2/src/libgit2/streams/stransport.c +79 -19
- data/vendor/libgit2/src/libgit2/streams/tls.c +5 -0
- data/vendor/libgit2/src/libgit2/submodule.c +106 -63
- data/vendor/libgit2/src/libgit2/submodule.h +9 -10
- data/vendor/libgit2/src/libgit2/tag.c +1 -1
- data/vendor/libgit2/src/libgit2/trailer.c +6 -6
- data/vendor/libgit2/src/libgit2/transaction.c +26 -20
- data/vendor/libgit2/src/libgit2/transaction.h +4 -1
- data/vendor/libgit2/src/libgit2/transport.c +4 -1
- data/vendor/libgit2/src/libgit2/transports/auth.h +1 -2
- data/vendor/libgit2/src/libgit2/transports/{auth_negotiate.c → auth_gssapi.c} +32 -32
- data/vendor/libgit2/src/libgit2/transports/auth_negotiate.h +1 -1
- data/vendor/libgit2/src/libgit2/transports/auth_ntlm.h +1 -1
- data/vendor/libgit2/src/libgit2/transports/{auth_ntlm.c → auth_ntlmclient.c} +12 -12
- data/vendor/libgit2/src/libgit2/transports/auth_sspi.c +341 -0
- data/vendor/libgit2/src/libgit2/transports/credential.c +1 -1
- data/vendor/libgit2/src/libgit2/transports/git.c +7 -8
- data/vendor/libgit2/src/libgit2/transports/http.c +8 -4
- data/vendor/libgit2/src/libgit2/transports/http.h +0 -10
- data/vendor/libgit2/src/libgit2/transports/httpclient.c +117 -72
- data/vendor/libgit2/src/libgit2/transports/httpparser.c +128 -0
- data/vendor/libgit2/src/libgit2/transports/httpparser.h +99 -0
- data/vendor/libgit2/src/libgit2/transports/local.c +21 -11
- data/vendor/libgit2/src/libgit2/transports/smart.c +50 -32
- data/vendor/libgit2/src/libgit2/transports/smart.h +26 -9
- data/vendor/libgit2/src/libgit2/transports/smart_pkt.c +139 -18
- data/vendor/libgit2/src/libgit2/transports/smart_protocol.c +209 -57
- data/vendor/libgit2/src/libgit2/transports/ssh.c +41 -1103
- data/vendor/libgit2/src/libgit2/transports/ssh_exec.c +347 -0
- data/vendor/libgit2/src/libgit2/transports/ssh_exec.h +26 -0
- data/vendor/libgit2/src/libgit2/transports/ssh_libssh2.c +1126 -0
- data/vendor/libgit2/src/libgit2/transports/ssh_libssh2.h +28 -0
- data/vendor/libgit2/src/libgit2/transports/winhttp.c +48 -21
- data/vendor/libgit2/src/libgit2/tree-cache.c +26 -16
- data/vendor/libgit2/src/libgit2/tree-cache.h +5 -3
- data/vendor/libgit2/src/libgit2/tree.c +35 -27
- data/vendor/libgit2/src/libgit2/tree.h +3 -2
- data/vendor/libgit2/src/libgit2/worktree.c +39 -27
- data/vendor/libgit2/src/util/CMakeLists.txt +4 -6
- data/vendor/libgit2/src/util/alloc.c +69 -7
- data/vendor/libgit2/src/util/alloc.h +34 -9
- data/vendor/libgit2/src/util/allocators/debugalloc.c +73 -0
- data/vendor/libgit2/src/{cli/cli.h → util/allocators/debugalloc.h} +6 -9
- data/vendor/libgit2/src/util/allocators/failalloc.c +0 -60
- data/vendor/libgit2/src/util/allocators/failalloc.h +0 -6
- data/vendor/libgit2/src/util/allocators/stdalloc.c +2 -115
- data/vendor/libgit2/src/util/allocators/win32_leakcheck.c +0 -68
- data/vendor/libgit2/src/util/array.h +24 -18
- data/vendor/libgit2/src/util/cc-compat.h +4 -0
- data/vendor/libgit2/src/util/ctype_compat.h +70 -0
- data/vendor/libgit2/src/util/date.c +22 -14
- data/vendor/libgit2/src/util/date.h +12 -0
- data/vendor/libgit2/src/util/errors.c +401 -0
- data/vendor/libgit2/src/{libgit2 → util}/errors.h +21 -17
- data/vendor/libgit2/src/util/filebuf.c +6 -1
- data/vendor/libgit2/src/util/filebuf.h +19 -6
- data/vendor/libgit2/src/util/fs_path.c +16 -5
- data/vendor/libgit2/src/util/fs_path.h +23 -0
- data/vendor/libgit2/src/util/futils.c +14 -10
- data/vendor/libgit2/src/util/futils.h +13 -4
- data/vendor/libgit2/src/util/git2_features.h.in +21 -4
- data/vendor/libgit2/src/util/git2_util.h +6 -0
- data/vendor/libgit2/src/util/hash/openssl.c +152 -0
- data/vendor/libgit2/src/util/hash/openssl.h +17 -1
- data/vendor/libgit2/src/util/hash/sha.h +4 -1
- data/vendor/libgit2/src/util/hashmap.h +424 -0
- data/vendor/libgit2/src/util/hashmap_str.h +43 -0
- data/vendor/libgit2/src/util/integer.h +3 -1
- data/vendor/libgit2/src/util/net.c +318 -161
- data/vendor/libgit2/src/util/net.h +27 -0
- data/vendor/libgit2/src/util/pool.c +1 -1
- data/vendor/libgit2/src/util/pool.h +5 -0
- data/vendor/libgit2/src/util/posix.c +54 -0
- data/vendor/libgit2/src/util/posix.h +22 -0
- data/vendor/libgit2/src/util/pqueue.h +1 -1
- data/vendor/libgit2/src/util/process.h +222 -0
- data/vendor/libgit2/src/util/rand.c +6 -10
- data/vendor/libgit2/src/util/regexp.c +1 -1
- data/vendor/libgit2/src/util/sortedcache.c +14 -13
- data/vendor/libgit2/src/util/sortedcache.h +3 -3
- data/vendor/libgit2/src/util/staticstr.h +66 -0
- data/vendor/libgit2/src/util/str.c +2 -2
- data/vendor/libgit2/src/util/strlist.c +108 -0
- data/vendor/libgit2/src/util/strlist.h +36 -0
- data/vendor/libgit2/src/util/unix/posix.h +0 -2
- data/vendor/libgit2/src/util/unix/process.c +629 -0
- data/vendor/libgit2/src/util/unix/realpath.c +23 -5
- data/vendor/libgit2/src/util/util.c +17 -12
- data/vendor/libgit2/src/util/util.h +28 -54
- data/vendor/libgit2/src/util/vector.c +3 -3
- data/vendor/libgit2/src/util/vector.h +2 -2
- data/vendor/libgit2/src/util/win32/error.c +1 -1
- data/vendor/libgit2/src/util/win32/path_w32.c +8 -8
- data/vendor/libgit2/src/util/win32/posix_w32.c +30 -7
- data/vendor/libgit2/src/util/win32/process.c +506 -0
- data/vendor/libgit2/src/util/win32/utf-conv.c +73 -75
- data/vendor/libgit2/src/util/win32/utf-conv.h +81 -14
- data/vendor/libgit2/src/util/win32/w32_util.c +1 -1
- metadata +72 -49
- data/vendor/libgit2/cmake/SelectWinHTTP.cmake +0 -17
- data/vendor/libgit2/deps/http-parser/CMakeLists.txt +0 -6
- data/vendor/libgit2/deps/http-parser/COPYING +0 -23
- data/vendor/libgit2/deps/http-parser/http_parser.c +0 -2182
- data/vendor/libgit2/deps/http-parser/http_parser.h +0 -305
- data/vendor/libgit2/deps/zlib/COPYING +0 -27
- data/vendor/libgit2/include/git2/sys/reflog.h +0 -21
- data/vendor/libgit2/src/libgit2/config_entries.c +0 -237
- data/vendor/libgit2/src/libgit2/config_entries.h +0 -24
- data/vendor/libgit2/src/libgit2/errors.c +0 -238
- data/vendor/libgit2/src/libgit2/idxmap.c +0 -157
- data/vendor/libgit2/src/libgit2/idxmap.h +0 -177
- data/vendor/libgit2/src/libgit2/libgit2.h +0 -15
- data/vendor/libgit2/src/libgit2/netops.c +0 -124
- data/vendor/libgit2/src/libgit2/netops.h +0 -68
- data/vendor/libgit2/src/libgit2/offmap.c +0 -101
- data/vendor/libgit2/src/libgit2/offmap.h +0 -133
- data/vendor/libgit2/src/libgit2/oidmap.c +0 -107
- data/vendor/libgit2/src/libgit2/oidmap.h +0 -128
- data/vendor/libgit2/src/libgit2/threadstate.c +0 -84
- data/vendor/libgit2/src/libgit2/threadstate.h +0 -24
- data/vendor/libgit2/src/libgit2/transports/ssh.h +0 -14
- data/vendor/libgit2/src/util/khash.h +0 -615
- data/vendor/libgit2/src/util/strmap.c +0 -100
- data/vendor/libgit2/src/util/strmap.h +0 -131
- /data/vendor/libgit2/cmake/{FindHTTPParser.cmake → FindHTTP_Parser.cmake} +0 -0
- /data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xdiff.h +0 -0
- /data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xemit.h +0 -0
- /data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xinclude.h +0 -0
- /data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xprepare.h +0 -0
- /data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xtypes.h +0 -0
@@ -12,8 +12,8 @@
|
|
12
12
|
#include "futils.h"
|
13
13
|
#include "filebuf.h"
|
14
14
|
#include "vector.h"
|
15
|
-
#include "idxmap.h"
|
16
15
|
#include "tree-cache.h"
|
16
|
+
#include "index_map.h"
|
17
17
|
#include "git2/odb.h"
|
18
18
|
#include "git2/index.h"
|
19
19
|
|
@@ -27,14 +27,16 @@ struct git_index {
|
|
27
27
|
|
28
28
|
char *index_file_path;
|
29
29
|
git_futils_filestamp stamp;
|
30
|
-
unsigned char checksum[
|
30
|
+
unsigned char checksum[GIT_HASH_MAX_SIZE];
|
31
31
|
|
32
32
|
git_vector entries;
|
33
|
-
|
33
|
+
git_index_entrymap entries_map;
|
34
34
|
|
35
35
|
git_vector deleted; /* deleted entries if readers > 0 */
|
36
36
|
git_atomic32 readers; /* number of active iterators */
|
37
37
|
|
38
|
+
git_oid_t oid_type;
|
39
|
+
|
38
40
|
unsigned int on_disk:1;
|
39
41
|
unsigned int ignore_case:1;
|
40
42
|
unsigned int distrust_filemode:1;
|
@@ -141,6 +143,17 @@ GIT_INLINE(unsigned char *) git_index__checksum(git_index *index)
|
|
141
143
|
return index->checksum;
|
142
144
|
}
|
143
145
|
|
146
|
+
/* SHA256-aware internal functions */
|
147
|
+
|
148
|
+
extern int git_index__new(
|
149
|
+
git_index **index_out,
|
150
|
+
git_oid_t oid_type);
|
151
|
+
|
152
|
+
extern int git_index__open(
|
153
|
+
git_index **index_out,
|
154
|
+
const char *index_path,
|
155
|
+
git_oid_t oid_type);
|
156
|
+
|
144
157
|
/* Copy the current entries vector *and* increment the index refcount.
|
145
158
|
* Call `git_index__release_snapshot` when done.
|
146
159
|
*/
|
@@ -0,0 +1,95 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
|
+
*
|
4
|
+
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
|
+
* a Linking Exception. For full terms see the included COPYING file.
|
6
|
+
*/
|
7
|
+
|
8
|
+
#include "common.h"
|
9
|
+
#include "hashmap.h"
|
10
|
+
#include "index_map.h"
|
11
|
+
|
12
|
+
typedef git_index_entrymap git_index_entrymap_default;
|
13
|
+
typedef git_index_entrymap git_index_entrymap_icase;
|
14
|
+
|
15
|
+
/* This is __ac_X31_hash_string but with tolower and it takes the entry's stage into account */
|
16
|
+
GIT_INLINE(uint32_t) git_index_entrymap_hash(const git_index_entry *e)
|
17
|
+
{
|
18
|
+
const char *s = e->path;
|
19
|
+
uint32_t h = (uint32_t)git__tolower(*s);
|
20
|
+
if (h) {
|
21
|
+
for (++s ; *s; ++s)
|
22
|
+
h = (h << 5) - h + (uint32_t)git__tolower(*s);
|
23
|
+
}
|
24
|
+
return h + GIT_INDEX_ENTRY_STAGE(e);
|
25
|
+
}
|
26
|
+
|
27
|
+
#define git_index_entrymap_equal_default(a, b) (GIT_INDEX_ENTRY_STAGE(a) == GIT_INDEX_ENTRY_STAGE(b) && strcmp(a->path, b->path) == 0)
|
28
|
+
#define git_index_entrymap_equal_icase(a, b) (GIT_INDEX_ENTRY_STAGE(a) == GIT_INDEX_ENTRY_STAGE(b) && strcasecmp(a->path, b->path) == 0)
|
29
|
+
|
30
|
+
GIT_HASHMAP_FUNCTIONS(git_index_entrymap_default, GIT_HASHMAP_INLINE, git_index_entry *, git_index_entry *, git_index_entrymap_hash, git_index_entrymap_equal_default)
|
31
|
+
GIT_HASHMAP_FUNCTIONS(git_index_entrymap_icase, GIT_HASHMAP_INLINE, git_index_entry *, git_index_entry *, git_index_entrymap_hash, git_index_entrymap_equal_icase)
|
32
|
+
|
33
|
+
int git_index_entrymap_put(git_index_entrymap *map, git_index_entry *e)
|
34
|
+
{
|
35
|
+
if (map->ignore_case)
|
36
|
+
return git_index_entrymap_icase_put((git_index_entrymap_icase *)map, e, e);
|
37
|
+
else
|
38
|
+
return git_index_entrymap_default_put((git_index_entrymap_default *)map, e, e);
|
39
|
+
}
|
40
|
+
|
41
|
+
int git_index_entrymap_get(git_index_entry **out, git_index_entrymap *map, git_index_entry *e)
|
42
|
+
{
|
43
|
+
if (map->ignore_case)
|
44
|
+
return git_index_entrymap_icase_get(out, (git_index_entrymap_icase *)map, e);
|
45
|
+
else
|
46
|
+
return git_index_entrymap_default_get(out, (git_index_entrymap_default *)map, e);
|
47
|
+
}
|
48
|
+
|
49
|
+
int git_index_entrymap_remove(git_index_entrymap *map, git_index_entry *e)
|
50
|
+
{
|
51
|
+
if (map->ignore_case)
|
52
|
+
return git_index_entrymap_icase_remove((git_index_entrymap_icase *)map, e);
|
53
|
+
else
|
54
|
+
return git_index_entrymap_default_remove((git_index_entrymap_default *)map, e);
|
55
|
+
}
|
56
|
+
|
57
|
+
int git_index_entrymap_resize(git_index_entrymap *map, size_t count)
|
58
|
+
{
|
59
|
+
if (count > UINT32_MAX) {
|
60
|
+
git_error_set(GIT_ERROR_INDEX, "index map is out of bounds");
|
61
|
+
return -1;
|
62
|
+
}
|
63
|
+
|
64
|
+
if (map->ignore_case)
|
65
|
+
return git_index_entrymap_icase__resize((git_index_entrymap_icase *)map, (uint32_t)count);
|
66
|
+
else
|
67
|
+
return git_index_entrymap_default__resize((git_index_entrymap_default *)map, (uint32_t)count);
|
68
|
+
}
|
69
|
+
|
70
|
+
void git_index_entrymap_swap(git_index_entrymap *a, git_index_entrymap *b)
|
71
|
+
{
|
72
|
+
git_index_entrymap t;
|
73
|
+
|
74
|
+
if (a != b) {
|
75
|
+
memcpy(&t, a, sizeof(t));
|
76
|
+
memcpy(a, b, sizeof(t));
|
77
|
+
memcpy(b, &t, sizeof(t));
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
void git_index_entrymap_clear(git_index_entrymap *map)
|
82
|
+
{
|
83
|
+
if (map->ignore_case)
|
84
|
+
git_index_entrymap_icase_clear((git_index_entrymap_icase *)map);
|
85
|
+
else
|
86
|
+
git_index_entrymap_default_clear((git_index_entrymap_default *)map);
|
87
|
+
}
|
88
|
+
|
89
|
+
void git_index_entrymap_dispose(git_index_entrymap *map)
|
90
|
+
{
|
91
|
+
if (map->ignore_case)
|
92
|
+
git_index_entrymap_icase_dispose((git_index_entrymap_icase *)map);
|
93
|
+
else
|
94
|
+
git_index_entrymap_default_dispose((git_index_entrymap_default *)map);
|
95
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
|
+
*
|
4
|
+
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
|
+
* a Linking Exception. For full terms see the included COPYING file.
|
6
|
+
*/
|
7
|
+
#ifndef INCLUDE_index_map_h__
|
8
|
+
#define INCLUDE_index_map_h__
|
9
|
+
|
10
|
+
#include "common.h"
|
11
|
+
#include "hashmap.h"
|
12
|
+
|
13
|
+
typedef struct {
|
14
|
+
unsigned int ignore_case;
|
15
|
+
GIT_HASHMAP_STRUCT_MEMBERS(git_index_entry *, git_index_entry *)
|
16
|
+
} git_index_entrymap;
|
17
|
+
|
18
|
+
#define GIT_INDEX_ENTRYMAP_INIT { 0 }
|
19
|
+
|
20
|
+
extern int git_index_entrymap_get(git_index_entry **out, git_index_entrymap *map, git_index_entry *e);
|
21
|
+
extern int git_index_entrymap_put(git_index_entrymap *map, git_index_entry *e);
|
22
|
+
extern int git_index_entrymap_remove(git_index_entrymap *map, git_index_entry *e);
|
23
|
+
extern int git_index_entrymap_resize(git_index_entrymap *map, size_t count);
|
24
|
+
extern void git_index_entrymap_swap(git_index_entrymap *a, git_index_entrymap *b);
|
25
|
+
extern void git_index_entrymap_clear(git_index_entrymap *map);
|
26
|
+
extern void git_index_entrymap_dispose(git_index_entrymap *map);
|
27
|
+
|
28
|
+
#endif
|
@@ -20,14 +20,16 @@
|
|
20
20
|
#include "filebuf.h"
|
21
21
|
#include "oid.h"
|
22
22
|
#include "oidarray.h"
|
23
|
-
#include "oidmap.h"
|
24
23
|
#include "zstream.h"
|
25
24
|
#include "object.h"
|
25
|
+
#include "hashmap_oid.h"
|
26
26
|
|
27
27
|
size_t git_indexer__max_objects = UINT32_MAX;
|
28
28
|
|
29
29
|
#define UINT31_MAX (0x7FFFFFFF)
|
30
30
|
|
31
|
+
GIT_HASHMAP_OID_SETUP(git_indexer_oidmap, git_oid *);
|
32
|
+
|
31
33
|
struct entry {
|
32
34
|
git_oid oid;
|
33
35
|
uint32_t crc;
|
@@ -63,7 +65,7 @@ struct git_indexer {
|
|
63
65
|
char objbuf[8*1024];
|
64
66
|
|
65
67
|
/* OIDs referenced from pack objects. Used for verification. */
|
66
|
-
|
68
|
+
git_indexer_oidmap expected_oids;
|
67
69
|
|
68
70
|
/* Needed to look up objects which we want to inject to fix a thin pack */
|
69
71
|
git_odb *odb;
|
@@ -169,9 +171,12 @@ static int indexer_new(
|
|
169
171
|
if (in_opts)
|
170
172
|
memcpy(&opts, in_opts, sizeof(opts));
|
171
173
|
|
174
|
+
if (oid_type)
|
175
|
+
GIT_ASSERT_ARG(git_oid_type_is_valid(oid_type));
|
176
|
+
|
172
177
|
idx = git__calloc(1, sizeof(git_indexer));
|
173
178
|
GIT_ERROR_CHECK_ALLOC(idx);
|
174
|
-
idx->oid_type = oid_type;
|
179
|
+
idx->oid_type = oid_type ? oid_type : GIT_OID_DEFAULT;
|
175
180
|
idx->odb = odb;
|
176
181
|
idx->progress_cb = opts.progress_cb;
|
177
182
|
idx->progress_payload = opts.progress_cb_payload;
|
@@ -181,8 +186,7 @@ static int indexer_new(
|
|
181
186
|
checksum_type = indexer_hash_algorithm(idx);
|
182
187
|
|
183
188
|
if ((error = git_hash_ctx_init(&idx->hash_ctx, checksum_type)) < 0 ||
|
184
|
-
(error = git_hash_ctx_init(&idx->trailer, checksum_type)) < 0
|
185
|
-
(error = git_oidmap_new(&idx->expected_oids)) < 0)
|
189
|
+
(error = git_hash_ctx_init(&idx->trailer, checksum_type)) < 0)
|
186
190
|
goto cleanup;
|
187
191
|
|
188
192
|
idx->do_verify = opts.verify;
|
@@ -232,13 +236,12 @@ cleanup:
|
|
232
236
|
int git_indexer_new(
|
233
237
|
git_indexer **out,
|
234
238
|
const char *prefix,
|
235
|
-
git_oid_t oid_type,
|
236
239
|
git_indexer_options *opts)
|
237
240
|
{
|
238
241
|
return indexer_new(
|
239
242
|
out,
|
240
243
|
prefix,
|
241
|
-
oid_type,
|
244
|
+
opts ? opts->oid_type : 0,
|
242
245
|
opts ? opts->mode : 0,
|
243
246
|
opts ? opts->odb : NULL,
|
244
247
|
opts);
|
@@ -380,12 +383,12 @@ static int add_expected_oid(git_indexer *idx, const git_oid *oid)
|
|
380
383
|
* not have to expect it.
|
381
384
|
*/
|
382
385
|
if ((!idx->odb || !git_odb_exists(idx->odb, oid)) &&
|
383
|
-
!
|
384
|
-
!
|
386
|
+
!git_pack_oidmap_contains(&idx->pack->idx_cache, oid) &&
|
387
|
+
!git_indexer_oidmap_contains(&idx->expected_oids, oid)) {
|
385
388
|
git_oid *dup = git__malloc(sizeof(*oid));
|
386
389
|
GIT_ERROR_CHECK_ALLOC(dup);
|
387
390
|
git_oid_cpy(dup, oid);
|
388
|
-
return
|
391
|
+
return git_indexer_oidmap_put(&idx->expected_oids, dup, dup);
|
389
392
|
}
|
390
393
|
|
391
394
|
return 0;
|
@@ -412,8 +415,8 @@ static int check_object_connectivity(git_indexer *idx, const git_rawobj *obj)
|
|
412
415
|
goto out;
|
413
416
|
}
|
414
417
|
|
415
|
-
if ((expected
|
416
|
-
|
418
|
+
if (git_indexer_oidmap_get(&expected, &idx->expected_oids, &object->cached.oid) == 0) {
|
419
|
+
git_indexer_oidmap_remove(&idx->expected_oids, &object->cached.oid);
|
417
420
|
git__free(expected);
|
418
421
|
}
|
419
422
|
|
@@ -518,13 +521,19 @@ static int store_object(git_indexer *idx)
|
|
518
521
|
git_oid_cpy(&pentry->id, &oid);
|
519
522
|
pentry->offset = entry_start;
|
520
523
|
|
521
|
-
if (
|
522
|
-
|
524
|
+
if (git_pack_oidmap_contains(&idx->pack->idx_cache, &pentry->id)) {
|
525
|
+
const char *idstr = git_oid_tostr_s(&pentry->id);
|
526
|
+
|
527
|
+
if (!idstr)
|
528
|
+
git_error_set(GIT_ERROR_INDEXER, "failed to parse object id");
|
529
|
+
else
|
530
|
+
git_error_set(GIT_ERROR_INDEXER, "duplicate object %s found in pack", idstr);
|
531
|
+
|
523
532
|
git__free(pentry);
|
524
533
|
goto on_error;
|
525
534
|
}
|
526
535
|
|
527
|
-
if ((error =
|
536
|
+
if ((error = git_pack_oidmap_put(&idx->pack->idx_cache, &pentry->id, pentry)) < 0) {
|
528
537
|
git__free(pentry);
|
529
538
|
git_error_set_oom();
|
530
539
|
goto on_error;
|
@@ -553,7 +562,7 @@ on_error:
|
|
553
562
|
|
554
563
|
GIT_INLINE(bool) has_entry(git_indexer *idx, git_oid *id)
|
555
564
|
{
|
556
|
-
return
|
565
|
+
return git_pack_oidmap_contains(&idx->pack->idx_cache, id);
|
557
566
|
}
|
558
567
|
|
559
568
|
static int save_entry(git_indexer *idx, struct entry *entry, struct git_pack_entry *pentry, off64_t entry_start)
|
@@ -569,8 +578,8 @@ static int save_entry(git_indexer *idx, struct entry *entry, struct git_pack_ent
|
|
569
578
|
|
570
579
|
pentry->offset = entry_start;
|
571
580
|
|
572
|
-
if (
|
573
|
-
|
581
|
+
if (git_pack_oidmap_contains(&idx->pack->idx_cache, &pentry->id) ||
|
582
|
+
git_pack_oidmap_put(&idx->pack->idx_cache, &pentry->id, pentry) < 0) {
|
574
583
|
git_error_set(GIT_ERROR_INDEXER, "cannot insert object into pack");
|
575
584
|
return -1;
|
576
585
|
}
|
@@ -905,9 +914,6 @@ int git_indexer_append(git_indexer *idx, const void *data, size_t size, git_inde
|
|
905
914
|
return -1;
|
906
915
|
}
|
907
916
|
|
908
|
-
if (git_oidmap_new(&idx->pack->idx_cache) < 0)
|
909
|
-
return -1;
|
910
|
-
|
911
917
|
idx->pack->has_cache = 1;
|
912
918
|
if (git_vector_init(&idx->objects, total_objects, objects_cmp) < 0)
|
913
919
|
return -1;
|
@@ -1232,6 +1238,7 @@ int git_indexer_commit(git_indexer *idx, git_indexer_progress *stats)
|
|
1232
1238
|
git_filebuf index_file = {0};
|
1233
1239
|
void *packfile_trailer;
|
1234
1240
|
size_t checksum_size;
|
1241
|
+
int filebuf_hash;
|
1235
1242
|
bool mismatch;
|
1236
1243
|
|
1237
1244
|
if (!idx->parsed_header) {
|
@@ -1240,6 +1247,7 @@ int git_indexer_commit(git_indexer *idx, git_indexer_progress *stats)
|
|
1240
1247
|
}
|
1241
1248
|
|
1242
1249
|
checksum_size = git_hash_size(indexer_hash_algorithm(idx));
|
1250
|
+
filebuf_hash = git_filebuf_hash_flags(indexer_hash_algorithm(idx));
|
1243
1251
|
GIT_ASSERT(checksum_size);
|
1244
1252
|
|
1245
1253
|
/* Test for this before resolve_deltas(), as it plays with idx->off */
|
@@ -1293,9 +1301,9 @@ int git_indexer_commit(git_indexer *idx, git_indexer_progress *stats)
|
|
1293
1301
|
* bail out due to an incomplete and thus corrupt
|
1294
1302
|
* packfile.
|
1295
1303
|
*/
|
1296
|
-
if (
|
1304
|
+
if (git_indexer_oidmap_size(&idx->expected_oids) > 0) {
|
1297
1305
|
git_error_set(GIT_ERROR_INDEXER, "packfile is missing %"PRIuZ" objects",
|
1298
|
-
|
1306
|
+
(size_t)git_indexer_oidmap_size(&idx->expected_oids));
|
1299
1307
|
return -1;
|
1300
1308
|
}
|
1301
1309
|
|
@@ -1314,8 +1322,7 @@ int git_indexer_commit(git_indexer *idx, git_indexer_progress *stats)
|
|
1314
1322
|
return -1;
|
1315
1323
|
|
1316
1324
|
if (git_filebuf_open(&index_file, filename.ptr,
|
1317
|
-
|
1318
|
-
(idx->do_fsync ? GIT_FILEBUF_FSYNC : 0),
|
1325
|
+
filebuf_hash | (idx->do_fsync ? GIT_FILEBUF_FSYNC : 0),
|
1319
1326
|
idx->mode) < 0)
|
1320
1327
|
goto on_error;
|
1321
1328
|
|
@@ -1439,9 +1446,9 @@ on_error:
|
|
1439
1446
|
|
1440
1447
|
void git_indexer_free(git_indexer *idx)
|
1441
1448
|
{
|
1442
|
-
|
1443
|
-
git_oid *
|
1444
|
-
|
1449
|
+
struct git_pack_entry *pentry;
|
1450
|
+
git_oid *id;
|
1451
|
+
git_hashmap_iter_t iter = GIT_HASHMAP_ITER_INIT;
|
1445
1452
|
|
1446
1453
|
if (idx == NULL)
|
1447
1454
|
return;
|
@@ -1449,28 +1456,24 @@ void git_indexer_free(git_indexer *idx)
|
|
1449
1456
|
if (idx->have_stream)
|
1450
1457
|
git_packfile_stream_dispose(&idx->stream);
|
1451
1458
|
|
1452
|
-
|
1459
|
+
git_vector_dispose_deep(&idx->objects);
|
1453
1460
|
|
1454
|
-
|
1455
|
-
|
1456
|
-
git_oidmap_foreach_value(idx->pack->idx_cache, pentry, {
|
1457
|
-
git__free(pentry);
|
1458
|
-
});
|
1461
|
+
while (git_pack_oidmap_iterate(&iter, NULL, &pentry, &idx->pack->idx_cache) == 0)
|
1462
|
+
git__free(pentry);
|
1459
1463
|
|
1460
|
-
|
1461
|
-
}
|
1464
|
+
git_pack_oidmap_dispose(&idx->pack->idx_cache);
|
1462
1465
|
|
1463
|
-
|
1466
|
+
git_vector_dispose_deep(&idx->deltas);
|
1464
1467
|
|
1465
1468
|
git_packfile_free(idx->pack, !idx->pack_committed);
|
1466
1469
|
|
1467
|
-
iter =
|
1468
|
-
while (
|
1469
|
-
git__free(
|
1470
|
+
iter = GIT_HASHMAP_ITER_INIT;
|
1471
|
+
while (git_indexer_oidmap_iterate(&iter, NULL, &id, &idx->expected_oids) == 0)
|
1472
|
+
git__free(id);
|
1470
1473
|
|
1471
1474
|
git_hash_ctx_cleanup(&idx->trailer);
|
1472
1475
|
git_hash_ctx_cleanup(&idx->hash_ctx);
|
1473
1476
|
git_str_dispose(&idx->entry_data);
|
1474
|
-
|
1477
|
+
git_indexer_oidmap_dispose(&idx->expected_oids);
|
1475
1478
|
git__free(idx);
|
1476
1479
|
}
|
@@ -26,9 +26,10 @@
|
|
26
26
|
#define iterator__ignore_dot_git(I) iterator__flag(I,IGNORE_DOT_GIT)
|
27
27
|
#define iterator__descend_symlinks(I) iterator__flag(I,DESCEND_SYMLINKS)
|
28
28
|
|
29
|
-
|
30
29
|
static void iterator_set_ignore_case(git_iterator *iter, bool ignore_case)
|
31
30
|
{
|
31
|
+
int (*vector_cmp)(const void *a, const void *b);
|
32
|
+
|
32
33
|
if (ignore_case)
|
33
34
|
iter->flags |= GIT_ITERATOR_IGNORE_CASE;
|
34
35
|
else
|
@@ -39,7 +40,9 @@ static void iterator_set_ignore_case(git_iterator *iter, bool ignore_case)
|
|
39
40
|
iter->prefixcomp = ignore_case ? git__prefixcmp_icase : git__prefixcmp;
|
40
41
|
iter->entry_srch = ignore_case ? git_index_entry_isrch : git_index_entry_srch;
|
41
42
|
|
42
|
-
|
43
|
+
vector_cmp = ignore_case ? git__strcasecmp_cb : git__strcmp_cb;
|
44
|
+
|
45
|
+
git_vector_set_cmp(&iter->pathlist, vector_cmp);
|
43
46
|
}
|
44
47
|
|
45
48
|
static int iterator_range_init(
|
@@ -299,6 +302,7 @@ typedef enum {
|
|
299
302
|
static iterator_pathlist_search_t iterator_pathlist_search(
|
300
303
|
git_iterator *iter, const char *path, size_t path_len)
|
301
304
|
{
|
305
|
+
int (*vector_cmp)(const void *a, const void *b);
|
302
306
|
const char *p;
|
303
307
|
size_t idx;
|
304
308
|
int error;
|
@@ -308,8 +312,10 @@ static iterator_pathlist_search_t iterator_pathlist_search(
|
|
308
312
|
|
309
313
|
git_vector_sort(&iter->pathlist);
|
310
314
|
|
311
|
-
|
312
|
-
|
315
|
+
vector_cmp = (iter->flags & GIT_ITERATOR_IGNORE_CASE) != 0 ?
|
316
|
+
git__strcasecmp_cb : git__strcmp_cb;
|
317
|
+
|
318
|
+
error = git_vector_bsearch2(&idx, &iter->pathlist, vector_cmp, path);
|
313
319
|
|
314
320
|
/* the given path was found in the pathlist. since the pathlist only
|
315
321
|
* matches directories when they're suffixed with a '/', analyze the
|
@@ -690,7 +696,7 @@ static int tree_iterator_frame_pop(tree_iterator *iter)
|
|
690
696
|
|
691
697
|
frame = git_array_pop(iter->frames);
|
692
698
|
|
693
|
-
|
699
|
+
git_vector_dispose(&frame->entries);
|
694
700
|
git_tree_free(frame->tree);
|
695
701
|
|
696
702
|
do {
|
@@ -703,7 +709,7 @@ static int tree_iterator_frame_pop(tree_iterator *iter)
|
|
703
709
|
git_vector_foreach(&frame->similar_trees, i, tree)
|
704
710
|
git_tree_free(tree);
|
705
711
|
|
706
|
-
|
712
|
+
git_vector_dispose(&frame->similar_trees);
|
707
713
|
|
708
714
|
git_str_dispose(&frame->path);
|
709
715
|
|
@@ -1036,6 +1042,8 @@ typedef struct {
|
|
1036
1042
|
git_index *index;
|
1037
1043
|
git_vector index_snapshot;
|
1038
1044
|
|
1045
|
+
git_oid_t oid_type;
|
1046
|
+
|
1039
1047
|
git_array_t(filesystem_iterator_frame) frames;
|
1040
1048
|
git_ignores ignores;
|
1041
1049
|
|
@@ -1271,7 +1279,7 @@ static int filesystem_iterator_entry_hash(
|
|
1271
1279
|
int error;
|
1272
1280
|
|
1273
1281
|
if (S_ISDIR(entry->st.st_mode)) {
|
1274
|
-
memset(&entry->id, 0,
|
1282
|
+
memset(&entry->id, 0, git_oid_size(iter->oid_type));
|
1275
1283
|
return 0;
|
1276
1284
|
}
|
1277
1285
|
|
@@ -1281,7 +1289,7 @@ static int filesystem_iterator_entry_hash(
|
|
1281
1289
|
|
1282
1290
|
if (!(error = git_str_joinpath(&fullpath, iter->root, entry->path)) &&
|
1283
1291
|
!(error = git_path_validate_str_length(iter->base.repo, &fullpath)))
|
1284
|
-
error = git_odb__hashfile(&entry->id, fullpath.ptr, GIT_OBJECT_BLOB,
|
1292
|
+
error = git_odb__hashfile(&entry->id, fullpath.ptr, GIT_OBJECT_BLOB, iter->oid_type);
|
1285
1293
|
|
1286
1294
|
git_str_dispose(&fullpath);
|
1287
1295
|
return error;
|
@@ -1493,7 +1501,7 @@ GIT_INLINE(int) filesystem_iterator_frame_pop(filesystem_iterator *iter)
|
|
1493
1501
|
filesystem_iterator_frame_pop_ignores(iter);
|
1494
1502
|
|
1495
1503
|
git_pool_clear(&frame->entry_pool);
|
1496
|
-
|
1504
|
+
git_vector_dispose(&frame->entries);
|
1497
1505
|
|
1498
1506
|
return 0;
|
1499
1507
|
}
|
@@ -1530,7 +1538,7 @@ static void filesystem_iterator_set_current(
|
|
1530
1538
|
if (iter->base.flags & GIT_ITERATOR_INCLUDE_HASH)
|
1531
1539
|
git_oid_cpy(&iter->entry.id, &entry->id);
|
1532
1540
|
else
|
1533
|
-
git_oid_clear(&iter->entry.id,
|
1541
|
+
git_oid_clear(&iter->entry.id, iter->oid_type);
|
1534
1542
|
|
1535
1543
|
iter->entry.path = entry->path;
|
1536
1544
|
|
@@ -1975,6 +1983,8 @@ static int iterator_for_filesystem(
|
|
1975
1983
|
(iterator__flag(&iter->base, PRECOMPOSE_UNICODE) ?
|
1976
1984
|
GIT_FS_PATH_DIR_PRECOMPOSE_UNICODE : 0);
|
1977
1985
|
|
1986
|
+
iter->oid_type = options->oid_type;
|
1987
|
+
|
1978
1988
|
if ((error = filesystem_iterator_init(iter)) < 0)
|
1979
1989
|
goto on_error;
|
1980
1990
|
|
@@ -1989,10 +1999,15 @@ on_error:
|
|
1989
1999
|
int git_iterator_for_filesystem(
|
1990
2000
|
git_iterator **out,
|
1991
2001
|
const char *root,
|
1992
|
-
git_iterator_options *
|
2002
|
+
git_iterator_options *given_opts)
|
1993
2003
|
{
|
2004
|
+
git_iterator_options options = GIT_ITERATOR_OPTIONS_INIT;
|
2005
|
+
|
2006
|
+
if (given_opts)
|
2007
|
+
memcpy(&options, given_opts, sizeof(git_iterator_options));
|
2008
|
+
|
1994
2009
|
return iterator_for_filesystem(out,
|
1995
|
-
NULL, root, NULL, NULL, GIT_ITERATOR_FS, options);
|
2010
|
+
NULL, root, NULL, NULL, GIT_ITERATOR_FS, &options);
|
1996
2011
|
}
|
1997
2012
|
|
1998
2013
|
int git_iterator_for_workdir_ext(
|
@@ -2019,6 +2034,12 @@ int git_iterator_for_workdir_ext(
|
|
2019
2034
|
options.flags |= GIT_ITERATOR_HONOR_IGNORES |
|
2020
2035
|
GIT_ITERATOR_IGNORE_DOT_GIT;
|
2021
2036
|
|
2037
|
+
if (!options.oid_type)
|
2038
|
+
options.oid_type = repo->oid_type;
|
2039
|
+
else if (options.oid_type != repo->oid_type)
|
2040
|
+
git_error_set(GIT_ERROR_INVALID,
|
2041
|
+
"specified object ID type does not match repository object ID type");
|
2042
|
+
|
2022
2043
|
return iterator_for_filesystem(out,
|
2023
2044
|
repo, repo_workdir, index, tree, GIT_ITERATOR_WORKDIR, &options);
|
2024
2045
|
}
|
@@ -2315,7 +2336,7 @@ void git_iterator_free(git_iterator *iter)
|
|
2315
2336
|
|
2316
2337
|
iter->cb->free(iter);
|
2317
2338
|
|
2318
|
-
|
2339
|
+
git_vector_dispose(&iter->pathlist);
|
2319
2340
|
git__free(iter->start);
|
2320
2341
|
git__free(iter->end);
|
2321
2342
|
|