rugged 0.27.7 → 0.27.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/AUTHORS +1 -0
- data/vendor/libgit2/CMakeLists.txt +99 -51
- data/vendor/libgit2/COPYING +28 -0
- data/vendor/libgit2/cmake/Modules/AddCFlagIfSupported.cmake +15 -1
- data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in +29 -0
- data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake +96 -0
- data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +9 -8
- data/vendor/libgit2/cmake/Modules/FindCoreFoundation.cmake +2 -2
- data/vendor/libgit2/cmake/Modules/FindGSSAPI.cmake +1 -1
- data/vendor/libgit2/cmake/Modules/FindGSSFramework.cmake +28 -0
- data/vendor/libgit2/cmake/Modules/FindIconv.cmake +11 -6
- data/vendor/libgit2/cmake/Modules/FindPCRE.cmake +38 -0
- data/vendor/libgit2/cmake/Modules/FindPCRE2.cmake +37 -0
- data/vendor/libgit2/cmake/Modules/FindSecurity.cmake +2 -2
- data/vendor/libgit2/cmake/Modules/FindStatNsec.cmake +6 -0
- data/vendor/libgit2/cmake/Modules/PkgBuildConfig.cmake +110 -0
- data/vendor/libgit2/cmake/Modules/SelectGSSAPI.cmake +53 -0
- data/vendor/libgit2/cmake/Modules/SelectHTTPSBackend.cmake +124 -0
- data/vendor/libgit2/cmake/Modules/SelectHashes.cmake +66 -0
- data/vendor/libgit2/deps/http-parser/http_parser.c +11 -6
- data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +21 -0
- data/vendor/libgit2/deps/ntlmclient/compat.h +33 -0
- data/vendor/libgit2/deps/ntlmclient/crypt.h +64 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +120 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +18 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +145 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +18 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +130 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +21 -0
- data/vendor/libgit2/deps/ntlmclient/ntlm.c +1420 -0
- data/vendor/libgit2/deps/ntlmclient/ntlm.h +174 -0
- data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +320 -0
- data/vendor/libgit2/deps/ntlmclient/unicode.h +36 -0
- data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +445 -0
- data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +201 -0
- data/vendor/libgit2/deps/ntlmclient/utf8.h +1257 -0
- data/vendor/libgit2/deps/ntlmclient/util.c +21 -0
- data/vendor/libgit2/deps/ntlmclient/util.h +14 -0
- data/vendor/libgit2/deps/pcre/CMakeLists.txt +140 -0
- data/vendor/libgit2/deps/pcre/COPYING +5 -0
- data/vendor/libgit2/deps/pcre/cmake/COPYING-CMAKE-SCRIPTS +22 -0
- data/vendor/libgit2/deps/pcre/cmake/FindEditline.cmake +17 -0
- data/vendor/libgit2/deps/pcre/cmake/FindPackageHandleStandardArgs.cmake +58 -0
- data/vendor/libgit2/deps/pcre/cmake/FindReadline.cmake +29 -0
- data/vendor/libgit2/deps/pcre/config.h.in +57 -0
- data/vendor/libgit2/deps/pcre/pcre.h +641 -0
- data/vendor/libgit2/deps/pcre/pcre_byte_order.c +319 -0
- data/vendor/libgit2/deps/pcre/pcre_chartables.c +198 -0
- data/vendor/libgit2/deps/pcre/pcre_compile.c +9800 -0
- data/vendor/libgit2/deps/pcre/pcre_config.c +190 -0
- data/vendor/libgit2/deps/pcre/pcre_dfa_exec.c +3676 -0
- data/vendor/libgit2/deps/pcre/pcre_exec.c +7173 -0
- data/vendor/libgit2/deps/pcre/pcre_fullinfo.c +245 -0
- data/vendor/libgit2/deps/pcre/pcre_get.c +669 -0
- data/vendor/libgit2/deps/pcre/pcre_globals.c +86 -0
- data/vendor/libgit2/deps/pcre/pcre_internal.h +2787 -0
- data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +11913 -0
- data/vendor/libgit2/deps/pcre/pcre_maketables.c +156 -0
- data/vendor/libgit2/deps/pcre/pcre_newline.c +210 -0
- data/vendor/libgit2/deps/pcre/pcre_ord2utf8.c +94 -0
- data/vendor/libgit2/deps/pcre/pcre_printint.c +834 -0
- data/vendor/libgit2/deps/pcre/pcre_refcount.c +92 -0
- data/vendor/libgit2/deps/pcre/pcre_string_utils.c +211 -0
- data/vendor/libgit2/deps/pcre/pcre_study.c +1686 -0
- data/vendor/libgit2/deps/pcre/pcre_tables.c +727 -0
- data/vendor/libgit2/deps/pcre/pcre_ucd.c +3644 -0
- data/vendor/libgit2/deps/pcre/pcre_valid_utf8.c +301 -0
- data/vendor/libgit2/deps/pcre/pcre_version.c +98 -0
- data/vendor/libgit2/deps/pcre/pcre_xclass.c +268 -0
- data/vendor/libgit2/deps/pcre/pcreposix.c +421 -0
- data/vendor/libgit2/deps/pcre/pcreposix.h +117 -0
- data/vendor/libgit2/deps/pcre/ucp.h +224 -0
- data/vendor/libgit2/deps/winhttp/COPYING.GPL +993 -0
- data/vendor/libgit2/deps/winhttp/COPYING.LGPL +502 -0
- data/vendor/libgit2/deps/zlib/CMakeLists.txt +1 -0
- data/vendor/libgit2/deps/zlib/COPYING +27 -0
- data/vendor/libgit2/deps/zlib/adler32.c +0 -7
- data/vendor/libgit2/deps/zlib/crc32.c +0 -7
- data/vendor/libgit2/include/git2/annotated_commit.h +9 -0
- data/vendor/libgit2/include/git2/apply.h +149 -0
- data/vendor/libgit2/include/git2/attr.h +20 -13
- data/vendor/libgit2/include/git2/blame.h +4 -4
- data/vendor/libgit2/include/git2/blob.h +44 -12
- data/vendor/libgit2/include/git2/buffer.h +20 -26
- data/vendor/libgit2/include/git2/cert.h +135 -0
- data/vendor/libgit2/include/git2/checkout.h +53 -21
- data/vendor/libgit2/include/git2/cherrypick.h +3 -3
- data/vendor/libgit2/include/git2/clone.h +5 -5
- data/vendor/libgit2/include/git2/commit.h +25 -3
- data/vendor/libgit2/include/git2/common.h +35 -10
- data/vendor/libgit2/include/git2/config.h +29 -19
- data/vendor/libgit2/include/git2/cred.h +308 -0
- data/vendor/libgit2/include/git2/deprecated.h +493 -0
- data/vendor/libgit2/include/git2/describe.h +4 -4
- data/vendor/libgit2/include/git2/diff.h +177 -135
- data/vendor/libgit2/include/git2/errors.h +53 -46
- data/vendor/libgit2/include/git2/filter.h +8 -0
- data/vendor/libgit2/include/git2/index.h +74 -52
- data/vendor/libgit2/include/git2/indexer.h +76 -6
- data/vendor/libgit2/include/git2/merge.h +25 -10
- data/vendor/libgit2/include/git2/net.h +0 -5
- data/vendor/libgit2/include/git2/notes.h +1 -1
- data/vendor/libgit2/include/git2/object.h +17 -29
- data/vendor/libgit2/include/git2/odb.h +12 -11
- data/vendor/libgit2/include/git2/odb_backend.h +10 -9
- data/vendor/libgit2/include/git2/oid.h +2 -2
- data/vendor/libgit2/include/git2/pack.h +14 -3
- data/vendor/libgit2/include/git2/proxy.h +5 -3
- data/vendor/libgit2/include/git2/rebase.h +46 -2
- data/vendor/libgit2/include/git2/refs.h +34 -16
- data/vendor/libgit2/include/git2/remote.h +111 -14
- data/vendor/libgit2/include/git2/repository.h +69 -34
- data/vendor/libgit2/include/git2/revert.h +1 -1
- data/vendor/libgit2/include/git2/revwalk.h +7 -7
- data/vendor/libgit2/include/git2/signature.h +2 -2
- data/vendor/libgit2/include/git2/stash.h +5 -5
- data/vendor/libgit2/include/git2/status.h +26 -17
- data/vendor/libgit2/include/git2/submodule.h +23 -6
- data/vendor/libgit2/include/git2/sys/alloc.h +18 -18
- data/vendor/libgit2/include/git2/sys/commit.h +1 -1
- data/vendor/libgit2/include/git2/sys/config.h +13 -13
- data/vendor/libgit2/include/git2/sys/cred.h +90 -0
- data/vendor/libgit2/include/git2/sys/filter.h +6 -6
- data/vendor/libgit2/include/git2/sys/merge.h +3 -3
- data/vendor/libgit2/include/git2/sys/odb_backend.h +66 -22
- data/vendor/libgit2/include/git2/sys/path.h +14 -5
- data/vendor/libgit2/include/git2/sys/refdb_backend.h +76 -40
- data/vendor/libgit2/include/git2/sys/repository.h +5 -1
- data/vendor/libgit2/include/git2/sys/stream.h +92 -12
- data/vendor/libgit2/include/git2/sys/transport.h +129 -83
- data/vendor/libgit2/include/git2/tag.h +13 -4
- data/vendor/libgit2/include/git2/trace.h +2 -2
- data/vendor/libgit2/include/git2/transport.h +11 -311
- data/vendor/libgit2/include/git2/tree.h +4 -4
- data/vendor/libgit2/include/git2/types.h +25 -106
- data/vendor/libgit2/include/git2/version.h +3 -3
- data/vendor/libgit2/include/git2/worktree.h +5 -5
- data/vendor/libgit2/include/git2.h +4 -0
- data/vendor/libgit2/src/CMakeLists.txt +104 -235
- data/vendor/libgit2/src/alloc.c +14 -18
- data/vendor/libgit2/src/{stdalloc.c → allocators/stdalloc.c} +7 -8
- data/vendor/libgit2/src/{stdalloc.h → allocators/stdalloc.h} +4 -4
- data/vendor/libgit2/src/allocators/win32_crtdbg.c +118 -0
- data/vendor/libgit2/src/{transports/cred.h → allocators/win32_crtdbg.h} +5 -4
- data/vendor/libgit2/src/annotated_commit.c +18 -11
- data/vendor/libgit2/src/apply.c +535 -28
- data/vendor/libgit2/src/apply.h +3 -1
- data/vendor/libgit2/src/array.h +2 -2
- data/vendor/libgit2/src/attr.c +77 -71
- data/vendor/libgit2/src/attr_file.c +203 -117
- data/vendor/libgit2/src/attr_file.h +9 -9
- data/vendor/libgit2/src/attrcache.c +49 -51
- data/vendor/libgit2/src/attrcache.h +2 -1
- data/vendor/libgit2/src/blame.c +38 -18
- data/vendor/libgit2/src/blame.h +1 -1
- data/vendor/libgit2/src/blame_git.c +29 -15
- data/vendor/libgit2/src/blob.c +123 -37
- data/vendor/libgit2/src/blob.h +19 -2
- data/vendor/libgit2/src/branch.c +47 -23
- data/vendor/libgit2/src/buf_text.c +7 -6
- data/vendor/libgit2/src/buffer.c +60 -53
- data/vendor/libgit2/src/cache.c +38 -45
- data/vendor/libgit2/src/cache.h +3 -3
- data/vendor/libgit2/src/cc-compat.h +20 -3
- data/vendor/libgit2/src/checkout.c +77 -67
- data/vendor/libgit2/src/cherrypick.c +12 -6
- data/vendor/libgit2/src/clone.c +36 -14
- data/vendor/libgit2/src/clone.h +4 -0
- data/vendor/libgit2/src/commit.c +103 -48
- data/vendor/libgit2/src/commit.h +7 -0
- data/vendor/libgit2/src/commit_list.c +36 -78
- data/vendor/libgit2/src/commit_list.h +2 -2
- data/vendor/libgit2/src/common.h +24 -90
- data/vendor/libgit2/src/config.c +203 -176
- data/vendor/libgit2/src/config.h +8 -20
- data/vendor/libgit2/src/config_backend.h +96 -0
- data/vendor/libgit2/src/config_cache.c +41 -35
- data/vendor/libgit2/src/config_entries.c +229 -0
- data/vendor/libgit2/src/config_entries.h +24 -0
- data/vendor/libgit2/src/config_file.c +422 -680
- data/vendor/libgit2/src/config_mem.c +220 -0
- data/vendor/libgit2/src/config_parse.c +96 -68
- data/vendor/libgit2/src/config_parse.h +15 -14
- data/vendor/libgit2/src/config_snapshot.c +206 -0
- data/vendor/libgit2/src/crlf.c +219 -196
- data/vendor/libgit2/src/delta.c +25 -18
- data/vendor/libgit2/src/describe.c +42 -41
- data/vendor/libgit2/src/diff.c +52 -67
- data/vendor/libgit2/src/diff.h +2 -1
- data/vendor/libgit2/src/diff_driver.c +44 -46
- data/vendor/libgit2/src/diff_file.c +16 -14
- data/vendor/libgit2/src/diff_file.h +1 -1
- data/vendor/libgit2/src/diff_generate.c +158 -103
- data/vendor/libgit2/src/diff_generate.h +3 -3
- data/vendor/libgit2/src/diff_parse.c +4 -4
- data/vendor/libgit2/src/diff_print.c +34 -22
- data/vendor/libgit2/src/diff_stats.c +22 -7
- data/vendor/libgit2/src/diff_tform.c +18 -16
- data/vendor/libgit2/src/diff_xdiff.c +3 -3
- data/vendor/libgit2/src/errors.c +51 -39
- data/vendor/libgit2/src/errors.h +81 -0
- data/vendor/libgit2/src/features.h.in +9 -3
- data/vendor/libgit2/src/fetch.c +8 -3
- data/vendor/libgit2/src/fetchhead.c +12 -12
- data/vendor/libgit2/src/filebuf.c +28 -32
- data/vendor/libgit2/src/filebuf.h +2 -2
- data/vendor/libgit2/src/filter.c +47 -33
- data/vendor/libgit2/src/filter.h +0 -10
- data/vendor/libgit2/src/{fileops.c → futils.c} +70 -63
- data/vendor/libgit2/src/{fileops.h → futils.h} +6 -6
- data/vendor/libgit2/src/global.c +35 -55
- data/vendor/libgit2/src/global.h +0 -2
- data/vendor/libgit2/src/hash/sha1/collisiondetect.c +48 -0
- data/vendor/libgit2/src/hash/sha1/collisiondetect.h +19 -0
- data/vendor/libgit2/src/hash/{hash_common_crypto.h → sha1/common_crypto.c} +17 -17
- data/vendor/libgit2/src/hash/sha1/common_crypto.h +19 -0
- data/vendor/libgit2/src/hash/{hash_generic.c → sha1/generic.c} +22 -10
- data/vendor/libgit2/src/hash/{hash_generic.h → sha1/generic.h} +4 -10
- data/vendor/libgit2/src/hash/{hash_mbedtls.c → sha1/mbedtls.c} +15 -7
- data/vendor/libgit2/src/hash/{hash_mbedtls.h → sha1/mbedtls.h} +6 -7
- data/vendor/libgit2/src/hash/sha1/openssl.c +59 -0
- data/vendor/libgit2/src/hash/sha1/openssl.h +19 -0
- data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.c +14 -3
- data/vendor/libgit2/src/hash/{hash_win32.c → sha1/win32.c} +47 -37
- data/vendor/libgit2/src/hash/{hash_win32.h → sha1/win32.h} +6 -19
- data/vendor/libgit2/src/hash/sha1.h +38 -0
- data/vendor/libgit2/src/hash.c +61 -0
- data/vendor/libgit2/src/hash.h +20 -21
- data/vendor/libgit2/src/hashsig.c +5 -5
- data/vendor/libgit2/src/idxmap.c +107 -61
- data/vendor/libgit2/src/idxmap.h +153 -31
- data/vendor/libgit2/src/ignore.c +38 -42
- data/vendor/libgit2/src/index.c +264 -199
- data/vendor/libgit2/src/index.h +7 -1
- data/vendor/libgit2/src/indexer.c +338 -167
- data/vendor/libgit2/src/integer.h +71 -26
- data/vendor/libgit2/src/iterator.c +134 -62
- data/vendor/libgit2/src/iterator.h +15 -0
- data/vendor/libgit2/src/mailmap.c +8 -8
- data/vendor/libgit2/src/map.h +1 -1
- data/vendor/libgit2/src/merge.c +137 -93
- data/vendor/libgit2/src/merge_driver.c +11 -11
- data/vendor/libgit2/src/merge_file.c +2 -2
- data/vendor/libgit2/src/mwindow.c +24 -29
- data/vendor/libgit2/src/mwindow.h +4 -4
- data/vendor/libgit2/src/net.c +184 -0
- data/vendor/libgit2/src/net.h +36 -0
- data/vendor/libgit2/src/netops.c +55 -156
- data/vendor/libgit2/src/netops.h +3 -23
- data/vendor/libgit2/src/notes.c +14 -9
- data/vendor/libgit2/src/object.c +120 -69
- data/vendor/libgit2/src/object.h +22 -9
- data/vendor/libgit2/src/object_api.c +8 -8
- data/vendor/libgit2/src/odb.c +111 -88
- data/vendor/libgit2/src/odb.h +8 -7
- data/vendor/libgit2/src/odb_loose.c +58 -47
- data/vendor/libgit2/src/odb_mempack.c +21 -34
- data/vendor/libgit2/src/odb_pack.c +17 -13
- data/vendor/libgit2/src/offmap.c +53 -35
- data/vendor/libgit2/src/offmap.h +108 -21
- data/vendor/libgit2/src/oid.c +12 -7
- data/vendor/libgit2/src/oidmap.c +49 -47
- data/vendor/libgit2/src/oidmap.h +101 -24
- data/vendor/libgit2/src/pack-objects.c +87 -86
- data/vendor/libgit2/src/pack-objects.h +2 -8
- data/vendor/libgit2/src/pack.c +94 -96
- data/vendor/libgit2/src/pack.h +16 -18
- data/vendor/libgit2/src/parse.c +17 -4
- data/vendor/libgit2/src/parse.h +3 -3
- data/vendor/libgit2/src/patch.c +3 -3
- data/vendor/libgit2/src/patch_generate.c +18 -18
- data/vendor/libgit2/src/patch_parse.c +147 -79
- data/vendor/libgit2/src/path.c +207 -62
- data/vendor/libgit2/src/path.h +14 -0
- data/vendor/libgit2/src/pathspec.c +18 -18
- data/vendor/libgit2/src/pool.c +26 -22
- data/vendor/libgit2/src/pool.h +7 -7
- data/vendor/libgit2/src/posix.c +10 -10
- data/vendor/libgit2/src/posix.h +12 -1
- data/vendor/libgit2/src/proxy.c +8 -3
- data/vendor/libgit2/src/push.c +35 -29
- data/vendor/libgit2/src/push.h +2 -1
- data/vendor/libgit2/src/reader.c +265 -0
- data/vendor/libgit2/src/reader.h +107 -0
- data/vendor/libgit2/src/rebase.c +97 -38
- data/vendor/libgit2/src/refdb.c +15 -3
- data/vendor/libgit2/src/refdb_fs.c +318 -222
- data/vendor/libgit2/src/reflog.c +13 -15
- data/vendor/libgit2/src/refs.c +122 -89
- data/vendor/libgit2/src/refs.h +5 -3
- data/vendor/libgit2/src/refspec.c +27 -33
- data/vendor/libgit2/src/regexp.c +221 -0
- data/vendor/libgit2/src/regexp.h +97 -0
- data/vendor/libgit2/src/remote.c +229 -178
- data/vendor/libgit2/src/remote.h +11 -2
- data/vendor/libgit2/src/repository.c +227 -172
- data/vendor/libgit2/src/repository.h +52 -40
- data/vendor/libgit2/src/reset.c +7 -7
- data/vendor/libgit2/src/revert.c +11 -6
- data/vendor/libgit2/src/revparse.c +46 -46
- data/vendor/libgit2/src/revwalk.c +89 -54
- data/vendor/libgit2/src/revwalk.h +20 -0
- data/vendor/libgit2/src/settings.c +22 -9
- data/vendor/libgit2/src/signature.c +15 -13
- data/vendor/libgit2/src/sortedcache.c +22 -36
- data/vendor/libgit2/src/sortedcache.h +1 -1
- data/vendor/libgit2/src/stash.c +56 -76
- data/vendor/libgit2/src/status.c +27 -21
- data/vendor/libgit2/src/stream.h +17 -2
- data/vendor/libgit2/src/streams/mbedtls.c +100 -80
- data/vendor/libgit2/src/streams/mbedtls.h +5 -2
- data/vendor/libgit2/src/streams/openssl.c +93 -81
- data/vendor/libgit2/src/streams/openssl.h +5 -2
- data/vendor/libgit2/src/streams/registry.c +118 -0
- data/vendor/libgit2/src/streams/registry.h +19 -0
- data/vendor/libgit2/src/streams/socket.c +55 -30
- data/vendor/libgit2/src/streams/stransport.c +57 -32
- data/vendor/libgit2/src/streams/stransport.h +5 -0
- data/vendor/libgit2/src/streams/tls.c +48 -20
- data/vendor/libgit2/src/streams/tls.h +12 -4
- data/vendor/libgit2/src/strmap.c +47 -74
- data/vendor/libgit2/src/strmap.h +108 -33
- data/vendor/libgit2/src/submodule.c +190 -169
- data/vendor/libgit2/src/submodule.h +1 -1
- data/vendor/libgit2/src/sysdir.c +25 -15
- data/vendor/libgit2/src/tag.c +39 -26
- data/vendor/libgit2/src/tag.h +2 -1
- data/vendor/libgit2/src/trace.c +2 -2
- data/vendor/libgit2/src/trace.h +2 -2
- data/vendor/libgit2/src/trailer.c +46 -32
- data/vendor/libgit2/src/transaction.c +30 -29
- data/vendor/libgit2/src/transport.c +3 -3
- data/vendor/libgit2/src/transports/auth.c +14 -10
- data/vendor/libgit2/src/transports/auth.h +10 -3
- data/vendor/libgit2/src/transports/auth_negotiate.c +31 -16
- data/vendor/libgit2/src/transports/auth_negotiate.h +2 -2
- data/vendor/libgit2/src/transports/auth_ntlm.c +223 -0
- data/vendor/libgit2/src/transports/auth_ntlm.h +35 -0
- data/vendor/libgit2/src/transports/cred.c +24 -24
- data/vendor/libgit2/src/transports/git.c +25 -30
- data/vendor/libgit2/src/transports/http.c +871 -335
- data/vendor/libgit2/src/transports/http.h +2 -0
- data/vendor/libgit2/src/transports/local.c +28 -28
- data/vendor/libgit2/src/transports/smart.c +64 -46
- data/vendor/libgit2/src/transports/smart.h +5 -6
- data/vendor/libgit2/src/transports/smart_pkt.c +162 -151
- data/vendor/libgit2/src/transports/smart_protocol.c +64 -94
- data/vendor/libgit2/src/transports/ssh.c +76 -65
- data/vendor/libgit2/src/transports/winhttp.c +328 -319
- data/vendor/libgit2/src/tree-cache.c +21 -14
- data/vendor/libgit2/src/tree.c +119 -112
- data/vendor/libgit2/src/tree.h +1 -0
- data/vendor/libgit2/src/unix/map.c +3 -3
- data/vendor/libgit2/src/unix/posix.h +1 -11
- data/vendor/libgit2/src/userdiff.h +3 -1
- data/vendor/libgit2/src/util.c +154 -93
- data/vendor/libgit2/src/util.h +19 -23
- data/vendor/libgit2/src/vector.c +15 -10
- data/vendor/libgit2/src/wildmatch.c +320 -0
- data/vendor/libgit2/src/wildmatch.h +23 -0
- data/vendor/libgit2/src/win32/dir.c +3 -3
- data/vendor/libgit2/src/win32/findfile.c +1 -1
- data/vendor/libgit2/src/win32/map.c +9 -11
- data/vendor/libgit2/src/win32/msvc-compat.h +6 -0
- data/vendor/libgit2/src/win32/path_w32.c +113 -9
- data/vendor/libgit2/src/win32/path_w32.h +18 -29
- data/vendor/libgit2/src/win32/posix.h +1 -4
- data/vendor/libgit2/src/win32/posix_w32.c +69 -44
- data/vendor/libgit2/src/win32/precompiled.h +0 -2
- data/vendor/libgit2/src/win32/thread.c +5 -10
- data/vendor/libgit2/src/win32/w32_buffer.c +9 -5
- data/vendor/libgit2/src/win32/w32_common.h +39 -0
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +2 -95
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +0 -2
- data/vendor/libgit2/src/win32/w32_stack.c +6 -11
- data/vendor/libgit2/src/win32/w32_stack.h +3 -3
- data/vendor/libgit2/src/win32/w32_util.c +27 -64
- data/vendor/libgit2/src/win32/w32_util.h +5 -49
- data/vendor/libgit2/src/worktree.c +44 -30
- data/vendor/libgit2/src/xdiff/xdiffi.c +5 -5
- data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
- data/vendor/libgit2/src/xdiff/xmerge.c +27 -15
- data/vendor/libgit2/src/xdiff/xpatience.c +3 -0
- data/vendor/libgit2/src/zstream.c +4 -4
- metadata +115 -38
- data/vendor/libgit2/deps/regex/CMakeLists.txt +0 -2
- data/vendor/libgit2/deps/regex/config.h +0 -7
- data/vendor/libgit2/deps/regex/regcomp.c +0 -3857
- data/vendor/libgit2/deps/regex/regex.c +0 -92
- data/vendor/libgit2/deps/regex/regex.h +0 -582
- data/vendor/libgit2/deps/regex/regex_internal.c +0 -1744
- data/vendor/libgit2/deps/regex/regex_internal.h +0 -819
- data/vendor/libgit2/deps/regex/regexec.c +0 -4369
- data/vendor/libgit2/include/git2/inttypes.h +0 -309
- data/vendor/libgit2/include/git2/sys/time.h +0 -31
- data/vendor/libgit2/libgit2.pc.in +0 -13
- data/vendor/libgit2/src/config_file.h +0 -73
- data/vendor/libgit2/src/fnmatch.c +0 -248
- data/vendor/libgit2/src/fnmatch.h +0 -48
- data/vendor/libgit2/src/hash/hash_collisiondetect.h +0 -47
- data/vendor/libgit2/src/hash/hash_openssl.h +0 -59
- data/vendor/libgit2/src/streams/curl.c +0 -385
- data/vendor/libgit2/src/streams/curl.h +0 -17
- /data/vendor/libgit2/deps/http-parser/{LICENSE-MIT → COPYING} +0 -0
- /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.h +0 -0
- /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.c +0 -0
- /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.h +0 -0
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
#include "diff.h"
|
|
11
11
|
#include "patch_generate.h"
|
|
12
|
-
#include "
|
|
12
|
+
#include "futils.h"
|
|
13
13
|
#include "config.h"
|
|
14
14
|
#include "attr_file.h"
|
|
15
15
|
#include "filter.h"
|
|
@@ -81,7 +81,7 @@ static int diff_insert_delta(
|
|
|
81
81
|
if (error > 0) /* positive value means to skip this delta */
|
|
82
82
|
return 0;
|
|
83
83
|
else /* negative value means to cancel diff */
|
|
84
|
-
return
|
|
84
|
+
return git_error_set_after_callback_function(error, "git_diff");
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -138,7 +138,7 @@ static int diff_delta__from_one(
|
|
|
138
138
|
if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_REVERSE))
|
|
139
139
|
has_old = !has_old;
|
|
140
140
|
|
|
141
|
-
if ((entry->flags &
|
|
141
|
+
if ((entry->flags & GIT_INDEX_ENTRY_VALID) != 0)
|
|
142
142
|
return 0;
|
|
143
143
|
|
|
144
144
|
if (status == GIT_DELTA_IGNORED &&
|
|
@@ -157,7 +157,7 @@ static int diff_delta__from_one(
|
|
|
157
157
|
return 0;
|
|
158
158
|
|
|
159
159
|
delta = diff_delta__alloc(diff, status, entry->path);
|
|
160
|
-
|
|
160
|
+
GIT_ERROR_CHECK_ALLOC(delta);
|
|
161
161
|
|
|
162
162
|
/* This fn is just for single-sided diffs */
|
|
163
163
|
assert(status != GIT_DELTA_MODIFIED);
|
|
@@ -179,7 +179,7 @@ static int diff_delta__from_one(
|
|
|
179
179
|
|
|
180
180
|
delta->old_file.flags |= GIT_DIFF_FLAG_VALID_ID;
|
|
181
181
|
|
|
182
|
-
if (has_old || !
|
|
182
|
+
if (has_old || !git_oid_is_zero(&delta->new_file.id))
|
|
183
183
|
delta->new_file.flags |= GIT_DIFF_FLAG_VALID_ID;
|
|
184
184
|
|
|
185
185
|
return diff_insert_delta(diff, delta, matched_pathspec);
|
|
@@ -220,7 +220,7 @@ static int diff_delta__from_two(
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
delta = diff_delta__alloc(diff, status, canonical_path);
|
|
223
|
-
|
|
223
|
+
GIT_ERROR_CHECK_ALLOC(delta);
|
|
224
224
|
delta->nfiles = 2;
|
|
225
225
|
|
|
226
226
|
if (!git_index_entry_is_conflict(old_entry)) {
|
|
@@ -240,7 +240,7 @@ static int diff_delta__from_two(
|
|
|
240
240
|
delta->old_file.flags |= GIT_DIFF_FLAG_EXISTS;
|
|
241
241
|
delta->new_file.flags |= GIT_DIFF_FLAG_EXISTS;
|
|
242
242
|
|
|
243
|
-
if (!
|
|
243
|
+
if (!git_oid_is_zero(&new_entry->id))
|
|
244
244
|
delta->new_file.flags |= GIT_DIFF_FLAG_VALID_ID;
|
|
245
245
|
}
|
|
246
246
|
|
|
@@ -472,17 +472,17 @@ static int diff_generated_apply_options(
|
|
|
472
472
|
if ((val = git_repository_config_snapshot(&cfg, repo)) < 0)
|
|
473
473
|
return val;
|
|
474
474
|
|
|
475
|
-
if (!
|
|
475
|
+
if (!git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_SYMLINKS) && val)
|
|
476
476
|
diff->diffcaps |= GIT_DIFFCAPS_HAS_SYMLINKS;
|
|
477
477
|
|
|
478
|
-
if (!
|
|
478
|
+
if (!git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_IGNORESTAT) && val)
|
|
479
479
|
diff->diffcaps |= GIT_DIFFCAPS_IGNORE_STAT;
|
|
480
480
|
|
|
481
481
|
if ((diff->base.opts.flags & GIT_DIFF_IGNORE_FILEMODE) == 0 &&
|
|
482
|
-
!
|
|
482
|
+
!git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_FILEMODE) && val)
|
|
483
483
|
diff->diffcaps |= GIT_DIFFCAPS_TRUST_MODE_BITS;
|
|
484
484
|
|
|
485
|
-
if (!
|
|
485
|
+
if (!git_config__configmap_lookup(&val, cfg, GIT_CONFIGMAP_TRUSTCTIME) && val)
|
|
486
486
|
diff->diffcaps |= GIT_DIFFCAPS_TRUST_CTIME;
|
|
487
487
|
|
|
488
488
|
/* Don't set GIT_DIFFCAPS_USE_DEV - compile time option in core git */
|
|
@@ -517,7 +517,7 @@ static int diff_generated_apply_options(
|
|
|
517
517
|
|
|
518
518
|
if (entry && git_submodule_parse_ignore(
|
|
519
519
|
&diff->base.opts.ignore_submodules, entry->value) < 0)
|
|
520
|
-
|
|
520
|
+
git_error_clear();
|
|
521
521
|
git_config_entry_free(entry);
|
|
522
522
|
}
|
|
523
523
|
|
|
@@ -560,13 +560,18 @@ int git_diff__oid_for_file(
|
|
|
560
560
|
git_diff *diff,
|
|
561
561
|
const char *path,
|
|
562
562
|
uint16_t mode,
|
|
563
|
-
|
|
563
|
+
git_object_size_t size)
|
|
564
564
|
{
|
|
565
565
|
git_index_entry entry;
|
|
566
566
|
|
|
567
|
+
if (size > UINT32_MAX) {
|
|
568
|
+
git_error_set(GIT_ERROR_NOMEMORY, "file size overflow (for 32-bits) on '%s'", path);
|
|
569
|
+
return -1;
|
|
570
|
+
}
|
|
571
|
+
|
|
567
572
|
memset(&entry, 0, sizeof(entry));
|
|
568
573
|
entry.mode = mode;
|
|
569
|
-
entry.file_size = size;
|
|
574
|
+
entry.file_size = (uint32_t)size;
|
|
570
575
|
entry.path = (char *)path;
|
|
571
576
|
|
|
572
577
|
return git_diff__oid_for_entry(out, diff, &entry, mode, NULL);
|
|
@@ -622,13 +627,13 @@ int git_diff__oid_for_entry(
|
|
|
622
627
|
/* if submodule lookup failed probably just in an intermediate
|
|
623
628
|
* state where some init hasn't happened, so ignore the error
|
|
624
629
|
*/
|
|
625
|
-
|
|
630
|
+
git_error_clear();
|
|
626
631
|
}
|
|
627
632
|
} else if (S_ISLNK(mode)) {
|
|
628
633
|
error = git_odb__hashlink(out, full_path.ptr);
|
|
629
634
|
diff->base.perf.oid_calculations++;
|
|
630
635
|
} else if (!git__is_sizet(entry.file_size)) {
|
|
631
|
-
|
|
636
|
+
git_error_set(GIT_ERROR_NOMEMORY, "file size overflow (for 32-bits) on '%s'",
|
|
632
637
|
entry.path);
|
|
633
638
|
error = -1;
|
|
634
639
|
} else if (!(error = git_filter_list_load(&fl,
|
|
@@ -640,7 +645,7 @@ int git_diff__oid_for_entry(
|
|
|
640
645
|
error = fd;
|
|
641
646
|
else {
|
|
642
647
|
error = git_odb__hashfd_filtered(
|
|
643
|
-
out, fd, (size_t)entry.file_size,
|
|
648
|
+
out, fd, (size_t)entry.file_size, GIT_OBJECT_BLOB, fl);
|
|
644
649
|
p_close(fd);
|
|
645
650
|
diff->base.perf.oid_calculations++;
|
|
646
651
|
}
|
|
@@ -700,7 +705,7 @@ static int maybe_modified_submodule(
|
|
|
700
705
|
|
|
701
706
|
/* GIT_EEXISTS means dir with .git in it was found - ignore it */
|
|
702
707
|
if (error == GIT_EEXISTS) {
|
|
703
|
-
|
|
708
|
+
git_error_clear();
|
|
704
709
|
error = 0;
|
|
705
710
|
}
|
|
706
711
|
return error;
|
|
@@ -764,11 +769,11 @@ static int maybe_modified(
|
|
|
764
769
|
status = GIT_DELTA_CONFLICTED;
|
|
765
770
|
|
|
766
771
|
/* support "assume unchanged" (poorly, b/c we still stat everything) */
|
|
767
|
-
} else if ((oitem->flags &
|
|
772
|
+
} else if ((oitem->flags & GIT_INDEX_ENTRY_VALID) != 0) {
|
|
768
773
|
status = GIT_DELTA_UNMODIFIED;
|
|
769
774
|
|
|
770
775
|
/* support "skip worktree" index bit */
|
|
771
|
-
} else if ((oitem->flags_extended &
|
|
776
|
+
} else if ((oitem->flags_extended & GIT_INDEX_ENTRY_SKIP_WORKTREE) != 0) {
|
|
772
777
|
status = GIT_DELTA_UNMODIFIED;
|
|
773
778
|
|
|
774
779
|
/* if basic type of file changed, then split into delete and add */
|
|
@@ -792,13 +797,13 @@ static int maybe_modified(
|
|
|
792
797
|
/* if oids and modes match (and are valid), then file is unmodified */
|
|
793
798
|
} else if (git_oid_equal(&oitem->id, &nitem->id) &&
|
|
794
799
|
omode == nmode &&
|
|
795
|
-
!
|
|
800
|
+
!git_oid_is_zero(&oitem->id)) {
|
|
796
801
|
status = GIT_DELTA_UNMODIFIED;
|
|
797
802
|
|
|
798
803
|
/* if we have an unknown OID and a workdir iterator, then check some
|
|
799
804
|
* circumstances that can accelerate things or need special handling
|
|
800
805
|
*/
|
|
801
|
-
} else if (
|
|
806
|
+
} else if (git_oid_is_zero(&nitem->id) && new_is_workdir) {
|
|
802
807
|
bool use_ctime =
|
|
803
808
|
((diff->diffcaps & GIT_DIFFCAPS_TRUST_CTIME) != 0);
|
|
804
809
|
git_index *index = git_iterator_index(info->new_iter);
|
|
@@ -838,7 +843,7 @@ static int maybe_modified(
|
|
|
838
843
|
/* if we got here and decided that the files are modified, but we
|
|
839
844
|
* haven't calculated the OID of the new item, then calculate it now
|
|
840
845
|
*/
|
|
841
|
-
if (modified_uncertain &&
|
|
846
|
+
if (modified_uncertain && git_oid_is_zero(&nitem->id)) {
|
|
842
847
|
const git_oid *update_check =
|
|
843
848
|
DIFF_FLAG_IS_SET(diff, GIT_DIFF_UPDATE_INDEX) && omode == nmode ?
|
|
844
849
|
&oitem->id : NULL;
|
|
@@ -872,7 +877,7 @@ static int maybe_modified(
|
|
|
872
877
|
|
|
873
878
|
return diff_delta__from_two(
|
|
874
879
|
diff, status, oitem, omode, nitem, nmode,
|
|
875
|
-
|
|
880
|
+
git_oid_is_zero(&noid) ? NULL : &noid, matched_pathspec);
|
|
876
881
|
}
|
|
877
882
|
|
|
878
883
|
static bool entry_is_prefixed(
|
|
@@ -1060,7 +1065,7 @@ static int handle_unmatched_new_item(
|
|
|
1060
1065
|
|
|
1061
1066
|
/* if directory is empty, can't advance into it, so skip it */
|
|
1062
1067
|
if (error == GIT_ENOTFOUND) {
|
|
1063
|
-
|
|
1068
|
+
git_error_clear();
|
|
1064
1069
|
error = iterator_advance(&info->nitem, info->new_iter);
|
|
1065
1070
|
}
|
|
1066
1071
|
|
|
@@ -1082,7 +1087,7 @@ static int handle_unmatched_new_item(
|
|
|
1082
1087
|
else if (nitem->mode == GIT_FILEMODE_COMMIT) {
|
|
1083
1088
|
/* ignore things that are not actual submodules */
|
|
1084
1089
|
if (git_submodule_lookup(NULL, info->repo, nitem->path) != 0) {
|
|
1085
|
-
|
|
1090
|
+
git_error_clear();
|
|
1086
1091
|
delta_type = GIT_DELTA_IGNORED;
|
|
1087
1092
|
|
|
1088
1093
|
/* if this contains a tracked item, treat as normal TREE */
|
|
@@ -1091,7 +1096,7 @@ static int handle_unmatched_new_item(
|
|
|
1091
1096
|
if (error != GIT_ENOTFOUND)
|
|
1092
1097
|
return error;
|
|
1093
1098
|
|
|
1094
|
-
|
|
1099
|
+
git_error_clear();
|
|
1095
1100
|
return iterator_advance(&info->nitem, info->new_iter);
|
|
1096
1101
|
}
|
|
1097
1102
|
}
|
|
@@ -1192,7 +1197,7 @@ int git_diff__from_iterators(
|
|
|
1192
1197
|
*out = NULL;
|
|
1193
1198
|
|
|
1194
1199
|
diff = diff_generated_alloc(repo, old_iter, new_iter);
|
|
1195
|
-
|
|
1200
|
+
GIT_ERROR_CHECK_ALLOC(diff);
|
|
1196
1201
|
|
|
1197
1202
|
info.repo = repo;
|
|
1198
1203
|
info.old_iter = old_iter;
|
|
@@ -1257,29 +1262,31 @@ cleanup:
|
|
|
1257
1262
|
return error;
|
|
1258
1263
|
}
|
|
1259
1264
|
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1265
|
+
static int diff_prepare_iterator_opts(char **prefix, git_iterator_options *a, int aflags,
|
|
1266
|
+
git_iterator_options *b, int bflags,
|
|
1267
|
+
const git_diff_options *opts)
|
|
1268
|
+
{
|
|
1269
|
+
GIT_ERROR_CHECK_VERSION(opts, GIT_DIFF_OPTIONS_VERSION, "git_diff_options");
|
|
1270
|
+
|
|
1271
|
+
*prefix = NULL;
|
|
1272
|
+
|
|
1273
|
+
if (opts && (opts->flags & GIT_DIFF_DISABLE_PATHSPEC_MATCH)) {
|
|
1274
|
+
a->pathlist.strings = opts->pathspec.strings;
|
|
1275
|
+
a->pathlist.count = opts->pathspec.count;
|
|
1276
|
+
b->pathlist.strings = opts->pathspec.strings;
|
|
1277
|
+
b->pathlist.count = opts->pathspec.count;
|
|
1278
|
+
} else if (opts) {
|
|
1279
|
+
*prefix = git_pathspec_prefix(&opts->pathspec);
|
|
1280
|
+
GIT_ERROR_CHECK_ALLOC(prefix);
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
a->flags = aflags;
|
|
1284
|
+
b->flags = bflags;
|
|
1285
|
+
a->start = b->start = *prefix;
|
|
1286
|
+
a->end = b->end = *prefix;
|
|
1287
|
+
|
|
1288
|
+
return 0;
|
|
1289
|
+
}
|
|
1283
1290
|
|
|
1284
1291
|
int git_diff_tree_to_tree(
|
|
1285
1292
|
git_diff **out,
|
|
@@ -1288,8 +1295,12 @@ int git_diff_tree_to_tree(
|
|
|
1288
1295
|
git_tree *new_tree,
|
|
1289
1296
|
const git_diff_options *opts)
|
|
1290
1297
|
{
|
|
1291
|
-
git_diff *diff = NULL;
|
|
1292
1298
|
git_iterator_flag_t iflag = GIT_ITERATOR_DONT_IGNORE_CASE;
|
|
1299
|
+
git_iterator_options a_opts = GIT_ITERATOR_OPTIONS_INIT,
|
|
1300
|
+
b_opts = GIT_ITERATOR_OPTIONS_INIT;
|
|
1301
|
+
git_iterator *a = NULL, *b = NULL;
|
|
1302
|
+
git_diff *diff = NULL;
|
|
1303
|
+
char *prefix = NULL;
|
|
1293
1304
|
int error = 0;
|
|
1294
1305
|
|
|
1295
1306
|
assert(out && repo);
|
|
@@ -1303,13 +1314,19 @@ int git_diff_tree_to_tree(
|
|
|
1303
1314
|
if (opts && (opts->flags & GIT_DIFF_IGNORE_CASE) != 0)
|
|
1304
1315
|
iflag = GIT_ITERATOR_IGNORE_CASE;
|
|
1305
1316
|
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1317
|
+
if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, iflag, &b_opts, iflag, opts)) < 0 ||
|
|
1318
|
+
(error = git_iterator_for_tree(&a, old_tree, &a_opts)) < 0 ||
|
|
1319
|
+
(error = git_iterator_for_tree(&b, new_tree, &b_opts)) < 0 ||
|
|
1320
|
+
(error = git_diff__from_iterators(&diff, repo, a, b, opts)) < 0)
|
|
1321
|
+
goto out;
|
|
1310
1322
|
|
|
1311
|
-
|
|
1312
|
-
|
|
1323
|
+
*out = diff;
|
|
1324
|
+
diff = NULL;
|
|
1325
|
+
out:
|
|
1326
|
+
git_iterator_free(a);
|
|
1327
|
+
git_iterator_free(b);
|
|
1328
|
+
git_diff_free(diff);
|
|
1329
|
+
git__free(prefix);
|
|
1313
1330
|
|
|
1314
1331
|
return error;
|
|
1315
1332
|
}
|
|
@@ -1320,7 +1337,7 @@ static int diff_load_index(git_index **index, git_repository *repo)
|
|
|
1320
1337
|
|
|
1321
1338
|
/* reload the repository index when user did not pass one in */
|
|
1322
1339
|
if (!error && git_index_read(*index, false) < 0)
|
|
1323
|
-
|
|
1340
|
+
git_error_clear();
|
|
1324
1341
|
|
|
1325
1342
|
return error;
|
|
1326
1343
|
}
|
|
@@ -1332,9 +1349,13 @@ int git_diff_tree_to_index(
|
|
|
1332
1349
|
git_index *index,
|
|
1333
1350
|
const git_diff_options *opts)
|
|
1334
1351
|
{
|
|
1335
|
-
git_diff *diff = NULL;
|
|
1336
1352
|
git_iterator_flag_t iflag = GIT_ITERATOR_DONT_IGNORE_CASE |
|
|
1337
1353
|
GIT_ITERATOR_INCLUDE_CONFLICTS;
|
|
1354
|
+
git_iterator_options a_opts = GIT_ITERATOR_OPTIONS_INIT,
|
|
1355
|
+
b_opts = GIT_ITERATOR_OPTIONS_INIT;
|
|
1356
|
+
git_iterator *a = NULL, *b = NULL;
|
|
1357
|
+
git_diff *diff = NULL;
|
|
1358
|
+
char *prefix = NULL;
|
|
1338
1359
|
bool index_ignore_case = false;
|
|
1339
1360
|
int error = 0;
|
|
1340
1361
|
|
|
@@ -1347,17 +1368,23 @@ int git_diff_tree_to_index(
|
|
|
1347
1368
|
|
|
1348
1369
|
index_ignore_case = index->ignore_case;
|
|
1349
1370
|
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1371
|
+
if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, iflag, &b_opts, iflag, opts)) < 0 ||
|
|
1372
|
+
(error = git_iterator_for_tree(&a, old_tree, &a_opts)) < 0 ||
|
|
1373
|
+
(error = git_iterator_for_index(&b, repo, index, &b_opts)) < 0 ||
|
|
1374
|
+
(error = git_diff__from_iterators(&diff, repo, a, b, opts)) < 0)
|
|
1375
|
+
goto out;
|
|
1354
1376
|
|
|
1355
1377
|
/* if index is in case-insensitive order, re-sort deltas to match */
|
|
1356
|
-
if (
|
|
1378
|
+
if (index_ignore_case)
|
|
1357
1379
|
git_diff__set_ignore_case(diff, true);
|
|
1358
1380
|
|
|
1359
|
-
|
|
1360
|
-
|
|
1381
|
+
*out = diff;
|
|
1382
|
+
diff = NULL;
|
|
1383
|
+
out:
|
|
1384
|
+
git_iterator_free(a);
|
|
1385
|
+
git_iterator_free(b);
|
|
1386
|
+
git_diff_free(diff);
|
|
1387
|
+
git__free(prefix);
|
|
1361
1388
|
|
|
1362
1389
|
return error;
|
|
1363
1390
|
}
|
|
@@ -1368,7 +1395,11 @@ int git_diff_index_to_workdir(
|
|
|
1368
1395
|
git_index *index,
|
|
1369
1396
|
const git_diff_options *opts)
|
|
1370
1397
|
{
|
|
1398
|
+
git_iterator_options a_opts = GIT_ITERATOR_OPTIONS_INIT,
|
|
1399
|
+
b_opts = GIT_ITERATOR_OPTIONS_INIT;
|
|
1400
|
+
git_iterator *a = NULL, *b = NULL;
|
|
1371
1401
|
git_diff *diff = NULL;
|
|
1402
|
+
char *prefix = NULL;
|
|
1372
1403
|
int error = 0;
|
|
1373
1404
|
|
|
1374
1405
|
assert(out && repo);
|
|
@@ -1378,20 +1409,24 @@ int git_diff_index_to_workdir(
|
|
|
1378
1409
|
if (!index && (error = diff_load_index(&index, repo)) < 0)
|
|
1379
1410
|
return error;
|
|
1380
1411
|
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1412
|
+
if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, GIT_ITERATOR_INCLUDE_CONFLICTS,
|
|
1413
|
+
&b_opts, GIT_ITERATOR_DONT_AUTOEXPAND, opts)) < 0 ||
|
|
1414
|
+
(error = git_iterator_for_index(&a, repo, index, &a_opts)) < 0 ||
|
|
1415
|
+
(error = git_iterator_for_workdir(&b, repo, index, NULL, &b_opts)) < 0 ||
|
|
1416
|
+
(error = git_diff__from_iterators(&diff, repo, a, b, opts)) < 0)
|
|
1417
|
+
goto out;
|
|
1418
|
+
|
|
1419
|
+
if ((diff->opts.flags & GIT_DIFF_UPDATE_INDEX) && ((git_diff_generated *)diff)->index_updated)
|
|
1420
|
+
if ((error = git_index_write(index)) < 0)
|
|
1421
|
+
goto out;
|
|
1422
|
+
|
|
1423
|
+
*out = diff;
|
|
1424
|
+
diff = NULL;
|
|
1425
|
+
out:
|
|
1426
|
+
git_iterator_free(a);
|
|
1427
|
+
git_iterator_free(b);
|
|
1428
|
+
git_diff_free(diff);
|
|
1429
|
+
git__free(prefix);
|
|
1395
1430
|
|
|
1396
1431
|
return error;
|
|
1397
1432
|
}
|
|
@@ -1402,24 +1437,33 @@ int git_diff_tree_to_workdir(
|
|
|
1402
1437
|
git_tree *old_tree,
|
|
1403
1438
|
const git_diff_options *opts)
|
|
1404
1439
|
{
|
|
1440
|
+
git_iterator_options a_opts = GIT_ITERATOR_OPTIONS_INIT,
|
|
1441
|
+
b_opts = GIT_ITERATOR_OPTIONS_INIT;
|
|
1442
|
+
git_iterator *a = NULL, *b = NULL;
|
|
1405
1443
|
git_diff *diff = NULL;
|
|
1444
|
+
char *prefix = NULL;
|
|
1406
1445
|
git_index *index;
|
|
1407
|
-
int error
|
|
1446
|
+
int error;
|
|
1408
1447
|
|
|
1409
1448
|
assert(out && repo);
|
|
1410
1449
|
|
|
1411
1450
|
*out = NULL;
|
|
1412
1451
|
|
|
1413
|
-
if ((error =
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1452
|
+
if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, 0,
|
|
1453
|
+
&b_opts, GIT_ITERATOR_DONT_AUTOEXPAND, opts) < 0) ||
|
|
1454
|
+
(error = git_repository_index__weakptr(&index, repo)) < 0 ||
|
|
1455
|
+
(error = git_iterator_for_tree(&a, old_tree, &a_opts)) < 0 ||
|
|
1456
|
+
(error = git_iterator_for_workdir(&b, repo, index, old_tree, &b_opts)) < 0 ||
|
|
1457
|
+
(error = git_diff__from_iterators(&diff, repo, a, b, opts)) < 0)
|
|
1458
|
+
goto out;
|
|
1459
|
+
|
|
1460
|
+
*out = diff;
|
|
1461
|
+
diff = NULL;
|
|
1462
|
+
out:
|
|
1463
|
+
git_iterator_free(a);
|
|
1464
|
+
git_iterator_free(b);
|
|
1465
|
+
git_diff_free(diff);
|
|
1466
|
+
git__free(prefix);
|
|
1423
1467
|
|
|
1424
1468
|
return error;
|
|
1425
1469
|
}
|
|
@@ -1463,24 +1507,35 @@ int git_diff_index_to_index(
|
|
|
1463
1507
|
git_index *new_index,
|
|
1464
1508
|
const git_diff_options *opts)
|
|
1465
1509
|
{
|
|
1466
|
-
|
|
1467
|
-
|
|
1510
|
+
git_iterator_options a_opts = GIT_ITERATOR_OPTIONS_INIT,
|
|
1511
|
+
b_opts = GIT_ITERATOR_OPTIONS_INIT;
|
|
1512
|
+
git_iterator *a = NULL, *b = NULL;
|
|
1513
|
+
git_diff *diff = NULL;
|
|
1514
|
+
char *prefix = NULL;
|
|
1515
|
+
int error;
|
|
1468
1516
|
|
|
1469
1517
|
assert(out && old_index && new_index);
|
|
1470
1518
|
|
|
1471
1519
|
*out = NULL;
|
|
1472
1520
|
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1521
|
+
if ((error = diff_prepare_iterator_opts(&prefix, &a_opts, GIT_ITERATOR_DONT_IGNORE_CASE,
|
|
1522
|
+
&b_opts, GIT_ITERATOR_DONT_IGNORE_CASE, opts) < 0) ||
|
|
1523
|
+
(error = git_iterator_for_index(&a, repo, old_index, &a_opts)) < 0 ||
|
|
1524
|
+
(error = git_iterator_for_index(&b, repo, new_index, &b_opts)) < 0 ||
|
|
1525
|
+
(error = git_diff__from_iterators(&diff, repo, a, b, opts)) < 0)
|
|
1526
|
+
goto out;
|
|
1477
1527
|
|
|
1478
1528
|
/* if index is in case-insensitive order, re-sort deltas to match */
|
|
1479
|
-
if (
|
|
1529
|
+
if (old_index->ignore_case || new_index->ignore_case)
|
|
1480
1530
|
git_diff__set_ignore_case(diff, true);
|
|
1481
1531
|
|
|
1482
|
-
|
|
1483
|
-
|
|
1532
|
+
*out = diff;
|
|
1533
|
+
diff = NULL;
|
|
1534
|
+
out:
|
|
1535
|
+
git_iterator_free(a);
|
|
1536
|
+
git_iterator_free(b);
|
|
1537
|
+
git_diff_free(diff);
|
|
1538
|
+
git__free(prefix);
|
|
1484
1539
|
|
|
1485
1540
|
return error;
|
|
1486
1541
|
}
|
|
@@ -1552,7 +1607,7 @@ int git_diff__paired_foreach(
|
|
|
1552
1607
|
}
|
|
1553
1608
|
|
|
1554
1609
|
if ((error = cb(h2i, i2w, payload)) != 0) {
|
|
1555
|
-
|
|
1610
|
+
git_error_set_after_callback(error);
|
|
1556
1611
|
break;
|
|
1557
1612
|
}
|
|
1558
1613
|
}
|
|
@@ -1591,7 +1646,7 @@ int git_diff__commit(
|
|
|
1591
1646
|
char commit_oidstr[GIT_OID_HEXSZ + 1];
|
|
1592
1647
|
|
|
1593
1648
|
error = -1;
|
|
1594
|
-
|
|
1649
|
+
git_error_set(GIT_ERROR_INVALID, "commit %s is a merge commit",
|
|
1595
1650
|
git_oid_tostr(commit_oidstr, GIT_OID_HEXSZ + 1, git_commit_id(commit)));
|
|
1596
1651
|
goto on_error;
|
|
1597
1652
|
}
|
|
@@ -88,7 +88,7 @@ extern int git_diff__oid_for_file(
|
|
|
88
88
|
git_diff *diff,
|
|
89
89
|
const char *path,
|
|
90
90
|
uint16_t mode,
|
|
91
|
-
|
|
91
|
+
git_object_size_t size);
|
|
92
92
|
|
|
93
93
|
extern int git_diff__oid_for_entry(
|
|
94
94
|
git_oid *out,
|
|
@@ -109,7 +109,7 @@ GIT_INLINE(int) git_diff_file__resolve_zero_size(
|
|
|
109
109
|
int error;
|
|
110
110
|
git_odb *odb;
|
|
111
111
|
size_t len;
|
|
112
|
-
|
|
112
|
+
git_object_t type;
|
|
113
113
|
|
|
114
114
|
if ((error = git_repository_odb(&odb, repo)) < 0)
|
|
115
115
|
return error;
|
|
@@ -120,7 +120,7 @@ GIT_INLINE(int) git_diff_file__resolve_zero_size(
|
|
|
120
120
|
git_odb_free(odb);
|
|
121
121
|
|
|
122
122
|
if (!error)
|
|
123
|
-
file->size = (
|
|
123
|
+
file->size = (git_object_size_t)len;
|
|
124
124
|
|
|
125
125
|
return error;
|
|
126
126
|
}
|
|
@@ -45,7 +45,7 @@ static git_diff_parsed *diff_parsed_alloc(void)
|
|
|
45
45
|
diff->base.patch_fn = git_patch_parsed_from_diff;
|
|
46
46
|
diff->base.free_fn = diff_parsed_free;
|
|
47
47
|
|
|
48
|
-
if (
|
|
48
|
+
if (git_diff_options_init(&diff->base.opts, GIT_DIFF_OPTIONS_VERSION) < 0) {
|
|
49
49
|
git__free(diff);
|
|
50
50
|
return NULL;
|
|
51
51
|
}
|
|
@@ -78,10 +78,10 @@ int git_diff_from_buffer(
|
|
|
78
78
|
*out = NULL;
|
|
79
79
|
|
|
80
80
|
diff = diff_parsed_alloc();
|
|
81
|
-
|
|
81
|
+
GIT_ERROR_CHECK_ALLOC(diff);
|
|
82
82
|
|
|
83
83
|
ctx = git_patch_parse_ctx_init(content, content_len, NULL);
|
|
84
|
-
|
|
84
|
+
GIT_ERROR_CHECK_ALLOC(ctx);
|
|
85
85
|
|
|
86
86
|
while (ctx->parse_ctx.remain_len) {
|
|
87
87
|
if ((error = git_patch_parse(&patch, ctx)) < 0)
|
|
@@ -92,7 +92,7 @@ int git_diff_from_buffer(
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
if (error == GIT_ENOTFOUND && git_vector_length(&diff->patches) > 0) {
|
|
95
|
-
|
|
95
|
+
git_error_clear();
|
|
96
96
|
error = 0;
|
|
97
97
|
}
|
|
98
98
|
|