rugged 0.27.10 → 0.27.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/AUTHORS +0 -1
- data/vendor/libgit2/CMakeLists.txt +54 -98
- data/vendor/libgit2/COPYING +0 -28
- data/vendor/libgit2/cmake/Modules/AddCFlagIfSupported.cmake +1 -15
- data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +8 -9
- data/vendor/libgit2/cmake/Modules/FindCoreFoundation.cmake +2 -2
- data/vendor/libgit2/cmake/Modules/FindGSSAPI.cmake +1 -1
- data/vendor/libgit2/cmake/Modules/FindSecurity.cmake +2 -2
- data/vendor/libgit2/cmake/Modules/FindStatNsec.cmake +0 -6
- data/vendor/libgit2/deps/http-parser/CMakeLists.txt +0 -2
- data/vendor/libgit2/deps/http-parser/{COPYING → LICENSE-MIT} +0 -0
- data/vendor/libgit2/deps/http-parser/http_parser.c +6 -11
- data/vendor/libgit2/deps/regex/CMakeLists.txt +2 -0
- data/vendor/libgit2/deps/regex/config.h +7 -0
- data/vendor/libgit2/deps/regex/regcomp.c +3857 -0
- data/vendor/libgit2/deps/regex/regex.c +92 -0
- data/vendor/libgit2/deps/regex/regex.h +582 -0
- data/vendor/libgit2/deps/regex/regex_internal.c +1744 -0
- data/vendor/libgit2/deps/regex/regex_internal.h +819 -0
- data/vendor/libgit2/deps/regex/regexec.c +4369 -0
- data/vendor/libgit2/deps/zlib/CMakeLists.txt +0 -1
- data/vendor/libgit2/deps/zlib/adler32.c +7 -0
- data/vendor/libgit2/deps/zlib/crc32.c +7 -0
- data/vendor/libgit2/include/git2.h +0 -5
- data/vendor/libgit2/include/git2/annotated_commit.h +0 -9
- data/vendor/libgit2/include/git2/attr.h +20 -38
- data/vendor/libgit2/include/git2/blame.h +25 -42
- data/vendor/libgit2/include/git2/blob.h +13 -45
- data/vendor/libgit2/include/git2/branch.h +1 -1
- data/vendor/libgit2/include/git2/buffer.h +16 -22
- data/vendor/libgit2/include/git2/checkout.h +32 -65
- data/vendor/libgit2/include/git2/cherrypick.h +7 -9
- data/vendor/libgit2/include/git2/clone.h +10 -12
- data/vendor/libgit2/include/git2/commit.h +3 -53
- data/vendor/libgit2/include/git2/common.h +8 -60
- data/vendor/libgit2/include/git2/config.h +19 -30
- data/vendor/libgit2/include/git2/describe.h +9 -32
- data/vendor/libgit2/include/git2/diff.h +156 -208
- data/vendor/libgit2/include/git2/errors.h +46 -54
- data/vendor/libgit2/include/git2/filter.h +0 -8
- data/vendor/libgit2/include/git2/ignore.h +2 -2
- data/vendor/libgit2/include/git2/index.h +52 -74
- data/vendor/libgit2/include/git2/indexer.h +6 -76
- data/vendor/libgit2/include/git2/inttypes.h +309 -0
- data/vendor/libgit2/include/git2/merge.h +18 -35
- data/vendor/libgit2/include/git2/net.h +5 -0
- data/vendor/libgit2/include/git2/notes.h +1 -1
- data/vendor/libgit2/include/git2/object.h +29 -17
- data/vendor/libgit2/include/git2/odb.h +11 -12
- data/vendor/libgit2/include/git2/odb_backend.h +9 -10
- data/vendor/libgit2/include/git2/oid.h +2 -2
- data/vendor/libgit2/include/git2/pack.h +3 -14
- data/vendor/libgit2/include/git2/proxy.h +8 -14
- data/vendor/libgit2/include/git2/rebase.h +6 -53
- data/vendor/libgit2/include/git2/refs.h +15 -33
- data/vendor/libgit2/include/git2/refspec.h +0 -17
- data/vendor/libgit2/include/git2/remote.h +24 -123
- data/vendor/libgit2/include/git2/repository.h +39 -76
- data/vendor/libgit2/include/git2/revert.h +4 -6
- data/vendor/libgit2/include/git2/revwalk.h +7 -7
- data/vendor/libgit2/include/git2/signature.h +2 -2
- data/vendor/libgit2/include/git2/stash.h +12 -15
- data/vendor/libgit2/include/git2/status.h +20 -33
- data/vendor/libgit2/include/git2/submodule.h +12 -30
- data/vendor/libgit2/include/git2/sys/commit.h +1 -1
- data/vendor/libgit2/include/git2/sys/config.h +13 -13
- data/vendor/libgit2/include/git2/sys/filter.h +6 -6
- data/vendor/libgit2/include/git2/sys/index.h +0 -3
- data/vendor/libgit2/include/git2/sys/mempack.h +35 -35
- data/vendor/libgit2/include/git2/sys/merge.h +4 -9
- data/vendor/libgit2/include/git2/sys/odb_backend.h +22 -66
- data/vendor/libgit2/include/git2/sys/refdb_backend.h +40 -76
- data/vendor/libgit2/include/git2/sys/repository.h +1 -5
- data/vendor/libgit2/include/git2/sys/stream.h +12 -92
- data/vendor/libgit2/include/git2/sys/time.h +31 -0
- data/vendor/libgit2/include/git2/sys/transport.h +83 -129
- data/vendor/libgit2/include/git2/tag.h +4 -13
- data/vendor/libgit2/include/git2/trace.h +2 -2
- data/vendor/libgit2/include/git2/transaction.h +0 -1
- data/vendor/libgit2/include/git2/transport.h +311 -11
- data/vendor/libgit2/include/git2/tree.h +4 -4
- data/vendor/libgit2/include/git2/types.h +111 -33
- data/vendor/libgit2/include/git2/version.h +4 -4
- data/vendor/libgit2/include/git2/worktree.h +13 -48
- data/vendor/libgit2/libgit2.pc.in +13 -0
- data/vendor/libgit2/src/CMakeLists.txt +164 -96
- data/vendor/libgit2/src/annotated_commit.c +8 -15
- data/vendor/libgit2/src/apply.c +31 -537
- data/vendor/libgit2/src/apply.h +1 -3
- data/vendor/libgit2/src/array.h +2 -2
- data/vendor/libgit2/src/attr.c +75 -81
- data/vendor/libgit2/src/attr_file.c +121 -207
- data/vendor/libgit2/src/attr_file.h +9 -9
- data/vendor/libgit2/src/attrcache.c +53 -51
- data/vendor/libgit2/src/attrcache.h +1 -2
- data/vendor/libgit2/src/blame.c +20 -47
- data/vendor/libgit2/src/blame.h +1 -2
- data/vendor/libgit2/src/blame_git.c +20 -37
- data/vendor/libgit2/src/blob.c +42 -128
- data/vendor/libgit2/src/blob.h +2 -19
- data/vendor/libgit2/src/branch.c +43 -67
- data/vendor/libgit2/src/buf_text.c +6 -7
- data/vendor/libgit2/src/buffer.c +57 -69
- data/vendor/libgit2/src/buffer.h +1 -1
- data/vendor/libgit2/src/cache.c +45 -38
- data/vendor/libgit2/src/cache.h +3 -3
- data/vendor/libgit2/src/cc-compat.h +3 -20
- data/vendor/libgit2/src/checkout.c +90 -109
- data/vendor/libgit2/src/cherrypick.c +9 -15
- data/vendor/libgit2/src/clone.c +27 -49
- data/vendor/libgit2/src/clone.h +0 -4
- data/vendor/libgit2/src/commit.c +49 -117
- data/vendor/libgit2/src/commit.h +0 -7
- data/vendor/libgit2/src/commit_list.c +78 -30
- data/vendor/libgit2/src/commit_list.h +2 -2
- data/vendor/libgit2/src/common.h +91 -27
- data/vendor/libgit2/src/config.c +176 -194
- data/vendor/libgit2/src/config.h +20 -8
- data/vendor/libgit2/src/config_cache.c +35 -41
- data/vendor/libgit2/src/config_file.c +753 -439
- data/vendor/libgit2/src/config_file.h +73 -0
- data/vendor/libgit2/src/config_parse.c +63 -114
- data/vendor/libgit2/src/config_parse.h +16 -17
- data/vendor/libgit2/src/crlf.c +190 -219
- data/vendor/libgit2/src/delta.c +18 -25
- data/vendor/libgit2/src/describe.c +41 -42
- data/vendor/libgit2/src/diff.c +68 -53
- data/vendor/libgit2/src/diff.h +1 -2
- data/vendor/libgit2/src/diff_driver.c +49 -47
- data/vendor/libgit2/src/diff_file.c +17 -19
- data/vendor/libgit2/src/diff_file.h +1 -1
- data/vendor/libgit2/src/diff_generate.c +106 -162
- data/vendor/libgit2/src/diff_generate.h +3 -3
- data/vendor/libgit2/src/diff_parse.c +4 -4
- data/vendor/libgit2/src/diff_print.c +30 -42
- data/vendor/libgit2/src/diff_stats.c +7 -22
- data/vendor/libgit2/src/diff_tform.c +16 -16
- data/vendor/libgit2/src/diff_xdiff.c +3 -15
- data/vendor/libgit2/src/errors.c +39 -51
- data/vendor/libgit2/src/features.h.in +3 -11
- data/vendor/libgit2/src/fetch.c +5 -10
- data/vendor/libgit2/src/fetchhead.c +17 -17
- data/vendor/libgit2/src/filebuf.c +36 -32
- data/vendor/libgit2/src/filebuf.h +2 -2
- data/vendor/libgit2/src/{futils.c → fileops.c} +73 -80
- data/vendor/libgit2/src/{futils.h → fileops.h} +6 -6
- data/vendor/libgit2/src/filter.c +38 -46
- data/vendor/libgit2/src/filter.h +10 -0
- data/vendor/libgit2/src/fnmatch.c +248 -0
- data/vendor/libgit2/src/fnmatch.h +48 -0
- data/vendor/libgit2/src/global.c +63 -48
- data/vendor/libgit2/src/global.h +2 -0
- data/vendor/libgit2/src/hash.c +0 -61
- data/vendor/libgit2/src/hash.h +19 -20
- data/vendor/libgit2/src/hash/hash_collisiondetect.h +47 -0
- data/vendor/libgit2/src/hash/{sha1/common_crypto.c → hash_common_crypto.h} +17 -17
- data/vendor/libgit2/src/hash/{sha1/generic.c → hash_generic.c} +10 -22
- data/vendor/libgit2/src/hash/{sha1/generic.h → hash_generic.h} +10 -4
- data/vendor/libgit2/src/hash/hash_openssl.h +59 -0
- data/vendor/libgit2/src/hash/{sha1/win32.c → hash_win32.c} +37 -47
- data/vendor/libgit2/src/hash/{sha1/win32.h → hash_win32.h} +19 -6
- data/vendor/libgit2/src/hash/{sha1/sha1dc → sha1dc}/sha1.c +3 -14
- data/vendor/libgit2/src/hash/{sha1/sha1dc → sha1dc}/sha1.h +0 -0
- data/vendor/libgit2/src/hash/{sha1/sha1dc → sha1dc}/ubc_check.c +0 -0
- data/vendor/libgit2/src/hash/{sha1/sha1dc → sha1dc}/ubc_check.h +0 -0
- data/vendor/libgit2/src/hashsig.c +5 -5
- data/vendor/libgit2/src/idxmap.c +61 -107
- data/vendor/libgit2/src/idxmap.h +31 -153
- data/vendor/libgit2/src/ignore.c +47 -43
- data/vendor/libgit2/src/index.c +232 -337
- data/vendor/libgit2/src/index.h +1 -17
- data/vendor/libgit2/src/indexer.c +175 -346
- data/vendor/libgit2/src/integer.h +26 -71
- data/vendor/libgit2/src/iterator.c +70 -142
- data/vendor/libgit2/src/iterator.h +0 -15
- data/vendor/libgit2/src/khash.h +1 -3
- data/vendor/libgit2/src/map.h +1 -1
- data/vendor/libgit2/src/merge.c +100 -144
- data/vendor/libgit2/src/merge_driver.c +11 -11
- data/vendor/libgit2/src/merge_file.c +2 -2
- data/vendor/libgit2/src/mwindow.c +29 -24
- data/vendor/libgit2/src/mwindow.h +4 -4
- data/vendor/libgit2/src/netops.c +156 -55
- data/vendor/libgit2/src/netops.h +23 -3
- data/vendor/libgit2/src/notes.c +11 -16
- data/vendor/libgit2/src/object.c +69 -120
- data/vendor/libgit2/src/object.h +9 -22
- data/vendor/libgit2/src/object_api.c +8 -8
- data/vendor/libgit2/src/odb.c +93 -116
- data/vendor/libgit2/src/odb.h +7 -8
- data/vendor/libgit2/src/odb_loose.c +55 -62
- data/vendor/libgit2/src/odb_mempack.c +34 -21
- data/vendor/libgit2/src/odb_pack.c +14 -18
- data/vendor/libgit2/src/offmap.c +35 -53
- data/vendor/libgit2/src/offmap.h +21 -108
- data/vendor/libgit2/src/oid.c +7 -12
- data/vendor/libgit2/src/oidmap.c +47 -49
- data/vendor/libgit2/src/oidmap.h +24 -101
- data/vendor/libgit2/src/pack-objects.c +87 -88
- data/vendor/libgit2/src/pack-objects.h +8 -2
- data/vendor/libgit2/src/pack.c +101 -99
- data/vendor/libgit2/src/pack.h +19 -17
- data/vendor/libgit2/src/parse.c +0 -10
- data/vendor/libgit2/src/parse.h +3 -3
- data/vendor/libgit2/src/patch.c +4 -4
- data/vendor/libgit2/src/patch_generate.c +20 -20
- data/vendor/libgit2/src/patch_parse.c +63 -151
- data/vendor/libgit2/src/path.c +104 -117
- data/vendor/libgit2/src/path.h +71 -3
- data/vendor/libgit2/src/pathspec.c +19 -19
- data/vendor/libgit2/src/pool.c +22 -26
- data/vendor/libgit2/src/pool.h +7 -7
- data/vendor/libgit2/src/posix.c +10 -10
- data/vendor/libgit2/src/posix.h +1 -12
- data/vendor/libgit2/src/proxy.c +3 -8
- data/vendor/libgit2/src/push.c +31 -37
- data/vendor/libgit2/src/push.h +1 -2
- data/vendor/libgit2/src/rebase.c +59 -115
- data/vendor/libgit2/src/refdb.c +3 -15
- data/vendor/libgit2/src/refdb_fs.c +254 -381
- data/vendor/libgit2/src/reflog.c +15 -13
- data/vendor/libgit2/src/refs.c +88 -118
- data/vendor/libgit2/src/refs.h +3 -5
- data/vendor/libgit2/src/refspec.c +37 -56
- data/vendor/libgit2/src/refspec.h +1 -1
- data/vendor/libgit2/src/remote.c +215 -266
- data/vendor/libgit2/src/remote.h +2 -11
- data/vendor/libgit2/src/repository.c +225 -280
- data/vendor/libgit2/src/repository.h +40 -52
- data/vendor/libgit2/src/reset.c +8 -8
- data/vendor/libgit2/src/revert.c +9 -14
- data/vendor/libgit2/src/revparse.c +48 -47
- data/vendor/libgit2/src/revwalk.c +57 -120
- data/vendor/libgit2/src/revwalk.h +1 -22
- data/vendor/libgit2/src/settings.c +10 -47
- data/vendor/libgit2/src/signature.c +11 -11
- data/vendor/libgit2/src/sortedcache.c +36 -22
- data/vendor/libgit2/src/sortedcache.h +1 -1
- data/vendor/libgit2/src/stash.c +99 -125
- data/vendor/libgit2/src/status.c +22 -28
- data/vendor/libgit2/src/stream.h +2 -17
- data/vendor/libgit2/src/streams/curl.c +385 -0
- data/vendor/libgit2/src/{allocators/stdalloc.h → streams/curl.h} +5 -5
- data/vendor/libgit2/src/streams/openssl.c +114 -224
- data/vendor/libgit2/src/streams/openssl.h +108 -4
- data/vendor/libgit2/src/streams/socket.c +30 -55
- data/vendor/libgit2/src/streams/stransport.c +32 -57
- data/vendor/libgit2/src/streams/stransport.h +0 -5
- data/vendor/libgit2/src/streams/tls.c +19 -50
- data/vendor/libgit2/src/streams/tls.h +4 -12
- data/vendor/libgit2/src/strmap.c +74 -47
- data/vendor/libgit2/src/strmap.h +33 -108
- data/vendor/libgit2/src/submodule.c +216 -272
- data/vendor/libgit2/src/submodule.h +1 -1
- data/vendor/libgit2/src/sysdir.c +19 -29
- data/vendor/libgit2/src/tag.c +28 -41
- data/vendor/libgit2/src/tag.h +1 -2
- data/vendor/libgit2/src/trace.c +2 -2
- data/vendor/libgit2/src/trace.h +3 -3
- data/vendor/libgit2/src/trailer.c +38 -52
- data/vendor/libgit2/src/transaction.c +29 -30
- data/vendor/libgit2/src/transport.c +5 -5
- data/vendor/libgit2/src/transports/auth.c +11 -15
- data/vendor/libgit2/src/transports/auth.h +3 -10
- data/vendor/libgit2/src/transports/auth_negotiate.c +18 -33
- data/vendor/libgit2/src/transports/auth_negotiate.h +2 -2
- data/vendor/libgit2/src/transports/cred.c +24 -24
- data/vendor/libgit2/src/{allocators/win32_crtdbg.h → transports/cred.h} +4 -5
- data/vendor/libgit2/src/transports/git.c +31 -26
- data/vendor/libgit2/src/transports/http.c +348 -881
- data/vendor/libgit2/src/transports/http.h +0 -2
- data/vendor/libgit2/src/transports/local.c +35 -35
- data/vendor/libgit2/src/transports/smart.c +47 -70
- data/vendor/libgit2/src/transports/smart.h +4 -3
- data/vendor/libgit2/src/transports/smart_pkt.c +40 -43
- data/vendor/libgit2/src/transports/smart_protocol.c +116 -96
- data/vendor/libgit2/src/transports/ssh.c +66 -77
- data/vendor/libgit2/src/transports/winhttp.c +314 -318
- data/vendor/libgit2/src/tree-cache.c +12 -19
- data/vendor/libgit2/src/tree.c +142 -103
- data/vendor/libgit2/src/tree.h +12 -1
- data/vendor/libgit2/src/unix/map.c +3 -3
- data/vendor/libgit2/src/unix/posix.h +11 -1
- data/vendor/libgit2/src/userdiff.h +1 -3
- data/vendor/libgit2/src/util.c +56 -70
- data/vendor/libgit2/src/util.h +156 -28
- data/vendor/libgit2/src/vector.c +4 -4
- data/vendor/libgit2/src/win32/dir.c +3 -3
- data/vendor/libgit2/src/win32/findfile.c +3 -3
- data/vendor/libgit2/src/win32/map.c +11 -9
- data/vendor/libgit2/src/win32/msvc-compat.h +0 -6
- data/vendor/libgit2/src/win32/path_w32.c +9 -113
- data/vendor/libgit2/src/win32/path_w32.h +29 -18
- data/vendor/libgit2/src/win32/posix.h +4 -1
- data/vendor/libgit2/src/win32/posix_w32.c +45 -70
- data/vendor/libgit2/src/win32/precompiled.h +2 -0
- data/vendor/libgit2/src/win32/thread.c +10 -5
- data/vendor/libgit2/src/win32/w32_buffer.c +5 -9
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +2 -3
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +75 -26
- data/vendor/libgit2/src/win32/w32_stack.c +11 -6
- data/vendor/libgit2/src/win32/w32_stack.h +3 -3
- data/vendor/libgit2/src/win32/w32_util.c +64 -27
- data/vendor/libgit2/src/win32/w32_util.h +49 -5
- data/vendor/libgit2/src/worktree.c +60 -95
- data/vendor/libgit2/src/worktree.h +0 -2
- data/vendor/libgit2/src/xdiff/xdiffi.c +5 -7
- data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
- data/vendor/libgit2/src/xdiff/xmerge.c +15 -27
- data/vendor/libgit2/src/xdiff/xpatience.c +0 -3
- data/vendor/libgit2/src/zstream.c +4 -4
- metadata +33 -122
- data/vendor/libgit2/cmake/Modules/FindGSSFramework.cmake +0 -28
- data/vendor/libgit2/cmake/Modules/FindPCRE.cmake +0 -38
- data/vendor/libgit2/cmake/Modules/FindPCRE2.cmake +0 -37
- data/vendor/libgit2/cmake/Modules/FindmbedTLS.cmake +0 -93
- data/vendor/libgit2/cmake/Modules/PkgBuildConfig.cmake +0 -110
- data/vendor/libgit2/cmake/Modules/SelectGSSAPI.cmake +0 -53
- data/vendor/libgit2/cmake/Modules/SelectHTTPSBackend.cmake +0 -124
- data/vendor/libgit2/cmake/Modules/SelectHashes.cmake +0 -66
- data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +0 -21
- data/vendor/libgit2/deps/ntlmclient/compat.h +0 -33
- data/vendor/libgit2/deps/ntlmclient/crypt.h +0 -64
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +0 -120
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +0 -18
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +0 -145
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +0 -18
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +0 -130
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +0 -21
- data/vendor/libgit2/deps/ntlmclient/ntlm.c +0 -1420
- data/vendor/libgit2/deps/ntlmclient/ntlm.h +0 -174
- data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +0 -320
- data/vendor/libgit2/deps/ntlmclient/unicode.h +0 -36
- data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +0 -445
- data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +0 -201
- data/vendor/libgit2/deps/ntlmclient/utf8.h +0 -1257
- data/vendor/libgit2/deps/ntlmclient/util.c +0 -21
- data/vendor/libgit2/deps/ntlmclient/util.h +0 -14
- data/vendor/libgit2/deps/pcre/CMakeLists.txt +0 -140
- data/vendor/libgit2/deps/pcre/COPYING +0 -5
- data/vendor/libgit2/deps/pcre/cmake/COPYING-CMAKE-SCRIPTS +0 -22
- data/vendor/libgit2/deps/pcre/cmake/FindEditline.cmake +0 -17
- data/vendor/libgit2/deps/pcre/cmake/FindPackageHandleStandardArgs.cmake +0 -58
- data/vendor/libgit2/deps/pcre/cmake/FindReadline.cmake +0 -29
- data/vendor/libgit2/deps/pcre/config.h.in +0 -57
- data/vendor/libgit2/deps/pcre/pcre.h +0 -641
- data/vendor/libgit2/deps/pcre/pcre_byte_order.c +0 -319
- data/vendor/libgit2/deps/pcre/pcre_chartables.c +0 -198
- data/vendor/libgit2/deps/pcre/pcre_compile.c +0 -9800
- data/vendor/libgit2/deps/pcre/pcre_config.c +0 -190
- data/vendor/libgit2/deps/pcre/pcre_dfa_exec.c +0 -3676
- data/vendor/libgit2/deps/pcre/pcre_exec.c +0 -7173
- data/vendor/libgit2/deps/pcre/pcre_fullinfo.c +0 -245
- data/vendor/libgit2/deps/pcre/pcre_get.c +0 -669
- data/vendor/libgit2/deps/pcre/pcre_globals.c +0 -86
- data/vendor/libgit2/deps/pcre/pcre_internal.h +0 -2787
- data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +0 -11913
- data/vendor/libgit2/deps/pcre/pcre_maketables.c +0 -156
- data/vendor/libgit2/deps/pcre/pcre_newline.c +0 -210
- data/vendor/libgit2/deps/pcre/pcre_ord2utf8.c +0 -94
- data/vendor/libgit2/deps/pcre/pcre_printint.c +0 -834
- data/vendor/libgit2/deps/pcre/pcre_refcount.c +0 -92
- data/vendor/libgit2/deps/pcre/pcre_string_utils.c +0 -211
- data/vendor/libgit2/deps/pcre/pcre_study.c +0 -1686
- data/vendor/libgit2/deps/pcre/pcre_tables.c +0 -727
- data/vendor/libgit2/deps/pcre/pcre_ucd.c +0 -3644
- data/vendor/libgit2/deps/pcre/pcre_valid_utf8.c +0 -301
- data/vendor/libgit2/deps/pcre/pcre_version.c +0 -98
- data/vendor/libgit2/deps/pcre/pcre_xclass.c +0 -268
- data/vendor/libgit2/deps/pcre/pcreposix.c +0 -421
- data/vendor/libgit2/deps/pcre/pcreposix.h +0 -117
- data/vendor/libgit2/deps/pcre/ucp.h +0 -224
- data/vendor/libgit2/deps/winhttp/COPYING.GPL +0 -993
- data/vendor/libgit2/deps/winhttp/COPYING.LGPL +0 -502
- data/vendor/libgit2/deps/zlib/COPYING +0 -27
- data/vendor/libgit2/include/git2/apply.h +0 -149
- data/vendor/libgit2/include/git2/cert.h +0 -135
- data/vendor/libgit2/include/git2/cred.h +0 -308
- data/vendor/libgit2/include/git2/deprecated.h +0 -493
- data/vendor/libgit2/include/git2/mailmap.h +0 -115
- data/vendor/libgit2/include/git2/sys/alloc.h +0 -101
- data/vendor/libgit2/include/git2/sys/cred.h +0 -90
- data/vendor/libgit2/include/git2/sys/path.h +0 -64
- data/vendor/libgit2/src/alloc.c +0 -43
- data/vendor/libgit2/src/alloc.h +0 -40
- data/vendor/libgit2/src/allocators/stdalloc.c +0 -119
- data/vendor/libgit2/src/allocators/win32_crtdbg.c +0 -118
- data/vendor/libgit2/src/config_backend.h +0 -96
- data/vendor/libgit2/src/config_entries.c +0 -229
- data/vendor/libgit2/src/config_entries.h +0 -24
- data/vendor/libgit2/src/config_mem.c +0 -220
- data/vendor/libgit2/src/config_snapshot.c +0 -206
- data/vendor/libgit2/src/errors.h +0 -81
- data/vendor/libgit2/src/hash/sha1.h +0 -38
- data/vendor/libgit2/src/hash/sha1/collisiondetect.c +0 -48
- data/vendor/libgit2/src/hash/sha1/collisiondetect.h +0 -19
- data/vendor/libgit2/src/hash/sha1/common_crypto.h +0 -19
- data/vendor/libgit2/src/hash/sha1/mbedtls.c +0 -46
- data/vendor/libgit2/src/hash/sha1/mbedtls.h +0 -19
- data/vendor/libgit2/src/hash/sha1/openssl.c +0 -59
- data/vendor/libgit2/src/hash/sha1/openssl.h +0 -19
- data/vendor/libgit2/src/mailmap.c +0 -485
- data/vendor/libgit2/src/mailmap.h +0 -35
- data/vendor/libgit2/src/net.c +0 -184
- data/vendor/libgit2/src/net.h +0 -36
- data/vendor/libgit2/src/reader.c +0 -265
- data/vendor/libgit2/src/reader.h +0 -107
- data/vendor/libgit2/src/regexp.c +0 -221
- data/vendor/libgit2/src/regexp.h +0 -97
- data/vendor/libgit2/src/streams/mbedtls.c +0 -483
- data/vendor/libgit2/src/streams/mbedtls.h +0 -23
- data/vendor/libgit2/src/streams/registry.c +0 -118
- data/vendor/libgit2/src/streams/registry.h +0 -19
- data/vendor/libgit2/src/transports/auth_ntlm.c +0 -223
- data/vendor/libgit2/src/transports/auth_ntlm.h +0 -35
- data/vendor/libgit2/src/wildmatch.c +0 -320
- data/vendor/libgit2/src/wildmatch.h +0 -23
- data/vendor/libgit2/src/win32/w32_common.h +0 -39
data/vendor/libgit2/src/diff.h
CHANGED
@@ -57,8 +57,7 @@ extern int git_diff_delta__format_file_header(
|
|
57
57
|
const git_diff_delta *delta,
|
58
58
|
const char *oldpfx,
|
59
59
|
const char *newpfx,
|
60
|
-
int oid_strlen
|
61
|
-
bool print_index);
|
60
|
+
int oid_strlen);
|
62
61
|
|
63
62
|
extern int git_diff_delta__cmp(const void *a, const void *b);
|
64
63
|
extern int git_diff_delta__casecmp(const void *a, const void *b);
|
@@ -9,13 +9,11 @@
|
|
9
9
|
|
10
10
|
#include "git2/attr.h"
|
11
11
|
|
12
|
-
#include "common.h"
|
13
12
|
#include "diff.h"
|
14
13
|
#include "strmap.h"
|
15
14
|
#include "map.h"
|
16
15
|
#include "buf_text.h"
|
17
16
|
#include "config.h"
|
18
|
-
#include "regexp.h"
|
19
17
|
#include "repository.h"
|
20
18
|
|
21
19
|
typedef enum {
|
@@ -26,7 +24,7 @@ typedef enum {
|
|
26
24
|
} git_diff_driver_t;
|
27
25
|
|
28
26
|
typedef struct {
|
29
|
-
|
27
|
+
regex_t re;
|
30
28
|
int flags;
|
31
29
|
} git_diff_driver_pattern;
|
32
30
|
|
@@ -40,7 +38,7 @@ struct git_diff_driver {
|
|
40
38
|
uint32_t binary_flags;
|
41
39
|
uint32_t other_flags;
|
42
40
|
git_array_t(git_diff_driver_pattern) fn_patterns;
|
43
|
-
|
41
|
+
regex_t word_pattern;
|
44
42
|
char name[GIT_FLEX_ARRAY];
|
45
43
|
};
|
46
44
|
|
@@ -65,7 +63,7 @@ git_diff_driver_registry *git_diff_driver_registry_new(void)
|
|
65
63
|
if (!reg)
|
66
64
|
return NULL;
|
67
65
|
|
68
|
-
if (
|
66
|
+
if (git_strmap_alloc(®->drivers) < 0) {
|
69
67
|
git_diff_driver_registry_free(reg);
|
70
68
|
return NULL;
|
71
69
|
}
|
@@ -114,7 +112,7 @@ static int diff_driver_add_patterns(
|
|
114
112
|
if (error < 0)
|
115
113
|
break;
|
116
114
|
|
117
|
-
if ((error =
|
115
|
+
if ((error = p_regcomp(&pat->re, buf.ptr, regex_flags)) != 0) {
|
118
116
|
/*
|
119
117
|
* TODO: issue a warning
|
120
118
|
*/
|
@@ -123,7 +121,7 @@ static int diff_driver_add_patterns(
|
|
123
121
|
|
124
122
|
if (error && pat != NULL)
|
125
123
|
(void)git_array_pop(drv->fn_patterns); /* release last item */
|
126
|
-
|
124
|
+
git_buf_free(&buf);
|
127
125
|
|
128
126
|
/* We want to ignore bad patterns, so return success regardless */
|
129
127
|
return 0;
|
@@ -131,7 +129,7 @@ static int diff_driver_add_patterns(
|
|
131
129
|
|
132
130
|
static int diff_driver_xfuncname(const git_config_entry *entry, void *payload)
|
133
131
|
{
|
134
|
-
return diff_driver_add_patterns(payload, entry->value,
|
132
|
+
return diff_driver_add_patterns(payload, entry->value, REG_EXTENDED);
|
135
133
|
}
|
136
134
|
|
137
135
|
static int diff_driver_funcname(const git_config_entry *entry, void *payload)
|
@@ -151,7 +149,7 @@ static git_diff_driver_registry *git_repository_driver_registry(
|
|
151
149
|
}
|
152
150
|
|
153
151
|
if (!repo->diff_drivers)
|
154
|
-
|
152
|
+
giterr_set(GITERR_REPOSITORY, "unable to create diff driver registry");
|
155
153
|
|
156
154
|
return repo->diff_drivers;
|
157
155
|
}
|
@@ -164,11 +162,11 @@ static int diff_driver_alloc(
|
|
164
162
|
namelen = strlen(name),
|
165
163
|
alloclen;
|
166
164
|
|
167
|
-
|
168
|
-
|
165
|
+
GITERR_CHECK_ALLOC_ADD(&alloclen, driverlen, namelen);
|
166
|
+
GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, 1);
|
169
167
|
|
170
168
|
driver = git__calloc(1, alloclen);
|
171
|
-
|
169
|
+
GITERR_CHECK_ALLOC(driver);
|
172
170
|
|
173
171
|
memcpy(driver->name, name, namelen);
|
174
172
|
|
@@ -185,9 +183,9 @@ static int git_diff_driver_builtin(
|
|
185
183
|
git_diff_driver_registry *reg,
|
186
184
|
const char *driver_name)
|
187
185
|
{
|
186
|
+
int error = 0;
|
188
187
|
git_diff_driver_definition *ddef = NULL;
|
189
188
|
git_diff_driver *drv = NULL;
|
190
|
-
int error = 0;
|
191
189
|
size_t idx;
|
192
190
|
|
193
191
|
for (idx = 0; idx < ARRAY_SIZE(builtin_defs); ++idx) {
|
@@ -206,15 +204,20 @@ static int git_diff_driver_builtin(
|
|
206
204
|
|
207
205
|
if (ddef->fns &&
|
208
206
|
(error = diff_driver_add_patterns(
|
209
|
-
drv, ddef->fns, ddef->flags)) < 0)
|
207
|
+
drv, ddef->fns, ddef->flags | REG_EXTENDED)) < 0)
|
210
208
|
goto done;
|
211
209
|
|
212
210
|
if (ddef->words &&
|
213
|
-
|
211
|
+
(error = p_regcomp(
|
212
|
+
&drv->word_pattern, ddef->words, ddef->flags | REG_EXTENDED)))
|
213
|
+
{
|
214
|
+
error = giterr_set_regex(&drv->word_pattern, error);
|
214
215
|
goto done;
|
216
|
+
}
|
215
217
|
|
216
|
-
|
217
|
-
|
218
|
+
git_strmap_insert(reg->drivers, drv->name, drv, &error);
|
219
|
+
if (error > 0)
|
220
|
+
error = 0;
|
218
221
|
|
219
222
|
done:
|
220
223
|
if (error && drv)
|
@@ -230,8 +233,9 @@ static int git_diff_driver_load(
|
|
230
233
|
{
|
231
234
|
int error = 0;
|
232
235
|
git_diff_driver_registry *reg;
|
233
|
-
git_diff_driver *drv;
|
236
|
+
git_diff_driver *drv = NULL;
|
234
237
|
size_t namelen;
|
238
|
+
khiter_t pos;
|
235
239
|
git_config *cfg = NULL;
|
236
240
|
git_buf name = GIT_BUF_INIT;
|
237
241
|
git_config_entry *ce = NULL;
|
@@ -240,8 +244,9 @@ static int git_diff_driver_load(
|
|
240
244
|
if ((reg = git_repository_driver_registry(repo)) == NULL)
|
241
245
|
return -1;
|
242
246
|
|
243
|
-
|
244
|
-
|
247
|
+
pos = git_strmap_lookup_index(reg->drivers, driver_name);
|
248
|
+
if (git_strmap_valid_index(reg->drivers, pos)) {
|
249
|
+
*out = git_strmap_value_at(reg->drivers, pos);
|
245
250
|
return 0;
|
246
251
|
}
|
247
252
|
|
@@ -252,7 +257,7 @@ static int git_diff_driver_load(
|
|
252
257
|
|
253
258
|
/* if you can't read config for repo, just use default driver */
|
254
259
|
if (git_repository_config_snapshot(&cfg, repo) < 0) {
|
255
|
-
|
260
|
+
giterr_clear();
|
256
261
|
goto done;
|
257
262
|
}
|
258
263
|
|
@@ -278,25 +283,21 @@ static int git_diff_driver_load(
|
|
278
283
|
/* TODO: warn if diff.<name>.command or diff.<name>.textconv are set */
|
279
284
|
|
280
285
|
git_buf_truncate(&name, namelen + strlen("diff.."));
|
281
|
-
|
282
|
-
goto done;
|
283
|
-
|
286
|
+
git_buf_put(&name, "xfuncname", strlen("xfuncname"));
|
284
287
|
if ((error = git_config_get_multivar_foreach(
|
285
288
|
cfg, name.ptr, NULL, diff_driver_xfuncname, drv)) < 0) {
|
286
289
|
if (error != GIT_ENOTFOUND)
|
287
290
|
goto done;
|
288
|
-
|
291
|
+
giterr_clear(); /* no diff.<driver>.xfuncname, so just continue */
|
289
292
|
}
|
290
293
|
|
291
294
|
git_buf_truncate(&name, namelen + strlen("diff.."));
|
292
|
-
|
293
|
-
goto done;
|
294
|
-
|
295
|
+
git_buf_put(&name, "funcname", strlen("funcname"));
|
295
296
|
if ((error = git_config_get_multivar_foreach(
|
296
297
|
cfg, name.ptr, NULL, diff_driver_funcname, drv)) < 0) {
|
297
298
|
if (error != GIT_ENOTFOUND)
|
298
299
|
goto done;
|
299
|
-
|
300
|
+
giterr_clear(); /* no diff.<driver>.funcname, so just continue */
|
300
301
|
}
|
301
302
|
|
302
303
|
/* if we found any patterns, set driver type to use correct callback */
|
@@ -306,17 +307,16 @@ static int git_diff_driver_load(
|
|
306
307
|
}
|
307
308
|
|
308
309
|
git_buf_truncate(&name, namelen + strlen("diff.."));
|
309
|
-
|
310
|
-
goto done;
|
311
|
-
|
310
|
+
git_buf_put(&name, "wordregex", strlen("wordregex"));
|
312
311
|
if ((error = git_config__lookup_entry(&ce, cfg, name.ptr, false)) < 0)
|
313
312
|
goto done;
|
314
313
|
if (!ce || !ce->value)
|
315
314
|
/* no diff.<driver>.wordregex, so just continue */;
|
316
|
-
else if (!(error =
|
315
|
+
else if (!(error = p_regcomp(&drv->word_pattern, ce->value, REG_EXTENDED)))
|
317
316
|
found_driver = true;
|
318
317
|
else {
|
319
318
|
/* TODO: warn about bad regex instead of failure */
|
319
|
+
error = giterr_set_regex(&drv->word_pattern, error);
|
320
320
|
goto done;
|
321
321
|
}
|
322
322
|
|
@@ -329,14 +329,16 @@ static int git_diff_driver_load(
|
|
329
329
|
goto done;
|
330
330
|
|
331
331
|
/* store driver in registry */
|
332
|
-
|
332
|
+
git_strmap_insert(reg->drivers, drv->name, drv, &error);
|
333
|
+
if (error < 0)
|
333
334
|
goto done;
|
335
|
+
error = 0;
|
334
336
|
|
335
337
|
*out = drv;
|
336
338
|
|
337
339
|
done:
|
338
340
|
git_config_entry_free(ce);
|
339
|
-
|
341
|
+
git_buf_free(&name);
|
340
342
|
git_config_free(cfg);
|
341
343
|
|
342
344
|
if (!*out) {
|
@@ -367,18 +369,18 @@ int git_diff_driver_lookup(
|
|
367
369
|
attrsession, 0, path, 1, attrs)) < 0)
|
368
370
|
/* return error below */;
|
369
371
|
|
370
|
-
else if (
|
372
|
+
else if (GIT_ATTR_UNSPECIFIED(values[0]))
|
371
373
|
/* just use the auto value */;
|
372
|
-
else if (
|
374
|
+
else if (GIT_ATTR_FALSE(values[0]))
|
373
375
|
*out = &global_drivers[DIFF_DRIVER_BINARY];
|
374
|
-
else if (
|
376
|
+
else if (GIT_ATTR_TRUE(values[0]))
|
375
377
|
*out = &global_drivers[DIFF_DRIVER_TEXT];
|
376
378
|
|
377
379
|
/* otherwise look for driver information in config and build driver */
|
378
380
|
else if ((error = git_diff_driver_load(out, repo, values[0])) < 0) {
|
379
381
|
if (error == GIT_ENOTFOUND) {
|
380
382
|
error = 0;
|
381
|
-
|
383
|
+
giterr_clear();
|
382
384
|
}
|
383
385
|
}
|
384
386
|
|
@@ -396,10 +398,10 @@ void git_diff_driver_free(git_diff_driver *driver)
|
|
396
398
|
return;
|
397
399
|
|
398
400
|
for (i = 0; i < git_array_size(driver->fn_patterns); ++i)
|
399
|
-
|
401
|
+
regfree(& git_array_get(driver->fn_patterns, i)->re);
|
400
402
|
git_array_clear(driver->fn_patterns);
|
401
403
|
|
402
|
-
|
404
|
+
regfree(&driver->word_pattern);
|
403
405
|
|
404
406
|
git__free(driver);
|
405
407
|
}
|
@@ -447,19 +449,19 @@ static int diff_context_line__pattern_match(
|
|
447
449
|
git_diff_driver *driver, git_buf *line)
|
448
450
|
{
|
449
451
|
size_t i, maxi = git_array_size(driver->fn_patterns);
|
450
|
-
|
452
|
+
regmatch_t pmatch[2];
|
451
453
|
|
452
454
|
for (i = 0; i < maxi; ++i) {
|
453
455
|
git_diff_driver_pattern *pat = git_array_get(driver->fn_patterns, i);
|
454
456
|
|
455
|
-
if (!
|
457
|
+
if (!regexec(&pat->re, line->ptr, 2, pmatch, 0)) {
|
456
458
|
if (pat->flags & REG_NEGATE)
|
457
459
|
return false;
|
458
460
|
|
459
461
|
/* use pmatch data to trim line data */
|
460
|
-
i = (pmatch[1].
|
461
|
-
git_buf_consume(line, git_buf_cstr(line) + pmatch[i].
|
462
|
-
git_buf_truncate(line, pmatch[i].
|
462
|
+
i = (pmatch[1].rm_so >= 0) ? 1 : 0;
|
463
|
+
git_buf_consume(line, git_buf_cstr(line) + pmatch[i].rm_so);
|
464
|
+
git_buf_truncate(line, pmatch[i].rm_eo - pmatch[i].rm_so);
|
463
465
|
git_buf_rtrim(line);
|
464
466
|
|
465
467
|
return true;
|
@@ -514,7 +516,7 @@ void git_diff_find_context_init(
|
|
514
516
|
void git_diff_find_context_clear(git_diff_find_context_payload *payload)
|
515
517
|
{
|
516
518
|
if (payload) {
|
517
|
-
|
519
|
+
git_buf_free(&payload->line);
|
518
520
|
payload->driver = NULL;
|
519
521
|
}
|
520
522
|
}
|
@@ -12,7 +12,7 @@
|
|
12
12
|
#include "diff.h"
|
13
13
|
#include "diff_generate.h"
|
14
14
|
#include "odb.h"
|
15
|
-
#include "
|
15
|
+
#include "fileops.h"
|
16
16
|
#include "filter.h"
|
17
17
|
|
18
18
|
#define DIFF_MAX_FILESIZE 0x20000000
|
@@ -62,7 +62,7 @@ static int diff_file_content_init_common(
|
|
62
62
|
git_diff_driver_update_options(&fc->opts_flags, fc->driver);
|
63
63
|
|
64
64
|
/* make sure file is conceivable mmap-able */
|
65
|
-
if ((size_t)fc->file->size != fc->file->size)
|
65
|
+
if ((git_off_t)((size_t)fc->file->size) != fc->file->size)
|
66
66
|
fc->file->flags |= GIT_DIFF_FLAG_BINARY;
|
67
67
|
/* check if user is forcing text diff the file */
|
68
68
|
else if (fc->opts_flags & GIT_DIFF_FORCE_TEXT) {
|
@@ -161,7 +161,7 @@ int git_diff_file_content__init_from_src(
|
|
161
161
|
fc->flags |= GIT_DIFF_FLAG__FREE_BLOB;
|
162
162
|
} else {
|
163
163
|
fc->file->size = src->buflen;
|
164
|
-
git_odb_hash(&fc->file->id, src->buf, src->buflen,
|
164
|
+
git_odb_hash(&fc->file->id, src->buf, src->buflen, GIT_OBJ_BLOB);
|
165
165
|
fc->file->id_abbrev = GIT_OID_HEXSZ;
|
166
166
|
|
167
167
|
fc->map.len = src->buflen;
|
@@ -188,7 +188,7 @@ static int diff_file_content_commit_to_str(
|
|
188
188
|
if ((error = git_submodule_lookup(&sm, fc->repo, fc->file->path)) < 0) {
|
189
189
|
/* GIT_EEXISTS means a "submodule" that has not been git added */
|
190
190
|
if (error == GIT_EEXISTS) {
|
191
|
-
|
191
|
+
giterr_clear();
|
192
192
|
error = 0;
|
193
193
|
}
|
194
194
|
return error;
|
@@ -232,7 +232,7 @@ static int diff_file_content_load_blob(
|
|
232
232
|
int error = 0;
|
233
233
|
git_odb_object *odb_obj = NULL;
|
234
234
|
|
235
|
-
if (
|
235
|
+
if (git_oid_iszero(&fc->file->id))
|
236
236
|
return 0;
|
237
237
|
|
238
238
|
if (fc->file->mode == GIT_FILEMODE_COMMIT)
|
@@ -251,7 +251,7 @@ static int diff_file_content_load_blob(
|
|
251
251
|
|
252
252
|
if (odb_obj != NULL) {
|
253
253
|
error = git_object__from_odb_object(
|
254
|
-
(git_object **)&fc->blob, fc->repo, odb_obj,
|
254
|
+
(git_object **)&fc->blob, fc->repo, odb_obj, GIT_OBJ_BLOB);
|
255
255
|
git_odb_object_free(odb_obj);
|
256
256
|
} else {
|
257
257
|
error = git_blob_lookup(
|
@@ -280,7 +280,7 @@ static int diff_file_content_load_workdir_symlink_fake(
|
|
280
280
|
fc->map.data = git_buf_detach(&target);
|
281
281
|
fc->flags |= GIT_DIFF_FLAG__FREE_DATA;
|
282
282
|
|
283
|
-
|
283
|
+
git_buf_free(&target);
|
284
284
|
return error;
|
285
285
|
}
|
286
286
|
|
@@ -290,8 +290,8 @@ static int diff_file_content_load_workdir_symlink(
|
|
290
290
|
ssize_t alloc_len, read_len;
|
291
291
|
int symlink_supported, error;
|
292
292
|
|
293
|
-
if ((error =
|
294
|
-
&symlink_supported, fc->repo,
|
293
|
+
if ((error = git_repository__cvar(
|
294
|
+
&symlink_supported, fc->repo, GIT_CVAR_SYMLINKS)) < 0)
|
295
295
|
return -1;
|
296
296
|
|
297
297
|
if (!symlink_supported)
|
@@ -303,13 +303,13 @@ static int diff_file_content_load_workdir_symlink(
|
|
303
303
|
alloc_len = (ssize_t)(fc->file->size * 2) + 1;
|
304
304
|
|
305
305
|
fc->map.data = git__calloc(alloc_len, sizeof(char));
|
306
|
-
|
306
|
+
GITERR_CHECK_ALLOC(fc->map.data);
|
307
307
|
|
308
308
|
fc->flags |= GIT_DIFF_FLAG__FREE_DATA;
|
309
309
|
|
310
310
|
read_len = p_readlink(git_buf_cstr(path), fc->map.data, alloc_len);
|
311
311
|
if (read_len < 0) {
|
312
|
-
|
312
|
+
giterr_set(GITERR_OS, "failed to read symlink '%s'", fc->file->path);
|
313
313
|
return -1;
|
314
314
|
}
|
315
315
|
|
@@ -330,10 +330,8 @@ static int diff_file_content_load_workdir_file(
|
|
330
330
|
if (fd < 0)
|
331
331
|
return fd;
|
332
332
|
|
333
|
-
if (!fc->file->size
|
334
|
-
|
335
|
-
|
336
|
-
if (error < 0 || !fc->file->size)
|
333
|
+
if (!fc->file->size &&
|
334
|
+
!(fc->file->size = git_futils_filesize(fd)))
|
337
335
|
goto cleanup;
|
338
336
|
|
339
337
|
if ((diff_opts->flags & GIT_DIFF_SHOW_BINARY) == 0 &&
|
@@ -354,7 +352,7 @@ static int diff_file_content_load_workdir_file(
|
|
354
352
|
}
|
355
353
|
|
356
354
|
/* if mmap failed, fall through to try readbuffer below */
|
357
|
-
|
355
|
+
giterr_clear();
|
358
356
|
}
|
359
357
|
|
360
358
|
if (!(error = git_futils_readbuffer_fd(&raw, fd, (size_t)fc->file->size))) {
|
@@ -363,7 +361,7 @@ static int diff_file_content_load_workdir_file(
|
|
363
361
|
error = git_filter_list_apply_to_data(&out, fl, &raw);
|
364
362
|
|
365
363
|
if (out.ptr != raw.ptr)
|
366
|
-
|
364
|
+
git_buf_free(&raw);
|
367
365
|
|
368
366
|
if (!error) {
|
369
367
|
fc->map.len = out.size;
|
@@ -404,11 +402,11 @@ static int diff_file_content_load_workdir(
|
|
404
402
|
/* once data is loaded, update OID if we didn't have it previously */
|
405
403
|
if (!error && (fc->file->flags & GIT_DIFF_FLAG_VALID_ID) == 0) {
|
406
404
|
error = git_odb_hash(
|
407
|
-
&fc->file->id, fc->map.data, fc->map.len,
|
405
|
+
&fc->file->id, fc->map.data, fc->map.len, GIT_OBJ_BLOB);
|
408
406
|
fc->file->flags |= GIT_DIFF_FLAG_VALID_ID;
|
409
407
|
}
|
410
408
|
|
411
|
-
|
409
|
+
git_buf_free(&path);
|
412
410
|
return error;
|
413
411
|
}
|
414
412
|
|
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
#include "diff.h"
|
11
11
|
#include "patch_generate.h"
|
12
|
-
#include "
|
12
|
+
#include "fileops.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 giterr_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_IDXENTRY_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
|
+
GITERR_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_iszero(&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
|
+
GITERR_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_iszero(&new_entry->id))
|
244
244
|
delta->new_file.flags |= GIT_DIFF_FLAG_VALID_ID;
|
245
245
|
}
|
246
246
|
|
@@ -273,8 +273,7 @@ static git_diff_delta *diff_delta__last_for_item(
|
|
273
273
|
break;
|
274
274
|
case GIT_DELTA_MODIFIED:
|
275
275
|
if (git_oid__cmp(&delta->old_file.id, &item->id) == 0 ||
|
276
|
-
|
277
|
-
git_oid__cmp(&delta->new_file.id, &item->id) == 0))
|
276
|
+
git_oid__cmp(&delta->new_file.id, &item->id) == 0)
|
278
277
|
return delta;
|
279
278
|
break;
|
280
279
|
default:
|
@@ -472,17 +471,17 @@ static int diff_generated_apply_options(
|
|
472
471
|
if ((val = git_repository_config_snapshot(&cfg, repo)) < 0)
|
473
472
|
return val;
|
474
473
|
|
475
|
-
if (!
|
474
|
+
if (!git_config__cvar(&val, cfg, GIT_CVAR_SYMLINKS) && val)
|
476
475
|
diff->diffcaps |= GIT_DIFFCAPS_HAS_SYMLINKS;
|
477
476
|
|
478
|
-
if (!
|
477
|
+
if (!git_config__cvar(&val, cfg, GIT_CVAR_IGNORESTAT) && val)
|
479
478
|
diff->diffcaps |= GIT_DIFFCAPS_IGNORE_STAT;
|
480
479
|
|
481
480
|
if ((diff->base.opts.flags & GIT_DIFF_IGNORE_FILEMODE) == 0 &&
|
482
|
-
!
|
481
|
+
!git_config__cvar(&val, cfg, GIT_CVAR_FILEMODE) && val)
|
483
482
|
diff->diffcaps |= GIT_DIFFCAPS_TRUST_MODE_BITS;
|
484
483
|
|
485
|
-
if (!
|
484
|
+
if (!git_config__cvar(&val, cfg, GIT_CVAR_TRUSTCTIME) && val)
|
486
485
|
diff->diffcaps |= GIT_DIFFCAPS_TRUST_CTIME;
|
487
486
|
|
488
487
|
/* Don't set GIT_DIFFCAPS_USE_DEV - compile time option in core git */
|
@@ -517,7 +516,7 @@ static int diff_generated_apply_options(
|
|
517
516
|
|
518
517
|
if (entry && git_submodule_parse_ignore(
|
519
518
|
&diff->base.opts.ignore_submodules, entry->value) < 0)
|
520
|
-
|
519
|
+
giterr_clear();
|
521
520
|
git_config_entry_free(entry);
|
522
521
|
}
|
523
522
|
|
@@ -560,18 +559,13 @@ int git_diff__oid_for_file(
|
|
560
559
|
git_diff *diff,
|
561
560
|
const char *path,
|
562
561
|
uint16_t mode,
|
563
|
-
|
562
|
+
git_off_t size)
|
564
563
|
{
|
565
564
|
git_index_entry entry;
|
566
565
|
|
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
|
-
|
572
566
|
memset(&entry, 0, sizeof(entry));
|
573
567
|
entry.mode = mode;
|
574
|
-
entry.file_size =
|
568
|
+
entry.file_size = size;
|
575
569
|
entry.path = (char *)path;
|
576
570
|
|
577
571
|
return git_diff__oid_for_entry(out, diff, &entry, mode, NULL);
|
@@ -606,7 +600,7 @@ int git_diff__oid_for_entry(
|
|
606
600
|
|
607
601
|
if (p_stat(full_path.ptr, &st) < 0) {
|
608
602
|
error = git_path_set_error(errno, entry.path, "stat");
|
609
|
-
|
603
|
+
git_buf_free(&full_path);
|
610
604
|
return error;
|
611
605
|
}
|
612
606
|
|
@@ -627,13 +621,13 @@ int git_diff__oid_for_entry(
|
|
627
621
|
/* if submodule lookup failed probably just in an intermediate
|
628
622
|
* state where some init hasn't happened, so ignore the error
|
629
623
|
*/
|
630
|
-
|
624
|
+
giterr_clear();
|
631
625
|
}
|
632
626
|
} else if (S_ISLNK(mode)) {
|
633
627
|
error = git_odb__hashlink(out, full_path.ptr);
|
634
628
|
diff->base.perf.oid_calculations++;
|
635
629
|
} else if (!git__is_sizet(entry.file_size)) {
|
636
|
-
|
630
|
+
giterr_set(GITERR_OS, "file size overflow (for 32-bits) on '%s'",
|
637
631
|
entry.path);
|
638
632
|
error = -1;
|
639
633
|
} else if (!(error = git_filter_list_load(&fl,
|
@@ -645,7 +639,7 @@ int git_diff__oid_for_entry(
|
|
645
639
|
error = fd;
|
646
640
|
else {
|
647
641
|
error = git_odb__hashfd_filtered(
|
648
|
-
out, fd, (size_t)entry.file_size,
|
642
|
+
out, fd, (size_t)entry.file_size, GIT_OBJ_BLOB, fl);
|
649
643
|
p_close(fd);
|
650
644
|
diff->base.perf.oid_calculations++;
|
651
645
|
}
|
@@ -669,7 +663,7 @@ int git_diff__oid_for_entry(
|
|
669
663
|
}
|
670
664
|
}
|
671
665
|
|
672
|
-
|
666
|
+
git_buf_free(&full_path);
|
673
667
|
return error;
|
674
668
|
}
|
675
669
|
|
@@ -705,7 +699,7 @@ static int maybe_modified_submodule(
|
|
705
699
|
|
706
700
|
/* GIT_EEXISTS means dir with .git in it was found - ignore it */
|
707
701
|
if (error == GIT_EEXISTS) {
|
708
|
-
|
702
|
+
giterr_clear();
|
709
703
|
error = 0;
|
710
704
|
}
|
711
705
|
return error;
|
@@ -769,11 +763,11 @@ static int maybe_modified(
|
|
769
763
|
status = GIT_DELTA_CONFLICTED;
|
770
764
|
|
771
765
|
/* support "assume unchanged" (poorly, b/c we still stat everything) */
|
772
|
-
} else if ((oitem->flags &
|
766
|
+
} else if ((oitem->flags & GIT_IDXENTRY_VALID) != 0) {
|
773
767
|
status = GIT_DELTA_UNMODIFIED;
|
774
768
|
|
775
769
|
/* support "skip worktree" index bit */
|
776
|
-
} else if ((oitem->flags_extended &
|
770
|
+
} else if ((oitem->flags_extended & GIT_IDXENTRY_SKIP_WORKTREE) != 0) {
|
777
771
|
status = GIT_DELTA_UNMODIFIED;
|
778
772
|
|
779
773
|
/* if basic type of file changed, then split into delete and add */
|
@@ -797,13 +791,13 @@ static int maybe_modified(
|
|
797
791
|
/* if oids and modes match (and are valid), then file is unmodified */
|
798
792
|
} else if (git_oid_equal(&oitem->id, &nitem->id) &&
|
799
793
|
omode == nmode &&
|
800
|
-
!
|
794
|
+
!git_oid_iszero(&oitem->id)) {
|
801
795
|
status = GIT_DELTA_UNMODIFIED;
|
802
796
|
|
803
797
|
/* if we have an unknown OID and a workdir iterator, then check some
|
804
798
|
* circumstances that can accelerate things or need special handling
|
805
799
|
*/
|
806
|
-
} else if (
|
800
|
+
} else if (git_oid_iszero(&nitem->id) && new_is_workdir) {
|
807
801
|
bool use_ctime =
|
808
802
|
((diff->diffcaps & GIT_DIFFCAPS_TRUST_CTIME) != 0);
|
809
803
|
git_index *index = git_iterator_index(info->new_iter);
|
@@ -843,7 +837,7 @@ static int maybe_modified(
|
|
843
837
|
/* if we got here and decided that the files are modified, but we
|
844
838
|
* haven't calculated the OID of the new item, then calculate it now
|
845
839
|
*/
|
846
|
-
if (modified_uncertain &&
|
840
|
+
if (modified_uncertain && git_oid_iszero(&nitem->id)) {
|
847
841
|
const git_oid *update_check =
|
848
842
|
DIFF_FLAG_IS_SET(diff, GIT_DIFF_UPDATE_INDEX) && omode == nmode ?
|
849
843
|
&oitem->id : NULL;
|
@@ -877,7 +871,7 @@ static int maybe_modified(
|
|
877
871
|
|
878
872
|
return diff_delta__from_two(
|
879
873
|
diff, status, oitem, omode, nitem, nmode,
|
880
|
-
|
874
|
+
git_oid_iszero(&noid) ? NULL : &noid, matched_pathspec);
|
881
875
|
}
|
882
876
|
|
883
877
|
static bool entry_is_prefixed(
|
@@ -1065,7 +1059,7 @@ static int handle_unmatched_new_item(
|
|
1065
1059
|
|
1066
1060
|
/* if directory is empty, can't advance into it, so skip it */
|
1067
1061
|
if (error == GIT_ENOTFOUND) {
|
1068
|
-
|
1062
|
+
giterr_clear();
|
1069
1063
|
error = iterator_advance(&info->nitem, info->new_iter);
|
1070
1064
|
}
|
1071
1065
|
|
@@ -1087,7 +1081,7 @@ static int handle_unmatched_new_item(
|
|
1087
1081
|
else if (nitem->mode == GIT_FILEMODE_COMMIT) {
|
1088
1082
|
/* ignore things that are not actual submodules */
|
1089
1083
|
if (git_submodule_lookup(NULL, info->repo, nitem->path) != 0) {
|
1090
|
-
|
1084
|
+
giterr_clear();
|
1091
1085
|
delta_type = GIT_DELTA_IGNORED;
|
1092
1086
|
|
1093
1087
|
/* if this contains a tracked item, treat as normal TREE */
|
@@ -1096,7 +1090,7 @@ static int handle_unmatched_new_item(
|
|
1096
1090
|
if (error != GIT_ENOTFOUND)
|
1097
1091
|
return error;
|
1098
1092
|
|
1099
|
-
|
1093
|
+
giterr_clear();
|
1100
1094
|
return iterator_advance(&info->nitem, info->new_iter);
|
1101
1095
|
}
|
1102
1096
|
}
|
@@ -1197,7 +1191,7 @@ int git_diff__from_iterators(
|
|
1197
1191
|
*out = NULL;
|
1198
1192
|
|
1199
1193
|
diff = diff_generated_alloc(repo, old_iter, new_iter);
|
1200
|
-
|
1194
|
+
GITERR_CHECK_ALLOC(diff);
|
1201
1195
|
|
1202
1196
|
info.repo = repo;
|
1203
1197
|
info.old_iter = old_iter;
|
@@ -1262,31 +1256,29 @@ cleanup:
|
|
1262
1256
|
return error;
|
1263
1257
|
}
|
1264
1258
|
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
a
|
1287
|
-
|
1288
|
-
return 0;
|
1289
|
-
}
|
1259
|
+
#define DIFF_FROM_ITERATORS(MAKE_FIRST, FLAGS_FIRST, MAKE_SECOND, FLAGS_SECOND) do { \
|
1260
|
+
git_iterator *a = NULL, *b = NULL; \
|
1261
|
+
char *pfx = (opts && !(opts->flags & GIT_DIFF_DISABLE_PATHSPEC_MATCH)) ? \
|
1262
|
+
git_pathspec_prefix(&opts->pathspec) : NULL; \
|
1263
|
+
git_iterator_options a_opts = GIT_ITERATOR_OPTIONS_INIT, \
|
1264
|
+
b_opts = GIT_ITERATOR_OPTIONS_INIT; \
|
1265
|
+
a_opts.flags = FLAGS_FIRST; \
|
1266
|
+
a_opts.start = pfx; \
|
1267
|
+
a_opts.end = pfx; \
|
1268
|
+
b_opts.flags = FLAGS_SECOND; \
|
1269
|
+
b_opts.start = pfx; \
|
1270
|
+
b_opts.end = pfx; \
|
1271
|
+
GITERR_CHECK_VERSION(opts, GIT_DIFF_OPTIONS_VERSION, "git_diff_options"); \
|
1272
|
+
if (opts && (opts->flags & GIT_DIFF_DISABLE_PATHSPEC_MATCH)) { \
|
1273
|
+
a_opts.pathlist.strings = opts->pathspec.strings; \
|
1274
|
+
a_opts.pathlist.count = opts->pathspec.count; \
|
1275
|
+
b_opts.pathlist.strings = opts->pathspec.strings; \
|
1276
|
+
b_opts.pathlist.count = opts->pathspec.count; \
|
1277
|
+
} \
|
1278
|
+
if (!error && !(error = MAKE_FIRST) && !(error = MAKE_SECOND)) \
|
1279
|
+
error = git_diff__from_iterators(&diff, repo, a, b, opts); \
|
1280
|
+
git__free(pfx); git_iterator_free(a); git_iterator_free(b); \
|
1281
|
+
} while (0)
|
1290
1282
|
|
1291
1283
|
int git_diff_tree_to_tree(
|
1292
1284
|
git_diff **out,
|
@@ -1295,12 +1287,8 @@ int git_diff_tree_to_tree(
|
|
1295
1287
|
git_tree *new_tree,
|
1296
1288
|
const git_diff_options *opts)
|
1297
1289
|
{
|
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
1290
|
git_diff *diff = NULL;
|
1303
|
-
|
1291
|
+
git_iterator_flag_t iflag = GIT_ITERATOR_DONT_IGNORE_CASE;
|
1304
1292
|
int error = 0;
|
1305
1293
|
|
1306
1294
|
assert(out && repo);
|
@@ -1314,19 +1302,13 @@ int git_diff_tree_to_tree(
|
|
1314
1302
|
if (opts && (opts->flags & GIT_DIFF_IGNORE_CASE) != 0)
|
1315
1303
|
iflag = GIT_ITERATOR_IGNORE_CASE;
|
1316
1304
|
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
goto out;
|
1305
|
+
DIFF_FROM_ITERATORS(
|
1306
|
+
git_iterator_for_tree(&a, old_tree, &a_opts), iflag,
|
1307
|
+
git_iterator_for_tree(&b, new_tree, &b_opts), iflag
|
1308
|
+
);
|
1322
1309
|
|
1323
|
-
|
1324
|
-
|
1325
|
-
out:
|
1326
|
-
git_iterator_free(a);
|
1327
|
-
git_iterator_free(b);
|
1328
|
-
git_diff_free(diff);
|
1329
|
-
git__free(prefix);
|
1310
|
+
if (!error)
|
1311
|
+
*out = diff;
|
1330
1312
|
|
1331
1313
|
return error;
|
1332
1314
|
}
|
@@ -1337,7 +1319,7 @@ static int diff_load_index(git_index **index, git_repository *repo)
|
|
1337
1319
|
|
1338
1320
|
/* reload the repository index when user did not pass one in */
|
1339
1321
|
if (!error && git_index_read(*index, false) < 0)
|
1340
|
-
|
1322
|
+
giterr_clear();
|
1341
1323
|
|
1342
1324
|
return error;
|
1343
1325
|
}
|
@@ -1349,13 +1331,9 @@ int git_diff_tree_to_index(
|
|
1349
1331
|
git_index *index,
|
1350
1332
|
const git_diff_options *opts)
|
1351
1333
|
{
|
1334
|
+
git_diff *diff = NULL;
|
1352
1335
|
git_iterator_flag_t iflag = GIT_ITERATOR_DONT_IGNORE_CASE |
|
1353
1336
|
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;
|
1359
1337
|
bool index_ignore_case = false;
|
1360
1338
|
int error = 0;
|
1361
1339
|
|
@@ -1368,23 +1346,17 @@ int git_diff_tree_to_index(
|
|
1368
1346
|
|
1369
1347
|
index_ignore_case = index->ignore_case;
|
1370
1348
|
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
goto out;
|
1349
|
+
DIFF_FROM_ITERATORS(
|
1350
|
+
git_iterator_for_tree(&a, old_tree, &a_opts), iflag,
|
1351
|
+
git_iterator_for_index(&b, repo, index, &b_opts), iflag
|
1352
|
+
);
|
1376
1353
|
|
1377
1354
|
/* if index is in case-insensitive order, re-sort deltas to match */
|
1378
|
-
if (index_ignore_case)
|
1355
|
+
if (!error && index_ignore_case)
|
1379
1356
|
git_diff__set_ignore_case(diff, true);
|
1380
1357
|
|
1381
|
-
|
1382
|
-
|
1383
|
-
out:
|
1384
|
-
git_iterator_free(a);
|
1385
|
-
git_iterator_free(b);
|
1386
|
-
git_diff_free(diff);
|
1387
|
-
git__free(prefix);
|
1358
|
+
if (!error)
|
1359
|
+
*out = diff;
|
1388
1360
|
|
1389
1361
|
return error;
|
1390
1362
|
}
|
@@ -1395,11 +1367,7 @@ int git_diff_index_to_workdir(
|
|
1395
1367
|
git_index *index,
|
1396
1368
|
const git_diff_options *opts)
|
1397
1369
|
{
|
1398
|
-
git_iterator_options a_opts = GIT_ITERATOR_OPTIONS_INIT,
|
1399
|
-
b_opts = GIT_ITERATOR_OPTIONS_INIT;
|
1400
|
-
git_iterator *a = NULL, *b = NULL;
|
1401
1370
|
git_diff *diff = NULL;
|
1402
|
-
char *prefix = NULL;
|
1403
1371
|
int error = 0;
|
1404
1372
|
|
1405
1373
|
assert(out && repo);
|
@@ -1409,24 +1377,20 @@ int git_diff_index_to_workdir(
|
|
1409
1377
|
if (!index && (error = diff_load_index(&index, repo)) < 0)
|
1410
1378
|
return error;
|
1411
1379
|
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
out
|
1426
|
-
git_iterator_free(a);
|
1427
|
-
git_iterator_free(b);
|
1428
|
-
git_diff_free(diff);
|
1429
|
-
git__free(prefix);
|
1380
|
+
DIFF_FROM_ITERATORS(
|
1381
|
+
git_iterator_for_index(&a, repo, index, &a_opts),
|
1382
|
+
GIT_ITERATOR_INCLUDE_CONFLICTS,
|
1383
|
+
|
1384
|
+
git_iterator_for_workdir(&b, repo, index, NULL, &b_opts),
|
1385
|
+
GIT_ITERATOR_DONT_AUTOEXPAND
|
1386
|
+
);
|
1387
|
+
|
1388
|
+
if (!error && (diff->opts.flags & GIT_DIFF_UPDATE_INDEX) != 0 &&
|
1389
|
+
((git_diff_generated *)diff)->index_updated)
|
1390
|
+
error = git_index_write(index);
|
1391
|
+
|
1392
|
+
if (!error)
|
1393
|
+
*out = diff;
|
1430
1394
|
|
1431
1395
|
return error;
|
1432
1396
|
}
|
@@ -1437,33 +1401,24 @@ int git_diff_tree_to_workdir(
|
|
1437
1401
|
git_tree *old_tree,
|
1438
1402
|
const git_diff_options *opts)
|
1439
1403
|
{
|
1440
|
-
git_iterator_options a_opts = GIT_ITERATOR_OPTIONS_INIT,
|
1441
|
-
b_opts = GIT_ITERATOR_OPTIONS_INIT;
|
1442
|
-
git_iterator *a = NULL, *b = NULL;
|
1443
1404
|
git_diff *diff = NULL;
|
1444
|
-
char *prefix = NULL;
|
1445
1405
|
git_index *index;
|
1446
|
-
int error;
|
1406
|
+
int error = 0;
|
1447
1407
|
|
1448
1408
|
assert(out && repo);
|
1449
1409
|
|
1450
1410
|
*out = NULL;
|
1451
1411
|
|
1452
|
-
if ((error =
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
out:
|
1463
|
-
git_iterator_free(a);
|
1464
|
-
git_iterator_free(b);
|
1465
|
-
git_diff_free(diff);
|
1466
|
-
git__free(prefix);
|
1412
|
+
if ((error = git_repository_index__weakptr(&index, repo)))
|
1413
|
+
return error;
|
1414
|
+
|
1415
|
+
DIFF_FROM_ITERATORS(
|
1416
|
+
git_iterator_for_tree(&a, old_tree, &a_opts), 0,
|
1417
|
+
git_iterator_for_workdir(&b, repo, index, old_tree, &b_opts), GIT_ITERATOR_DONT_AUTOEXPAND
|
1418
|
+
);
|
1419
|
+
|
1420
|
+
if (!error)
|
1421
|
+
*out = diff;
|
1467
1422
|
|
1468
1423
|
return error;
|
1469
1424
|
}
|
@@ -1507,35 +1462,24 @@ int git_diff_index_to_index(
|
|
1507
1462
|
git_index *new_index,
|
1508
1463
|
const git_diff_options *opts)
|
1509
1464
|
{
|
1510
|
-
|
1511
|
-
|
1512
|
-
git_iterator *a = NULL, *b = NULL;
|
1513
|
-
git_diff *diff = NULL;
|
1514
|
-
char *prefix = NULL;
|
1515
|
-
int error;
|
1465
|
+
git_diff *diff;
|
1466
|
+
int error = 0;
|
1516
1467
|
|
1517
1468
|
assert(out && old_index && new_index);
|
1518
1469
|
|
1519
1470
|
*out = NULL;
|
1520
1471
|
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
(error = git_diff__from_iterators(&diff, repo, a, b, opts)) < 0)
|
1526
|
-
goto out;
|
1472
|
+
DIFF_FROM_ITERATORS(
|
1473
|
+
git_iterator_for_index(&a, repo, old_index, &a_opts), GIT_ITERATOR_DONT_IGNORE_CASE,
|
1474
|
+
git_iterator_for_index(&b, repo, new_index, &b_opts), GIT_ITERATOR_DONT_IGNORE_CASE
|
1475
|
+
);
|
1527
1476
|
|
1528
1477
|
/* if index is in case-insensitive order, re-sort deltas to match */
|
1529
|
-
if (old_index->ignore_case || new_index->ignore_case)
|
1478
|
+
if (!error && (old_index->ignore_case || new_index->ignore_case))
|
1530
1479
|
git_diff__set_ignore_case(diff, true);
|
1531
1480
|
|
1532
|
-
|
1533
|
-
|
1534
|
-
out:
|
1535
|
-
git_iterator_free(a);
|
1536
|
-
git_iterator_free(b);
|
1537
|
-
git_diff_free(diff);
|
1538
|
-
git__free(prefix);
|
1481
|
+
if (!error)
|
1482
|
+
*out = diff;
|
1539
1483
|
|
1540
1484
|
return error;
|
1541
1485
|
}
|
@@ -1607,7 +1551,7 @@ int git_diff__paired_foreach(
|
|
1607
1551
|
}
|
1608
1552
|
|
1609
1553
|
if ((error = cb(h2i, i2w, payload)) != 0) {
|
1610
|
-
|
1554
|
+
giterr_set_after_callback(error);
|
1611
1555
|
break;
|
1612
1556
|
}
|
1613
1557
|
}
|
@@ -1646,7 +1590,7 @@ int git_diff__commit(
|
|
1646
1590
|
char commit_oidstr[GIT_OID_HEXSZ + 1];
|
1647
1591
|
|
1648
1592
|
error = -1;
|
1649
|
-
|
1593
|
+
giterr_set(GITERR_INVALID, "commit %s is a merge commit",
|
1650
1594
|
git_oid_tostr(commit_oidstr, GIT_OID_HEXSZ + 1, git_commit_id(commit)));
|
1651
1595
|
goto on_error;
|
1652
1596
|
}
|