rugged 0.28.4.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/ext/rugged/extconf.rb +3 -1
- data/ext/rugged/rugged.c +35 -31
- data/ext/rugged/rugged.h +13 -0
- data/ext/rugged/rugged_blob.c +11 -9
- data/ext/rugged/rugged_commit.c +18 -16
- data/ext/rugged/rugged_config.c +1 -1
- data/ext/rugged/rugged_diff.c +4 -26
- data/ext/rugged/rugged_index.c +4 -2
- data/ext/rugged/rugged_note.c +5 -3
- data/ext/rugged/rugged_object.c +57 -10
- data/ext/rugged/rugged_rebase.c +3 -1
- data/ext/rugged/rugged_remote.c +32 -8
- data/ext/rugged/rugged_repo.c +232 -17
- data/ext/rugged/rugged_tag.c +8 -6
- data/ext/rugged/rugged_tree.c +18 -16
- data/lib/rugged/commit.rb +17 -4
- data/lib/rugged/repository.rb +5 -6
- data/lib/rugged/submodule_collection.rb +4 -4
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/AUTHORS +1 -0
- data/vendor/libgit2/CMakeLists.txt +57 -75
- data/vendor/libgit2/COPYING +28 -0
- data/vendor/libgit2/cmake/{Modules/AddCFlagIfSupported.cmake → AddCFlagIfSupported.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/EnableWarnings.cmake → EnableWarnings.cmake} +5 -1
- data/vendor/libgit2/cmake/{Modules/FindCoreFoundation.cmake → FindCoreFoundation.cmake} +2 -2
- data/vendor/libgit2/cmake/{Modules/FindGSSAPI.cmake → FindGSSAPI.cmake} +1 -1
- data/vendor/libgit2/cmake/FindGSSFramework.cmake +28 -0
- data/vendor/libgit2/cmake/{Modules/FindHTTP_Parser.cmake → FindHTTP_Parser.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindIconv.cmake → FindIconv.cmake} +0 -0
- data/vendor/libgit2/cmake/FindPCRE.cmake +38 -0
- data/vendor/libgit2/cmake/FindPCRE2.cmake +37 -0
- data/vendor/libgit2/cmake/{Modules/FindPkgLibraries.cmake → FindPkgLibraries.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindSecurity.cmake → FindSecurity.cmake} +2 -2
- data/vendor/libgit2/cmake/{Modules/FindStatNsec.cmake → FindStatNsec.cmake} +6 -0
- data/vendor/libgit2/cmake/{Modules/FindmbedTLS.cmake → FindmbedTLS.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/IdeSplitSources.cmake → IdeSplitSources.cmake} +0 -0
- data/vendor/libgit2/cmake/PkgBuildConfig.cmake +77 -0
- data/vendor/libgit2/cmake/SanitizeBool.cmake +20 -0
- data/vendor/libgit2/cmake/SelectGSSAPI.cmake +48 -0
- data/vendor/libgit2/cmake/SelectHTTPSBackend.cmake +120 -0
- data/vendor/libgit2/cmake/SelectHashes.cmake +61 -0
- data/vendor/libgit2/deps/http-parser/CMakeLists.txt +4 -3
- data/vendor/libgit2/deps/http-parser/http_parser.c +11 -6
- data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +24 -0
- data/vendor/libgit2/deps/ntlmclient/compat.h +62 -0
- data/vendor/libgit2/deps/ntlmclient/crypt.h +64 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +120 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +18 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +145 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +18 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +130 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +21 -0
- data/vendor/libgit2/deps/ntlmclient/ntlm.c +1419 -0
- data/vendor/libgit2/deps/ntlmclient/ntlm.h +174 -0
- data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +320 -0
- data/vendor/libgit2/deps/ntlmclient/unicode.h +36 -0
- data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +445 -0
- data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +201 -0
- data/vendor/libgit2/deps/ntlmclient/utf8.h +1257 -0
- data/vendor/libgit2/deps/ntlmclient/util.c +21 -0
- data/vendor/libgit2/deps/ntlmclient/util.h +14 -0
- data/vendor/libgit2/deps/pcre/CMakeLists.txt +140 -0
- data/vendor/libgit2/deps/pcre/COPYING +5 -0
- data/vendor/libgit2/deps/pcre/LICENCE +93 -0
- data/vendor/libgit2/deps/pcre/cmake/COPYING-CMAKE-SCRIPTS +22 -0
- data/vendor/libgit2/deps/pcre/cmake/FindEditline.cmake +17 -0
- data/vendor/libgit2/deps/pcre/cmake/FindPackageHandleStandardArgs.cmake +58 -0
- data/vendor/libgit2/deps/pcre/cmake/FindReadline.cmake +29 -0
- data/vendor/libgit2/deps/pcre/config.h.in +57 -0
- data/vendor/libgit2/deps/pcre/pcre.h +641 -0
- data/vendor/libgit2/deps/pcre/pcre_byte_order.c +319 -0
- data/vendor/libgit2/deps/pcre/pcre_chartables.c +198 -0
- data/vendor/libgit2/deps/pcre/pcre_compile.c +9812 -0
- data/vendor/libgit2/deps/pcre/pcre_config.c +190 -0
- data/vendor/libgit2/deps/pcre/pcre_dfa_exec.c +3676 -0
- data/vendor/libgit2/deps/pcre/pcre_exec.c +7173 -0
- data/vendor/libgit2/deps/pcre/pcre_fullinfo.c +245 -0
- data/vendor/libgit2/deps/pcre/pcre_get.c +669 -0
- data/vendor/libgit2/deps/pcre/pcre_globals.c +86 -0
- data/vendor/libgit2/deps/pcre/pcre_internal.h +2787 -0
- data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +11913 -0
- data/vendor/libgit2/deps/pcre/pcre_maketables.c +156 -0
- data/vendor/libgit2/deps/pcre/pcre_newline.c +210 -0
- data/vendor/libgit2/deps/pcre/pcre_ord2utf8.c +94 -0
- data/vendor/libgit2/deps/pcre/pcre_printint.c +834 -0
- data/vendor/libgit2/deps/pcre/pcre_refcount.c +92 -0
- data/vendor/libgit2/deps/pcre/pcre_string_utils.c +211 -0
- data/vendor/libgit2/deps/pcre/pcre_study.c +1686 -0
- data/vendor/libgit2/deps/pcre/pcre_tables.c +727 -0
- data/vendor/libgit2/deps/pcre/pcre_ucd.c +3644 -0
- data/vendor/libgit2/deps/pcre/pcre_valid_utf8.c +301 -0
- data/vendor/libgit2/deps/pcre/pcre_version.c +98 -0
- data/vendor/libgit2/deps/pcre/pcre_xclass.c +268 -0
- data/vendor/libgit2/deps/pcre/pcreposix.c +420 -0
- data/vendor/libgit2/deps/pcre/pcreposix.h +117 -0
- data/vendor/libgit2/deps/pcre/ucp.h +224 -0
- data/vendor/libgit2/deps/zlib/CMakeLists.txt +6 -5
- data/vendor/libgit2/deps/zlib/adler32.c +0 -7
- data/vendor/libgit2/deps/zlib/crc32.c +0 -7
- data/vendor/libgit2/deps/zlib/deflate.c +1 -0
- data/vendor/libgit2/include/git2.h +2 -0
- data/vendor/libgit2/include/git2/annotated_commit.h +1 -1
- data/vendor/libgit2/include/git2/apply.h +22 -2
- data/vendor/libgit2/include/git2/attr.h +23 -13
- data/vendor/libgit2/include/git2/blame.h +4 -2
- data/vendor/libgit2/include/git2/blob.h +44 -12
- data/vendor/libgit2/include/git2/branch.h +74 -57
- data/vendor/libgit2/include/git2/buffer.h +20 -14
- data/vendor/libgit2/include/git2/cert.h +135 -0
- data/vendor/libgit2/include/git2/checkout.h +46 -14
- data/vendor/libgit2/include/git2/cherrypick.h +3 -3
- data/vendor/libgit2/include/git2/clone.h +2 -2
- data/vendor/libgit2/include/git2/commit.h +23 -1
- data/vendor/libgit2/include/git2/common.h +29 -8
- data/vendor/libgit2/include/git2/config.h +12 -12
- data/vendor/libgit2/include/git2/cred_helpers.h +4 -42
- data/vendor/libgit2/include/git2/credential.h +314 -0
- data/vendor/libgit2/include/git2/credential_helpers.h +52 -0
- data/vendor/libgit2/include/git2/deprecated.h +362 -4
- data/vendor/libgit2/include/git2/describe.h +4 -4
- data/vendor/libgit2/include/git2/diff.h +16 -14
- data/vendor/libgit2/include/git2/errors.h +5 -2
- data/vendor/libgit2/include/git2/filter.h +8 -0
- data/vendor/libgit2/include/git2/index.h +3 -3
- data/vendor/libgit2/include/git2/indexer.h +48 -4
- data/vendor/libgit2/include/git2/merge.h +6 -10
- data/vendor/libgit2/include/git2/net.h +0 -5
- data/vendor/libgit2/include/git2/object.h +2 -14
- data/vendor/libgit2/include/git2/odb.h +3 -2
- data/vendor/libgit2/include/git2/odb_backend.h +5 -4
- data/vendor/libgit2/include/git2/oid.h +11 -6
- data/vendor/libgit2/include/git2/pack.h +13 -2
- data/vendor/libgit2/include/git2/proxy.h +6 -4
- data/vendor/libgit2/include/git2/rebase.h +46 -2
- data/vendor/libgit2/include/git2/refs.h +19 -0
- data/vendor/libgit2/include/git2/remote.h +40 -15
- data/vendor/libgit2/include/git2/repository.h +29 -6
- data/vendor/libgit2/include/git2/revert.h +1 -1
- data/vendor/libgit2/include/git2/revwalk.h +7 -3
- data/vendor/libgit2/include/git2/stash.h +4 -4
- data/vendor/libgit2/include/git2/status.h +25 -16
- data/vendor/libgit2/include/git2/strarray.h +6 -10
- data/vendor/libgit2/include/git2/submodule.h +20 -3
- data/vendor/libgit2/include/git2/sys/alloc.h +9 -9
- data/vendor/libgit2/include/git2/sys/cred.h +15 -0
- data/vendor/libgit2/include/git2/sys/credential.h +90 -0
- data/vendor/libgit2/include/git2/sys/index.h +4 -2
- data/vendor/libgit2/include/git2/sys/mempack.h +2 -1
- data/vendor/libgit2/include/git2/sys/merge.h +1 -1
- data/vendor/libgit2/include/git2/sys/odb_backend.h +48 -4
- data/vendor/libgit2/include/git2/sys/refdb_backend.h +164 -21
- data/vendor/libgit2/include/git2/sys/repository.h +17 -6
- data/vendor/libgit2/include/git2/sys/transport.h +4 -4
- data/vendor/libgit2/include/git2/tag.h +11 -2
- data/vendor/libgit2/include/git2/trace.h +2 -2
- data/vendor/libgit2/include/git2/transport.h +11 -340
- data/vendor/libgit2/include/git2/tree.h +5 -3
- data/vendor/libgit2/include/git2/types.h +4 -89
- data/vendor/libgit2/include/git2/version.h +5 -5
- data/vendor/libgit2/include/git2/worktree.h +5 -5
- data/vendor/libgit2/src/CMakeLists.txt +147 -272
- data/vendor/libgit2/src/alloc.c +2 -14
- data/vendor/libgit2/src/{stdalloc.c → allocators/stdalloc.c} +3 -4
- data/vendor/libgit2/src/{stdalloc.h → allocators/stdalloc.h} +4 -4
- data/vendor/libgit2/src/allocators/win32_crtdbg.c +118 -0
- data/vendor/libgit2/src/{transports/cred.h → allocators/win32_crtdbg.h} +5 -4
- data/vendor/libgit2/src/apply.c +65 -31
- data/vendor/libgit2/src/assert_safe.h +58 -0
- data/vendor/libgit2/src/attr.c +70 -64
- data/vendor/libgit2/src/attr_file.c +197 -99
- data/vendor/libgit2/src/attr_file.h +9 -9
- data/vendor/libgit2/src/attrcache.c +49 -50
- data/vendor/libgit2/src/attrcache.h +2 -1
- data/vendor/libgit2/src/blame.c +19 -5
- data/vendor/libgit2/src/blame.h +1 -1
- data/vendor/libgit2/src/blame_git.c +27 -10
- data/vendor/libgit2/src/blob.c +83 -17
- data/vendor/libgit2/src/blob.h +2 -2
- data/vendor/libgit2/src/branch.c +68 -42
- data/vendor/libgit2/src/buffer.c +25 -10
- data/vendor/libgit2/src/buffer.h +1 -0
- data/vendor/libgit2/src/cache.c +34 -58
- data/vendor/libgit2/src/cache.h +1 -1
- data/vendor/libgit2/src/cc-compat.h +5 -0
- data/vendor/libgit2/src/checkout.c +73 -86
- data/vendor/libgit2/src/cherrypick.c +11 -3
- data/vendor/libgit2/src/clone.c +107 -25
- data/vendor/libgit2/src/clone.h +4 -0
- data/vendor/libgit2/src/commit.c +70 -22
- data/vendor/libgit2/src/commit.h +6 -0
- data/vendor/libgit2/src/commit_list.c +28 -76
- data/vendor/libgit2/src/commit_list.h +2 -2
- data/vendor/libgit2/src/common.h +4 -75
- data/vendor/libgit2/src/config.c +34 -47
- data/vendor/libgit2/src/config.h +7 -6
- data/vendor/libgit2/src/config_backend.h +12 -0
- data/vendor/libgit2/src/config_cache.c +39 -39
- data/vendor/libgit2/src/config_entries.c +76 -98
- data/vendor/libgit2/src/config_entries.h +1 -0
- data/vendor/libgit2/src/config_file.c +346 -380
- data/vendor/libgit2/src/config_mem.c +12 -16
- data/vendor/libgit2/src/config_parse.c +50 -30
- data/vendor/libgit2/src/config_parse.h +13 -12
- data/vendor/libgit2/src/config_snapshot.c +207 -0
- data/vendor/libgit2/src/crlf.c +14 -14
- data/vendor/libgit2/src/describe.c +26 -21
- data/vendor/libgit2/src/diff.c +53 -67
- data/vendor/libgit2/src/diff.h +4 -3
- data/vendor/libgit2/src/diff_driver.c +37 -38
- data/vendor/libgit2/src/diff_file.c +15 -11
- data/vendor/libgit2/src/diff_file.h +2 -2
- data/vendor/libgit2/src/diff_generate.c +158 -109
- data/vendor/libgit2/src/diff_generate.h +2 -2
- data/vendor/libgit2/src/diff_parse.c +3 -4
- data/vendor/libgit2/src/diff_print.c +86 -71
- data/vendor/libgit2/src/diff_stats.c +13 -12
- data/vendor/libgit2/src/diff_tform.c +13 -14
- data/vendor/libgit2/src/errors.c +23 -25
- data/vendor/libgit2/src/errors.h +81 -0
- data/vendor/libgit2/src/features.h.in +9 -2
- data/vendor/libgit2/src/fetch.c +9 -2
- data/vendor/libgit2/src/fetchhead.c +36 -4
- data/vendor/libgit2/src/filebuf.c +6 -10
- data/vendor/libgit2/src/filebuf.h +2 -2
- data/vendor/libgit2/src/filter.c +19 -11
- data/vendor/libgit2/src/{fileops.c → futils.c} +24 -20
- data/vendor/libgit2/src/{fileops.h → futils.h} +8 -8
- data/vendor/libgit2/src/global.c +15 -41
- data/vendor/libgit2/src/global.h +0 -2
- data/vendor/libgit2/src/hash.c +61 -0
- data/vendor/libgit2/src/hash.h +19 -21
- data/vendor/libgit2/src/hash/sha1.h +38 -0
- data/vendor/libgit2/src/hash/{hash_collisiondetect.h → sha1/collisiondetect.c} +14 -17
- data/vendor/libgit2/src/{sha1_lookup.h → hash/sha1/collisiondetect.h} +8 -8
- data/vendor/libgit2/src/hash/{hash_common_crypto.h → sha1/common_crypto.c} +15 -19
- data/vendor/libgit2/src/hash/sha1/common_crypto.h +19 -0
- data/vendor/libgit2/src/hash/{hash_generic.c → sha1/generic.c} +22 -10
- data/vendor/libgit2/src/hash/{hash_generic.h → sha1/generic.h} +4 -14
- data/vendor/libgit2/src/hash/{hash_mbedtls.c → sha1/mbedtls.c} +15 -7
- data/vendor/libgit2/src/hash/{hash_mbedtls.h → sha1/mbedtls.h} +6 -11
- data/vendor/libgit2/src/hash/{hash_openssl.h → sha1/openssl.c} +14 -18
- data/vendor/libgit2/src/{refdb_fs.h → hash/sha1/openssl.h} +8 -8
- data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.c +14 -3
- data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.h +0 -0
- data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.c +0 -0
- data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.h +0 -0
- data/vendor/libgit2/src/hash/{hash_win32.c → sha1/win32.c} +34 -24
- data/vendor/libgit2/src/hash/{hash_win32.h → sha1/win32.h} +6 -19
- data/vendor/libgit2/src/hashsig.c +1 -1
- data/vendor/libgit2/src/idxmap.c +73 -69
- data/vendor/libgit2/src/idxmap.h +151 -15
- data/vendor/libgit2/src/ignore.c +32 -38
- data/vendor/libgit2/src/index.c +117 -90
- data/vendor/libgit2/src/index.h +1 -1
- data/vendor/libgit2/src/indexer.c +80 -75
- data/vendor/libgit2/src/integer.h +39 -4
- data/vendor/libgit2/src/iterator.c +44 -39
- data/vendor/libgit2/src/iterator.h +8 -8
- data/vendor/libgit2/src/map.h +1 -1
- data/vendor/libgit2/src/merge.c +91 -58
- data/vendor/libgit2/src/merge.h +2 -2
- data/vendor/libgit2/src/merge_driver.c +5 -5
- data/vendor/libgit2/src/merge_file.c +5 -7
- data/vendor/libgit2/src/midx.c +418 -0
- data/vendor/libgit2/src/midx.h +83 -0
- data/vendor/libgit2/src/mwindow.c +142 -74
- data/vendor/libgit2/src/mwindow.h +4 -4
- data/vendor/libgit2/src/net.c +416 -0
- data/vendor/libgit2/src/net.h +57 -0
- data/vendor/libgit2/src/netops.c +6 -193
- data/vendor/libgit2/src/netops.h +1 -34
- data/vendor/libgit2/src/notes.c +8 -5
- data/vendor/libgit2/src/object.c +5 -4
- data/vendor/libgit2/src/object.h +2 -0
- data/vendor/libgit2/src/odb.c +50 -29
- data/vendor/libgit2/src/odb.h +3 -2
- data/vendor/libgit2/src/odb_loose.c +20 -13
- data/vendor/libgit2/src/odb_mempack.c +15 -24
- data/vendor/libgit2/src/odb_pack.c +4 -5
- data/vendor/libgit2/src/offmap.c +43 -55
- data/vendor/libgit2/src/offmap.h +102 -24
- data/vendor/libgit2/src/oid.c +21 -8
- data/vendor/libgit2/src/oidmap.c +39 -57
- data/vendor/libgit2/src/oidmap.h +99 -19
- data/vendor/libgit2/src/pack-objects.c +55 -52
- data/vendor/libgit2/src/pack-objects.h +1 -1
- data/vendor/libgit2/src/pack.c +154 -147
- data/vendor/libgit2/src/pack.h +32 -18
- data/vendor/libgit2/src/parse.c +10 -0
- data/vendor/libgit2/src/parse.h +3 -3
- data/vendor/libgit2/src/patch.c +1 -1
- data/vendor/libgit2/src/patch_generate.c +3 -5
- data/vendor/libgit2/src/patch_parse.c +134 -35
- data/vendor/libgit2/src/path.c +47 -10
- data/vendor/libgit2/src/path.h +2 -0
- data/vendor/libgit2/src/pathspec.c +18 -17
- data/vendor/libgit2/src/pool.c +42 -32
- data/vendor/libgit2/src/pool.h +15 -7
- data/vendor/libgit2/src/posix.c +7 -7
- data/vendor/libgit2/src/posix.h +12 -1
- data/vendor/libgit2/src/proxy.c +9 -2
- data/vendor/libgit2/src/push.c +15 -7
- data/vendor/libgit2/src/reader.c +2 -2
- data/vendor/libgit2/src/rebase.c +89 -28
- data/vendor/libgit2/src/refdb.c +147 -0
- data/vendor/libgit2/src/refdb.h +69 -0
- data/vendor/libgit2/src/refdb_fs.c +230 -240
- data/vendor/libgit2/src/reflog.c +13 -19
- data/vendor/libgit2/src/refs.c +98 -210
- data/vendor/libgit2/src/refs.h +9 -20
- data/vendor/libgit2/src/refspec.c +9 -16
- data/vendor/libgit2/src/regexp.c +221 -0
- data/vendor/libgit2/src/regexp.h +97 -0
- data/vendor/libgit2/src/remote.c +89 -72
- data/vendor/libgit2/src/remote.h +2 -2
- data/vendor/libgit2/src/repository.c +317 -195
- data/vendor/libgit2/src/repository.h +49 -57
- data/vendor/libgit2/src/revert.c +10 -3
- data/vendor/libgit2/src/revparse.c +23 -23
- data/vendor/libgit2/src/revwalk.c +73 -37
- data/vendor/libgit2/src/revwalk.h +20 -0
- data/vendor/libgit2/src/settings.c +22 -1
- data/vendor/libgit2/src/sortedcache.c +14 -29
- data/vendor/libgit2/src/sortedcache.h +1 -1
- data/vendor/libgit2/src/stash.c +49 -67
- data/vendor/libgit2/src/status.c +19 -11
- data/vendor/libgit2/src/strarray.c +63 -0
- data/vendor/libgit2/src/streams/openssl.c +66 -8
- data/vendor/libgit2/src/streams/registry.c +5 -3
- data/vendor/libgit2/src/streams/socket.c +2 -2
- data/vendor/libgit2/src/strmap.c +37 -84
- data/vendor/libgit2/src/strmap.h +105 -33
- data/vendor/libgit2/src/submodule.c +157 -130
- data/vendor/libgit2/src/submodule.h +1 -1
- data/vendor/libgit2/src/sysdir.c +15 -21
- data/vendor/libgit2/src/sysdir.h +0 -11
- data/vendor/libgit2/src/tag.c +12 -2
- data/vendor/libgit2/src/thread-utils.h +139 -21
- data/vendor/libgit2/src/trace.c +1 -1
- data/vendor/libgit2/src/trace.h +3 -3
- data/vendor/libgit2/src/trailer.c +46 -32
- data/vendor/libgit2/src/transaction.c +12 -10
- data/vendor/libgit2/src/transports/auth.c +16 -15
- data/vendor/libgit2/src/transports/auth.h +18 -11
- data/vendor/libgit2/src/transports/auth_negotiate.c +64 -33
- data/vendor/libgit2/src/transports/auth_negotiate.h +2 -2
- data/vendor/libgit2/src/transports/auth_ntlm.c +223 -0
- data/vendor/libgit2/src/transports/auth_ntlm.h +38 -0
- data/vendor/libgit2/src/transports/credential.c +478 -0
- data/vendor/libgit2/src/transports/{cred_helpers.c → credential_helpers.c} +23 -8
- data/vendor/libgit2/src/transports/git.c +11 -16
- data/vendor/libgit2/src/transports/http.c +488 -1248
- data/vendor/libgit2/src/transports/http.h +4 -1
- data/vendor/libgit2/src/transports/httpclient.c +1547 -0
- data/vendor/libgit2/src/transports/httpclient.h +190 -0
- data/vendor/libgit2/src/transports/local.c +12 -12
- data/vendor/libgit2/src/transports/smart.c +21 -21
- data/vendor/libgit2/src/transports/smart.h +3 -3
- data/vendor/libgit2/src/transports/smart_pkt.c +1 -1
- data/vendor/libgit2/src/transports/smart_protocol.c +40 -64
- data/vendor/libgit2/src/transports/ssh.c +77 -59
- data/vendor/libgit2/src/transports/winhttp.c +290 -249
- data/vendor/libgit2/src/tree-cache.c +14 -7
- data/vendor/libgit2/src/tree.c +16 -26
- data/vendor/libgit2/src/unix/map.c +1 -1
- data/vendor/libgit2/src/unix/posix.h +15 -13
- data/vendor/libgit2/src/userdiff.h +3 -1
- data/vendor/libgit2/src/util.c +75 -110
- data/vendor/libgit2/src/util.h +18 -23
- data/vendor/libgit2/src/wildmatch.c +320 -0
- data/vendor/libgit2/src/wildmatch.h +23 -0
- data/vendor/libgit2/src/win32/git2.rc +18 -3
- data/vendor/libgit2/src/win32/map.c +3 -5
- data/vendor/libgit2/src/win32/path_w32.c +42 -5
- data/vendor/libgit2/src/win32/path_w32.h +15 -29
- data/vendor/libgit2/src/win32/posix.h +1 -4
- data/vendor/libgit2/src/win32/posix_w32.c +47 -5
- data/vendor/libgit2/src/win32/precompiled.h +0 -2
- data/vendor/libgit2/src/win32/thread.c +5 -10
- data/vendor/libgit2/src/win32/w32_buffer.c +7 -3
- data/vendor/libgit2/src/win32/w32_common.h +39 -0
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +0 -93
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +0 -2
- data/vendor/libgit2/src/win32/w32_stack.c +4 -9
- data/vendor/libgit2/src/win32/w32_stack.h +3 -3
- data/vendor/libgit2/src/win32/w32_util.c +31 -0
- data/vendor/libgit2/src/win32/w32_util.h +6 -32
- data/vendor/libgit2/src/worktree.c +83 -49
- data/vendor/libgit2/src/xdiff/xdiffi.c +1 -1
- data/vendor/libgit2/src/xdiff/xmerge.c +12 -0
- data/vendor/libgit2/src/xdiff/xpatience.c +3 -0
- data/vendor/libgit2/src/zstream.c +5 -0
- data/vendor/libgit2/src/zstream.h +1 -0
- metadata +124 -55
- data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in +0 -29
- data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake +0 -96
- data/vendor/libgit2/deps/regex/CMakeLists.txt +0 -2
- data/vendor/libgit2/deps/regex/COPYING +0 -502
- data/vendor/libgit2/deps/regex/config.h +0 -7
- data/vendor/libgit2/deps/regex/regcomp.c +0 -3857
- data/vendor/libgit2/deps/regex/regex.c +0 -92
- data/vendor/libgit2/deps/regex/regex.h +0 -582
- data/vendor/libgit2/deps/regex/regex_internal.c +0 -1744
- data/vendor/libgit2/deps/regex/regex_internal.h +0 -819
- data/vendor/libgit2/deps/regex/regexec.c +0 -4369
- data/vendor/libgit2/include/git2/inttypes.h +0 -309
- data/vendor/libgit2/include/git2/sys/time.h +0 -31
- data/vendor/libgit2/libgit2.pc.in +0 -13
- data/vendor/libgit2/src/fnmatch.c +0 -248
- data/vendor/libgit2/src/fnmatch.h +0 -48
- data/vendor/libgit2/src/sha1_lookup.c +0 -35
- data/vendor/libgit2/src/transports/cred.c +0 -390
data/vendor/libgit2/src/idxmap.h
CHANGED
@@ -11,31 +11,167 @@
|
|
11
11
|
|
12
12
|
#include "git2/index.h"
|
13
13
|
|
14
|
+
/** A map with `git_index_entry`s as key. */
|
14
15
|
typedef struct kh_idx_s git_idxmap;
|
16
|
+
/** A map with case-insensitive `git_index_entry`s as key */
|
15
17
|
typedef struct kh_idxicase_s git_idxmap_icase;
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
/**
|
20
|
+
* Allocate a new index entry map.
|
21
|
+
*
|
22
|
+
* @param out Pointer to the map that shall be allocated.
|
23
|
+
* @return 0 on success, an error code if allocation has failed.
|
24
|
+
*/
|
25
|
+
int git_idxmap_new(git_idxmap **out);
|
21
26
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
+
/**
|
28
|
+
* Allocate a new case-insensitive index entry map.
|
29
|
+
*
|
30
|
+
* @param out Pointer to the map that shall be allocated.
|
31
|
+
* @return 0 on success, an error code if allocation has failed.
|
32
|
+
*/
|
33
|
+
int git_idxmap_icase_new(git_idxmap_icase **out);
|
27
34
|
|
28
|
-
|
29
|
-
|
35
|
+
/**
|
36
|
+
* Free memory associated with the map.
|
37
|
+
*
|
38
|
+
* Note that this function will _not_ free values added to this
|
39
|
+
* map.
|
40
|
+
*
|
41
|
+
* @param map Pointer to the map that is to be free'd. May be
|
42
|
+
* `NULL`.
|
43
|
+
*/
|
30
44
|
void git_idxmap_free(git_idxmap *map);
|
45
|
+
|
46
|
+
/**
|
47
|
+
* Free memory associated with the map.
|
48
|
+
*
|
49
|
+
* Note that this function will _not_ free values added to this
|
50
|
+
* map.
|
51
|
+
*
|
52
|
+
* @param map Pointer to the map that is to be free'd. May be
|
53
|
+
* `NULL`.
|
54
|
+
*/
|
31
55
|
void git_idxmap_icase_free(git_idxmap_icase *map);
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Clear all entries from the map.
|
59
|
+
*
|
60
|
+
* This function will remove all entries from the associated map.
|
61
|
+
* Memory associated with it will not be released, though.
|
62
|
+
*
|
63
|
+
* @param map Pointer to the map that shall be cleared. May be
|
64
|
+
* `NULL`.
|
65
|
+
*/
|
32
66
|
void git_idxmap_clear(git_idxmap *map);
|
67
|
+
|
68
|
+
/**
|
69
|
+
* Clear all entries from the map.
|
70
|
+
*
|
71
|
+
* This function will remove all entries from the associated map.
|
72
|
+
* Memory associated with it will not be released, though.
|
73
|
+
*
|
74
|
+
* @param map Pointer to the map that shall be cleared. May be
|
75
|
+
* `NULL`.
|
76
|
+
*/
|
33
77
|
void git_idxmap_icase_clear(git_idxmap_icase *map);
|
34
78
|
|
35
|
-
|
36
|
-
|
79
|
+
/**
|
80
|
+
* Resize the map by allocating more memory.
|
81
|
+
*
|
82
|
+
* @param map map that shall be resized
|
83
|
+
* @param size count of entries that the map shall hold
|
84
|
+
* @return `0` if the map was successfully resized, a negative
|
85
|
+
* error code otherwise
|
86
|
+
*/
|
87
|
+
int git_idxmap_resize(git_idxmap *map, size_t size);
|
37
88
|
|
38
|
-
|
39
|
-
|
89
|
+
/**
|
90
|
+
* Resize the map by allocating more memory.
|
91
|
+
*
|
92
|
+
* @param map map that shall be resized
|
93
|
+
* @param size count of entries that the map shall hold
|
94
|
+
* @return `0` if the map was successfully resized, a negative
|
95
|
+
* error code otherwise
|
96
|
+
*/
|
97
|
+
int git_idxmap_icase_resize(git_idxmap_icase *map, size_t size);
|
98
|
+
|
99
|
+
/**
|
100
|
+
* Return value associated with the given key.
|
101
|
+
*
|
102
|
+
* @param map map to search key in
|
103
|
+
* @param key key to search for; the index entry will be searched
|
104
|
+
* for by its case-sensitive path
|
105
|
+
* @return value associated with the given key or NULL if the key was not found
|
106
|
+
*/
|
107
|
+
void *git_idxmap_get(git_idxmap *map, const git_index_entry *key);
|
108
|
+
|
109
|
+
/**
|
110
|
+
* Return value associated with the given key.
|
111
|
+
*
|
112
|
+
* @param map map to search key in
|
113
|
+
* @param key key to search for; the index entry will be searched
|
114
|
+
* for by its case-insensitive path
|
115
|
+
* @return value associated with the given key or NULL if the key was not found
|
116
|
+
*/
|
117
|
+
void *git_idxmap_icase_get(git_idxmap_icase *map, const git_index_entry *key);
|
118
|
+
|
119
|
+
/**
|
120
|
+
* Set the entry for key to value.
|
121
|
+
*
|
122
|
+
* If the map has no corresponding entry for the given key, a new
|
123
|
+
* entry will be created with the given value. If an entry exists
|
124
|
+
* already, its value will be updated to match the given value.
|
125
|
+
*
|
126
|
+
* @param map map to create new entry in
|
127
|
+
* @param key key to set
|
128
|
+
* @param value value to associate the key with; may be NULL
|
129
|
+
* @return zero if the key was successfully set, a negative error
|
130
|
+
* code otherwise
|
131
|
+
*/
|
132
|
+
int git_idxmap_set(git_idxmap *map, const git_index_entry *key, void *value);
|
133
|
+
|
134
|
+
/**
|
135
|
+
* Set the entry for key to value.
|
136
|
+
*
|
137
|
+
* If the map has no corresponding entry for the given key, a new
|
138
|
+
* entry will be created with the given value. If an entry exists
|
139
|
+
* already, its value will be updated to match the given value.
|
140
|
+
*
|
141
|
+
* @param map map to create new entry in
|
142
|
+
* @param key key to set
|
143
|
+
* @param value value to associate the key with; may be NULL
|
144
|
+
* @return zero if the key was successfully set, a negative error
|
145
|
+
* code otherwise
|
146
|
+
*/
|
147
|
+
int git_idxmap_icase_set(git_idxmap_icase *map, const git_index_entry *key, void *value);
|
148
|
+
|
149
|
+
/**
|
150
|
+
* Delete an entry from the map.
|
151
|
+
*
|
152
|
+
* Delete the given key and its value from the map. If no such
|
153
|
+
* key exists, this will do nothing.
|
154
|
+
*
|
155
|
+
* @param map map to delete key in
|
156
|
+
* @param key key to delete
|
157
|
+
* @return `0` if the key has been deleted, GIT_ENOTFOUND if no
|
158
|
+
* such key was found, a negative code in case of an
|
159
|
+
* error
|
160
|
+
*/
|
161
|
+
int git_idxmap_delete(git_idxmap *map, const git_index_entry *key);
|
162
|
+
|
163
|
+
/**
|
164
|
+
* Delete an entry from the map.
|
165
|
+
*
|
166
|
+
* Delete the given key and its value from the map. If no such
|
167
|
+
* key exists, this will do nothing.
|
168
|
+
*
|
169
|
+
* @param map map to delete key in
|
170
|
+
* @param key key to delete
|
171
|
+
* @return `0` if the key has been deleted, GIT_ENOTFOUND if no
|
172
|
+
* such key was found, a negative code in case of an
|
173
|
+
* error
|
174
|
+
*/
|
175
|
+
int git_idxmap_icase_delete(git_idxmap_icase *map, const git_index_entry *key);
|
40
176
|
|
41
177
|
#endif
|
data/vendor/libgit2/src/ignore.c
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#include "attrcache.h"
|
13
13
|
#include "path.h"
|
14
14
|
#include "config.h"
|
15
|
-
#include "
|
15
|
+
#include "wildmatch.h"
|
16
16
|
|
17
17
|
#define GIT_IGNORE_INTERNAL "[internal]exclude"
|
18
18
|
|
@@ -101,7 +101,7 @@ static int does_negate_pattern(git_attr_fnmatch *rule, git_attr_fnmatch *neg)
|
|
101
101
|
*/
|
102
102
|
static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match)
|
103
103
|
{
|
104
|
-
int error = 0,
|
104
|
+
int error = 0, wildmatch_flags;
|
105
105
|
size_t i;
|
106
106
|
git_attr_fnmatch *rule;
|
107
107
|
char *path;
|
@@ -109,9 +109,9 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
|
|
109
109
|
|
110
110
|
*out = 0;
|
111
111
|
|
112
|
-
|
112
|
+
wildmatch_flags = WM_PATHNAME;
|
113
113
|
if (match->flags & GIT_ATTR_FNMATCH_ICASE)
|
114
|
-
|
114
|
+
wildmatch_flags |= WM_CASEFOLD;
|
115
115
|
|
116
116
|
/* path of the file relative to the workdir, so we match the rules in subdirs */
|
117
117
|
if (match->containing_dir) {
|
@@ -141,13 +141,8 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
|
|
141
141
|
if (git_buf_oom(&buf))
|
142
142
|
goto out;
|
143
143
|
|
144
|
-
if ((error = p_fnmatch(git_buf_cstr(&buf), path, fnflags)) < 0) {
|
145
|
-
git_error_set(GIT_ERROR_INVALID, "error matching pattern");
|
146
|
-
goto out;
|
147
|
-
}
|
148
|
-
|
149
144
|
/* if we found a match, we want to keep this rule */
|
150
|
-
if (
|
145
|
+
if ((wildmatch(git_buf_cstr(&buf), path, wildmatch_flags)) == WM_MATCH) {
|
151
146
|
*out = 1;
|
152
147
|
error = 0;
|
153
148
|
goto out;
|
@@ -163,14 +158,16 @@ out:
|
|
163
158
|
}
|
164
159
|
|
165
160
|
static int parse_ignore_file(
|
166
|
-
git_repository *repo, git_attr_file *attrs, const char *data)
|
161
|
+
git_repository *repo, git_attr_file *attrs, const char *data, bool allow_macros)
|
167
162
|
{
|
168
163
|
int error = 0;
|
169
164
|
int ignore_case = false;
|
170
165
|
const char *scan = data, *context = NULL;
|
171
166
|
git_attr_fnmatch *match = NULL;
|
172
167
|
|
173
|
-
|
168
|
+
GIT_UNUSED(allow_macros);
|
169
|
+
|
170
|
+
if (git_repository__configmap_lookup(&ignore_case, repo, GIT_CONFIGMAP_IGNORECASE) < 0)
|
174
171
|
git_error_clear();
|
175
172
|
|
176
173
|
/* if subdir file path, convert context for file paths */
|
@@ -193,9 +190,7 @@ static int parse_ignore_file(
|
|
193
190
|
}
|
194
191
|
|
195
192
|
match->flags =
|
196
|
-
GIT_ATTR_FNMATCH_ALLOWSPACE |
|
197
|
-
GIT_ATTR_FNMATCH_ALLOWNEG |
|
198
|
-
GIT_ATTR_FNMATCH_NOLEADINGDIR;
|
193
|
+
GIT_ATTR_FNMATCH_ALLOWSPACE | GIT_ATTR_FNMATCH_ALLOWNEG;
|
199
194
|
|
200
195
|
if (!(error = git_attr_fnmatch__parse(
|
201
196
|
match, &attrs->pool, context, &scan)))
|
@@ -246,9 +241,8 @@ static int push_ignore_file(
|
|
246
241
|
int error = 0;
|
247
242
|
git_attr_file *file = NULL;
|
248
243
|
|
249
|
-
error = git_attr_cache__get(
|
250
|
-
|
251
|
-
base, filename, parse_ignore_file);
|
244
|
+
error = git_attr_cache__get(&file, ignores->repo, NULL, GIT_ATTR_FILE__FROM_FILE,
|
245
|
+
base, filename, parse_ignore_file, false);
|
252
246
|
if (error < 0)
|
253
247
|
return error;
|
254
248
|
|
@@ -274,12 +268,12 @@ static int get_internal_ignores(git_attr_file **out, git_repository *repo)
|
|
274
268
|
if ((error = git_attr_cache__init(repo)) < 0)
|
275
269
|
return error;
|
276
270
|
|
277
|
-
error = git_attr_cache__get(
|
278
|
-
|
271
|
+
error = git_attr_cache__get(out, repo, NULL, GIT_ATTR_FILE__IN_MEMORY, NULL,
|
272
|
+
GIT_IGNORE_INTERNAL, NULL, false);
|
279
273
|
|
280
274
|
/* if internal rules list is empty, insert default rules */
|
281
275
|
if (!error && !(*out)->rules.length)
|
282
|
-
error = parse_ignore_file(repo, *out, GIT_IGNORE_DEFAULT_RULES);
|
276
|
+
error = parse_ignore_file(repo, *out, GIT_IGNORE_DEFAULT_RULES, false);
|
283
277
|
|
284
278
|
return error;
|
285
279
|
}
|
@@ -299,8 +293,8 @@ int git_ignore__for_path(
|
|
299
293
|
ignores->repo = repo;
|
300
294
|
|
301
295
|
/* Read the ignore_case flag */
|
302
|
-
if ((error =
|
303
|
-
&ignores->ignore_case, repo,
|
296
|
+
if ((error = git_repository__configmap_lookup(
|
297
|
+
&ignores->ignore_case, repo, GIT_CONFIGMAP_IGNORECASE)) < 0)
|
304
298
|
goto cleanup;
|
305
299
|
|
306
300
|
if ((error = git_attr_cache__init(repo)) < 0)
|
@@ -337,16 +331,13 @@ int git_ignore__for_path(
|
|
337
331
|
goto cleanup;
|
338
332
|
}
|
339
333
|
|
340
|
-
if
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
infopath.ptr, GIT_IGNORE_FILE_INREPO);
|
348
|
-
if (error < 0)
|
349
|
-
goto cleanup;
|
334
|
+
/* load .git/info/exclude if possible */
|
335
|
+
if ((error = git_repository_item_path(&infopath, repo, GIT_REPOSITORY_ITEM_INFO)) < 0 ||
|
336
|
+
(error = push_ignore_file(ignores, &ignores->ign_global, infopath.ptr, GIT_IGNORE_FILE_INREPO)) < 0) {
|
337
|
+
if (error != GIT_ENOTFOUND)
|
338
|
+
goto cleanup;
|
339
|
+
error = 0;
|
340
|
+
}
|
350
341
|
|
351
342
|
/* load core.excludesfile */
|
352
343
|
if (git_repository_attr_cache(repo)->cfg_excl_file != NULL)
|
@@ -453,7 +444,7 @@ static bool ignore_lookup_in_rules(
|
|
453
444
|
int git_ignore__lookup(
|
454
445
|
int *out, git_ignores *ignores, const char *pathname, git_dir_flag dir_flag)
|
455
446
|
{
|
456
|
-
|
447
|
+
size_t i;
|
457
448
|
git_attr_file *file;
|
458
449
|
git_attr_path path;
|
459
450
|
|
@@ -467,8 +458,11 @@ int git_ignore__lookup(
|
|
467
458
|
if (ignore_lookup_in_rules(out, ignores->ign_internal, &path))
|
468
459
|
goto cleanup;
|
469
460
|
|
470
|
-
/* next process files in the path
|
471
|
-
|
461
|
+
/* next process files in the path.
|
462
|
+
* this process has to process ignores in reverse order
|
463
|
+
* to ensure correct prioritization of rules
|
464
|
+
*/
|
465
|
+
git_vector_rforeach(&ignores->ign_path, i, file) {
|
472
466
|
if (ignore_lookup_in_rules(out, file, &path))
|
473
467
|
goto cleanup;
|
474
468
|
}
|
@@ -492,7 +486,7 @@ int git_ignore_add_rule(git_repository *repo, const char *rules)
|
|
492
486
|
if ((error = get_internal_ignores(&ign_internal, repo)) < 0)
|
493
487
|
return error;
|
494
488
|
|
495
|
-
error = parse_ignore_file(repo, ign_internal, rules);
|
489
|
+
error = parse_ignore_file(repo, ign_internal, rules, false);
|
496
490
|
git_attr_file__free(ign_internal);
|
497
491
|
|
498
492
|
return error;
|
@@ -508,7 +502,7 @@ int git_ignore_clear_internal_rules(git_repository *repo)
|
|
508
502
|
|
509
503
|
if (!(error = git_attr_file__clear_rules(ign_internal, true)))
|
510
504
|
error = parse_ignore_file(
|
511
|
-
|
505
|
+
repo, ign_internal, GIT_IGNORE_DEFAULT_RULES, false);
|
512
506
|
|
513
507
|
git_attr_file__free(ign_internal);
|
514
508
|
return error;
|
data/vendor/libgit2/src/index.c
CHANGED
@@ -27,29 +27,6 @@
|
|
27
27
|
#include "git2/config.h"
|
28
28
|
#include "git2/sys/index.h"
|
29
29
|
|
30
|
-
#define INSERT_IN_MAP_EX(idx, map, e, err) do { \
|
31
|
-
if ((idx)->ignore_case) \
|
32
|
-
git_idxmap_icase_insert((git_idxmap_icase *) (map), (e), (e), (err)); \
|
33
|
-
else \
|
34
|
-
git_idxmap_insert((map), (e), (e), (err)); \
|
35
|
-
} while (0)
|
36
|
-
|
37
|
-
#define INSERT_IN_MAP(idx, e, err) INSERT_IN_MAP_EX(idx, (idx)->entries_map, e, err)
|
38
|
-
|
39
|
-
#define LOOKUP_IN_MAP(p, idx, k) do { \
|
40
|
-
if ((idx)->ignore_case) \
|
41
|
-
(p) = git_idxmap_icase_lookup_index((git_idxmap_icase *) index->entries_map, (k)); \
|
42
|
-
else \
|
43
|
-
(p) = git_idxmap_lookup_index(index->entries_map, (k)); \
|
44
|
-
} while (0)
|
45
|
-
|
46
|
-
#define DELETE_IN_MAP(idx, e) do { \
|
47
|
-
if ((idx)->ignore_case) \
|
48
|
-
git_idxmap_icase_delete((git_idxmap_icase *) (idx)->entries_map, (e)); \
|
49
|
-
else \
|
50
|
-
git_idxmap_delete((idx)->entries_map, (e)); \
|
51
|
-
} while (0)
|
52
|
-
|
53
30
|
static int index_apply_to_wd_diff(git_index *index, int action, const git_strarray *paths,
|
54
31
|
unsigned int flags,
|
55
32
|
git_index_matched_path_cb cb, void *payload);
|
@@ -148,6 +125,30 @@ static int write_index(git_oid *checksum, git_index *index, git_filebuf *file);
|
|
148
125
|
static void index_entry_free(git_index_entry *entry);
|
149
126
|
static void index_entry_reuc_free(git_index_reuc_entry *reuc);
|
150
127
|
|
128
|
+
GIT_INLINE(int) index_map_set(git_idxmap *map, git_index_entry *e, bool ignore_case)
|
129
|
+
{
|
130
|
+
if (ignore_case)
|
131
|
+
return git_idxmap_icase_set((git_idxmap_icase *) map, e, e);
|
132
|
+
else
|
133
|
+
return git_idxmap_set(map, e, e);
|
134
|
+
}
|
135
|
+
|
136
|
+
GIT_INLINE(int) index_map_delete(git_idxmap *map, git_index_entry *e, bool ignore_case)
|
137
|
+
{
|
138
|
+
if (ignore_case)
|
139
|
+
return git_idxmap_icase_delete((git_idxmap_icase *) map, e);
|
140
|
+
else
|
141
|
+
return git_idxmap_delete(map, e);
|
142
|
+
}
|
143
|
+
|
144
|
+
GIT_INLINE(int) index_map_resize(git_idxmap *map, size_t count, bool ignore_case)
|
145
|
+
{
|
146
|
+
if (ignore_case)
|
147
|
+
return git_idxmap_icase_resize((git_idxmap_icase *) map, count);
|
148
|
+
else
|
149
|
+
return git_idxmap_resize(map, count);
|
150
|
+
}
|
151
|
+
|
151
152
|
int git_index_entry_srch(const void *key, const void *array_member)
|
152
153
|
{
|
153
154
|
const struct entry_srch_key *srch_key = key;
|
@@ -410,7 +411,8 @@ int git_index_open(git_index **index_out, const char *index_path)
|
|
410
411
|
index = git__calloc(1, sizeof(git_index));
|
411
412
|
GIT_ERROR_CHECK_ALLOC(index);
|
412
413
|
|
413
|
-
git_pool_init(&index->tree_pool, 1)
|
414
|
+
if (git_pool_init(&index->tree_pool, 1) < 0)
|
415
|
+
goto fail;
|
414
416
|
|
415
417
|
if (index_path != NULL) {
|
416
418
|
index->index_file_path = git__strdup(index_path);
|
@@ -423,10 +425,10 @@ int git_index_open(git_index **index_out, const char *index_path)
|
|
423
425
|
}
|
424
426
|
|
425
427
|
if (git_vector_init(&index->entries, 32, git_index_entry_cmp) < 0 ||
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
428
|
+
git_idxmap_new(&index->entries_map) < 0 ||
|
429
|
+
git_vector_init(&index->names, 8, conflict_name_cmp) < 0 ||
|
430
|
+
git_vector_init(&index->reuc, 8, reuc_cmp) < 0 ||
|
431
|
+
git_vector_init(&index->deleted, 8, git_index_entry_cmp) < 0)
|
430
432
|
goto fail;
|
431
433
|
|
432
434
|
index->entries_cmp_path = git__strcmp_cb;
|
@@ -507,7 +509,7 @@ static int index_remove_entry(git_index *index, size_t pos)
|
|
507
509
|
|
508
510
|
if (entry != NULL) {
|
509
511
|
git_tree_cache_invalidate_path(index->tree, entry->path);
|
510
|
-
|
512
|
+
index_map_delete(index->entries_map, entry, index->ignore_case);
|
511
513
|
}
|
512
514
|
|
513
515
|
error = git_vector_remove(&index->entries, pos);
|
@@ -538,13 +540,19 @@ int git_index_clear(git_index *index)
|
|
538
540
|
git_idxmap_clear(index->entries_map);
|
539
541
|
while (!error && index->entries.length > 0)
|
540
542
|
error = index_remove_entry(index, index->entries.length - 1);
|
543
|
+
|
544
|
+
if (error)
|
545
|
+
goto done;
|
546
|
+
|
541
547
|
index_free_deleted(index);
|
542
548
|
|
543
|
-
|
544
|
-
|
549
|
+
if ((error = git_index_name_clear(index)) < 0 ||
|
550
|
+
(error = git_index_reuc_clear(index)) < 0)
|
551
|
+
goto done;
|
545
552
|
|
546
553
|
git_futils_filestamp_set(&index->stamp, NULL);
|
547
554
|
|
555
|
+
done:
|
548
556
|
return error;
|
549
557
|
}
|
550
558
|
|
@@ -570,11 +578,11 @@ int git_index_set_caps(git_index *index, int caps)
|
|
570
578
|
return create_index_error(
|
571
579
|
-1, "cannot access repository to set index caps");
|
572
580
|
|
573
|
-
if (!
|
581
|
+
if (!git_repository__configmap_lookup(&val, repo, GIT_CONFIGMAP_IGNORECASE))
|
574
582
|
index->ignore_case = (val != 0);
|
575
|
-
if (!
|
583
|
+
if (!git_repository__configmap_lookup(&val, repo, GIT_CONFIGMAP_FILEMODE))
|
576
584
|
index->distrust_filemode = (val == 0);
|
577
|
-
if (!
|
585
|
+
if (!git_repository__configmap_lookup(&val, repo, GIT_CONFIGMAP_SYMLINKS))
|
578
586
|
index->no_symlinks = (val == 0);
|
579
587
|
}
|
580
588
|
else {
|
@@ -852,20 +860,24 @@ const git_index_entry *git_index_get_bypath(
|
|
852
860
|
git_index *index, const char *path, int stage)
|
853
861
|
{
|
854
862
|
git_index_entry key = {{ 0 }};
|
855
|
-
|
863
|
+
git_index_entry *value;
|
856
864
|
|
857
865
|
assert(index);
|
858
866
|
|
859
867
|
key.path = path;
|
860
868
|
GIT_INDEX_ENTRY_STAGE_SET(&key, stage);
|
861
869
|
|
862
|
-
|
870
|
+
if (index->ignore_case)
|
871
|
+
value = git_idxmap_icase_get((git_idxmap_icase *) index->entries_map, &key);
|
872
|
+
else
|
873
|
+
value = git_idxmap_get(index->entries_map, &key);
|
863
874
|
|
864
|
-
if (
|
865
|
-
|
875
|
+
if (!value) {
|
876
|
+
git_error_set(GIT_ERROR_INDEX, "index does not contain '%s'", path);
|
877
|
+
return NULL;
|
878
|
+
}
|
866
879
|
|
867
|
-
|
868
|
-
return NULL;
|
880
|
+
return value;
|
869
881
|
}
|
870
882
|
|
871
883
|
void git_index_entry__init_from_stat(
|
@@ -1398,10 +1410,9 @@ static int index_insert(
|
|
1398
1410
|
* at the sorted position. (Since we re-sort after each insert to
|
1399
1411
|
* check for dups, this is actually cheaper in the long run.)
|
1400
1412
|
*/
|
1401
|
-
if ((error = git_vector_insert_sorted(&index->entries, entry, index_no_dups)) < 0
|
1413
|
+
if ((error = git_vector_insert_sorted(&index->entries, entry, index_no_dups)) < 0 ||
|
1414
|
+
(error = index_map_set(index->entries_map, entry, index->ignore_case)) < 0)
|
1402
1415
|
goto out;
|
1403
|
-
|
1404
|
-
INSERT_IN_MAP(index, entry, &error);
|
1405
1416
|
}
|
1406
1417
|
|
1407
1418
|
index->dirty = 1;
|
@@ -1453,7 +1464,7 @@ GIT_INLINE(bool) valid_filemode(const int filemode)
|
|
1453
1464
|
return (is_file_or_link(filemode) || filemode == GIT_FILEMODE_COMMIT);
|
1454
1465
|
}
|
1455
1466
|
|
1456
|
-
int
|
1467
|
+
int git_index_add_from_buffer(
|
1457
1468
|
git_index *index, const git_index_entry *source_entry,
|
1458
1469
|
const void *buffer, size_t len)
|
1459
1470
|
{
|
@@ -1473,17 +1484,22 @@ int git_index_add_frombuffer(
|
|
1473
1484
|
return -1;
|
1474
1485
|
}
|
1475
1486
|
|
1487
|
+
if (len > UINT32_MAX) {
|
1488
|
+
git_error_set(GIT_ERROR_INDEX, "buffer is too large");
|
1489
|
+
return -1;
|
1490
|
+
}
|
1491
|
+
|
1476
1492
|
if (index_entry_dup(&entry, index, source_entry) < 0)
|
1477
1493
|
return -1;
|
1478
1494
|
|
1479
|
-
error =
|
1495
|
+
error = git_blob_create_from_buffer(&id, INDEX_OWNER(index), buffer, len);
|
1480
1496
|
if (error < 0) {
|
1481
1497
|
index_entry_free(entry);
|
1482
1498
|
return error;
|
1483
1499
|
}
|
1484
1500
|
|
1485
1501
|
git_oid_cpy(&entry->id, &id);
|
1486
|
-
entry->file_size = len;
|
1502
|
+
entry->file_size = (uint32_t)len;
|
1487
1503
|
|
1488
1504
|
if ((error = index_insert(index, &entry, 1, true, true, true)) < 0)
|
1489
1505
|
return error;
|
@@ -1610,41 +1626,42 @@ int git_index_remove_bypath(git_index *index, const char *path)
|
|
1610
1626
|
int git_index__fill(git_index *index, const git_vector *source_entries)
|
1611
1627
|
{
|
1612
1628
|
const git_index_entry *source_entry = NULL;
|
1629
|
+
int error = 0;
|
1613
1630
|
size_t i;
|
1614
|
-
int ret = 0;
|
1615
1631
|
|
1616
1632
|
assert(index);
|
1617
1633
|
|
1618
1634
|
if (!source_entries->length)
|
1619
1635
|
return 0;
|
1620
1636
|
|
1621
|
-
git_vector_size_hint(&index->entries, source_entries->length)
|
1622
|
-
|
1637
|
+
if (git_vector_size_hint(&index->entries, source_entries->length) < 0 ||
|
1638
|
+
index_map_resize(index->entries_map, (size_t)(source_entries->length * 1.3),
|
1639
|
+
index->ignore_case) < 0)
|
1640
|
+
return -1;
|
1623
1641
|
|
1624
1642
|
git_vector_foreach(source_entries, i, source_entry) {
|
1625
1643
|
git_index_entry *entry = NULL;
|
1626
1644
|
|
1627
|
-
if ((
|
1645
|
+
if ((error = index_entry_dup(&entry, index, source_entry)) < 0)
|
1628
1646
|
break;
|
1629
1647
|
|
1630
1648
|
index_entry_adjust_namemask(entry, ((struct entry_internal *)entry)->pathlen);
|
1631
1649
|
entry->flags_extended |= GIT_INDEX_ENTRY_UPTODATE;
|
1632
1650
|
entry->mode = git_index__create_mode(entry->mode);
|
1633
1651
|
|
1634
|
-
if ((
|
1652
|
+
if ((error = git_vector_insert(&index->entries, entry)) < 0)
|
1635
1653
|
break;
|
1636
1654
|
|
1637
|
-
|
1638
|
-
if (ret < 0)
|
1655
|
+
if ((error = index_map_set(index->entries_map, entry, index->ignore_case)) < 0)
|
1639
1656
|
break;
|
1640
1657
|
|
1641
1658
|
index->dirty = 1;
|
1642
1659
|
}
|
1643
1660
|
|
1644
|
-
if (!
|
1661
|
+
if (!error)
|
1645
1662
|
git_vector_sort(&index->entries);
|
1646
1663
|
|
1647
|
-
return
|
1664
|
+
return error;
|
1648
1665
|
}
|
1649
1666
|
|
1650
1667
|
|
@@ -1677,7 +1694,7 @@ int git_index_remove(git_index *index, const char *path, int stage)
|
|
1677
1694
|
remove_key.path = path;
|
1678
1695
|
GIT_INDEX_ENTRY_STAGE_SET(&remove_key, stage);
|
1679
1696
|
|
1680
|
-
|
1697
|
+
index_map_delete(index->entries_map, &remove_key, index->ignore_case);
|
1681
1698
|
|
1682
1699
|
if (index_find(&position, index, path, 0, stage) < 0) {
|
1683
1700
|
git_error_set(
|
@@ -2126,7 +2143,7 @@ int git_index_name_add(git_index *index,
|
|
2126
2143
|
return 0;
|
2127
2144
|
}
|
2128
2145
|
|
2129
|
-
|
2146
|
+
int git_index_name_clear(git_index *index)
|
2130
2147
|
{
|
2131
2148
|
size_t i;
|
2132
2149
|
git_index_name_entry *conflict_name;
|
@@ -2139,6 +2156,8 @@ void git_index_name_clear(git_index *index)
|
|
2139
2156
|
git_vector_clear(&index->names);
|
2140
2157
|
|
2141
2158
|
index->dirty = 1;
|
2159
|
+
|
2160
|
+
return 0;
|
2142
2161
|
}
|
2143
2162
|
|
2144
2163
|
size_t git_index_reuc_entrycount(git_index *index)
|
@@ -2235,7 +2254,7 @@ int git_index_reuc_remove(git_index *index, size_t position)
|
|
2235
2254
|
return error;
|
2236
2255
|
}
|
2237
2256
|
|
2238
|
-
|
2257
|
+
int git_index_reuc_clear(git_index *index)
|
2239
2258
|
{
|
2240
2259
|
size_t i;
|
2241
2260
|
|
@@ -2247,6 +2266,8 @@ void git_index_reuc_clear(git_index *index)
|
|
2247
2266
|
git_vector_clear(&index->reuc);
|
2248
2267
|
|
2249
2268
|
index->dirty = 1;
|
2269
|
+
|
2270
|
+
return 0;
|
2250
2271
|
}
|
2251
2272
|
|
2252
2273
|
static int index_error_invalid(const char *message)
|
@@ -2607,10 +2628,8 @@ static int parse_index(git_index *index, const char *buffer, size_t buffer_size)
|
|
2607
2628
|
|
2608
2629
|
assert(!index->entries.length);
|
2609
2630
|
|
2610
|
-
if (index->ignore_case)
|
2611
|
-
|
2612
|
-
else
|
2613
|
-
git_idxmap_resize(index->entries_map, header.entry_count);
|
2631
|
+
if ((error = index_map_resize(index->entries_map, header.entry_count, index->ignore_case)) < 0)
|
2632
|
+
return error;
|
2614
2633
|
|
2615
2634
|
/* Parse all the entries */
|
2616
2635
|
for (i = 0; i < header.entry_count && buffer_size > INDEX_FOOTER_SIZE; ++i) {
|
@@ -2627,9 +2646,7 @@ static int parse_index(git_index *index, const char *buffer, size_t buffer_size)
|
|
2627
2646
|
goto done;
|
2628
2647
|
}
|
2629
2648
|
|
2630
|
-
|
2631
|
-
|
2632
|
-
if (error < 0) {
|
2649
|
+
if ((error = index_map_set(index->entries_map, entry, index->ignore_case)) < 0) {
|
2633
2650
|
index_entry_free(entry);
|
2634
2651
|
goto done;
|
2635
2652
|
}
|
@@ -2728,7 +2745,7 @@ static int write_disk_entry(git_filebuf *file, git_index_entry *entry, const cha
|
|
2728
2745
|
++same_len;
|
2729
2746
|
}
|
2730
2747
|
path_len -= same_len;
|
2731
|
-
varint_len = git_encode_varint(NULL, 0, same_len);
|
2748
|
+
varint_len = git_encode_varint(NULL, 0, strlen(last) - same_len);
|
2732
2749
|
}
|
2733
2750
|
|
2734
2751
|
disk_size = index_entry_size(path_len, varint_len, entry->flags);
|
@@ -2764,22 +2781,24 @@ static int write_disk_entry(git_filebuf *file, git_index_entry *entry, const cha
|
|
2764
2781
|
ondisk.flags = htons(entry->flags);
|
2765
2782
|
|
2766
2783
|
if (entry->flags & GIT_INDEX_ENTRY_EXTENDED) {
|
2784
|
+
const size_t path_offset = offsetof(struct entry_long, path);
|
2767
2785
|
struct entry_long ondisk_ext;
|
2768
2786
|
memcpy(&ondisk_ext, &ondisk, sizeof(struct entry_short));
|
2769
2787
|
ondisk_ext.flags_extended = htons(entry->flags_extended &
|
2770
2788
|
GIT_INDEX_ENTRY_EXTENDED_FLAGS);
|
2771
|
-
memcpy(mem, &ondisk_ext,
|
2772
|
-
path = (
|
2773
|
-
disk_size -=
|
2789
|
+
memcpy(mem, &ondisk_ext, path_offset);
|
2790
|
+
path = (char *)mem + path_offset;
|
2791
|
+
disk_size -= path_offset;
|
2774
2792
|
} else {
|
2775
|
-
|
2776
|
-
|
2777
|
-
|
2793
|
+
const size_t path_offset = offsetof(struct entry_short, path);
|
2794
|
+
memcpy(mem, &ondisk, path_offset);
|
2795
|
+
path = (char *)mem + path_offset;
|
2796
|
+
disk_size -= path_offset;
|
2778
2797
|
}
|
2779
2798
|
|
2780
2799
|
if (last) {
|
2781
2800
|
varint_len = git_encode_varint((unsigned char *) path,
|
2782
|
-
disk_size, same_len);
|
2801
|
+
disk_size, strlen(last) - same_len);
|
2783
2802
|
assert(varint_len > 0);
|
2784
2803
|
path += varint_len;
|
2785
2804
|
disk_size -= varint_len;
|
@@ -3106,7 +3125,7 @@ int git_index_read_tree(git_index *index, const git_tree *tree)
|
|
3106
3125
|
size_t i;
|
3107
3126
|
git_index_entry *e;
|
3108
3127
|
|
3109
|
-
if (
|
3128
|
+
if (git_idxmap_new(&entries_map) < 0)
|
3110
3129
|
return -1;
|
3111
3130
|
|
3112
3131
|
git_vector_set_cmp(&entries, index->entries._cmp); /* match sort */
|
@@ -3124,15 +3143,11 @@ int git_index_read_tree(git_index *index, const git_tree *tree)
|
|
3124
3143
|
if ((error = git_tree_walk(tree, GIT_TREEWALK_POST, read_tree_cb, &data)) < 0)
|
3125
3144
|
goto cleanup;
|
3126
3145
|
|
3127
|
-
if (index->ignore_case)
|
3128
|
-
|
3129
|
-
else
|
3130
|
-
git_idxmap_resize(entries_map, entries.length);
|
3146
|
+
if ((error = index_map_resize(entries_map, entries.length, index->ignore_case)) < 0)
|
3147
|
+
goto cleanup;
|
3131
3148
|
|
3132
3149
|
git_vector_foreach(&entries, i, e) {
|
3133
|
-
|
3134
|
-
|
3135
|
-
if (error < 0) {
|
3150
|
+
if ((error = index_map_set(entries_map, e, index->ignore_case)) < 0) {
|
3136
3151
|
git_error_set(GIT_ERROR_INDEX, "failed to insert entry into map");
|
3137
3152
|
return error;
|
3138
3153
|
}
|
@@ -3180,14 +3195,13 @@ static int git_index_read_iterator(
|
|
3180
3195
|
assert((new_iterator->flags & GIT_ITERATOR_DONT_IGNORE_CASE));
|
3181
3196
|
|
3182
3197
|
if ((error = git_vector_init(&new_entries, new_length_hint, index->entries._cmp)) < 0 ||
|
3183
|
-
|
3184
|
-
|
3198
|
+
(error = git_vector_init(&remove_entries, index->entries.length, NULL)) < 0 ||
|
3199
|
+
(error = git_idxmap_new(&new_entries_map)) < 0)
|
3185
3200
|
goto done;
|
3186
3201
|
|
3187
|
-
if (
|
3188
|
-
|
3189
|
-
|
3190
|
-
git_idxmap_resize(new_entries_map, new_length_hint);
|
3202
|
+
if (new_length_hint && (error = index_map_resize(new_entries_map, new_length_hint,
|
3203
|
+
index->ignore_case)) < 0)
|
3204
|
+
goto done;
|
3191
3205
|
|
3192
3206
|
opts.flags = GIT_ITERATOR_DONT_IGNORE_CASE |
|
3193
3207
|
GIT_ITERATOR_INCLUDE_CONFLICTS;
|
@@ -3251,7 +3265,8 @@ static int git_index_read_iterator(
|
|
3251
3265
|
|
3252
3266
|
if (add_entry) {
|
3253
3267
|
if ((error = git_vector_insert(&new_entries, add_entry)) == 0)
|
3254
|
-
|
3268
|
+
error = index_map_set(new_entries_map, add_entry,
|
3269
|
+
index->ignore_case);
|
3255
3270
|
}
|
3256
3271
|
|
3257
3272
|
if (remove_entry && error >= 0)
|
@@ -3275,8 +3290,9 @@ static int git_index_read_iterator(
|
|
3275
3290
|
}
|
3276
3291
|
}
|
3277
3292
|
|
3278
|
-
git_index_name_clear(index)
|
3279
|
-
|
3293
|
+
if ((error = git_index_name_clear(index)) < 0 ||
|
3294
|
+
(error = git_index_reuc_clear(index)) < 0)
|
3295
|
+
goto done;
|
3280
3296
|
|
3281
3297
|
git_vector_swap(&new_entries, &index->entries);
|
3282
3298
|
new_entries_map = git__swap(index->entries_map, new_entries_map);
|
@@ -3700,3 +3716,14 @@ void git_indexwriter_cleanup(git_indexwriter *writer)
|
|
3700
3716
|
git_index_free(writer->index);
|
3701
3717
|
writer->index = NULL;
|
3702
3718
|
}
|
3719
|
+
|
3720
|
+
/* Deprecated functions */
|
3721
|
+
|
3722
|
+
#ifndef GIT_DEPRECATE_HARD
|
3723
|
+
int git_index_add_frombuffer(
|
3724
|
+
git_index *index, const git_index_entry *source_entry,
|
3725
|
+
const void *buffer, size_t len)
|
3726
|
+
{
|
3727
|
+
return git_index_add_from_buffer(index, source_entry, buffer, len);
|
3728
|
+
}
|
3729
|
+
#endif
|