rugged 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +1 -0
- data/README.md +3 -3
- data/ext/rugged/rugged.c +7 -4
- data/ext/rugged/rugged_commit.c +1 -1
- data/ext/rugged/rugged_config.c +1 -1
- data/ext/rugged/rugged_object.c +1 -1
- data/ext/rugged/rugged_remote.c +32 -2
- data/ext/rugged/rugged_repo.c +13 -3
- data/lib/rugged/commit.rb +17 -4
- data/lib/rugged/repository.rb +7 -8
- data/lib/rugged/submodule_collection.rb +4 -4
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/CMakeLists.txt +41 -74
- data/vendor/libgit2/COPYING +109 -1
- data/vendor/libgit2/cmake/{Modules/AddCFlagIfSupported.cmake → AddCFlagIfSupported.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/EnableWarnings.cmake → EnableWarnings.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindCoreFoundation.cmake → FindCoreFoundation.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindGSSAPI.cmake → FindGSSAPI.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindGSSFramework.cmake → FindGSSFramework.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindHTTP_Parser.cmake → FindHTTP_Parser.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindIconv.cmake → FindIconv.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindPCRE.cmake → FindPCRE.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindPCRE2.cmake → FindPCRE2.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindPkgLibraries.cmake → FindPkgLibraries.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindSecurity.cmake → FindSecurity.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindStatNsec.cmake → FindStatNsec.cmake} +0 -0
- data/vendor/libgit2/cmake/Findfutimens.cmake +14 -0
- data/vendor/libgit2/cmake/{Modules/FindmbedTLS.cmake → FindmbedTLS.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/IdeSplitSources.cmake → IdeSplitSources.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/PkgBuildConfig.cmake → PkgBuildConfig.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/SanitizeBool.cmake → SanitizeBool.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/SelectGSSAPI.cmake → SelectGSSAPI.cmake} +18 -26
- data/vendor/libgit2/cmake/{Modules/SelectHTTPSBackend.cmake → SelectHTTPSBackend.cmake} +29 -32
- data/vendor/libgit2/cmake/{Modules/SelectHashes.cmake → SelectHashes.cmake} +21 -28
- data/vendor/libgit2/deps/chromium-zlib/CMakeLists.txt +101 -0
- data/vendor/libgit2/deps/http-parser/CMakeLists.txt +4 -3
- data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +24 -10
- data/vendor/libgit2/deps/ntlmclient/compat.h +0 -27
- data/vendor/libgit2/deps/ntlmclient/crypt.h +14 -9
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +20 -20
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +3 -3
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +37 -36
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +4 -3
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +178 -51
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +74 -5
- data/vendor/libgit2/deps/ntlmclient/ntlm.c +164 -135
- data/vendor/libgit2/deps/ntlmclient/ntlm.h +13 -9
- data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +16 -3
- data/vendor/libgit2/deps/ntlmclient/unicode.h +10 -4
- data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +16 -27
- data/vendor/libgit2/deps/ntlmclient/unicode_builtin.h +20 -0
- data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +28 -52
- data/vendor/libgit2/deps/ntlmclient/unicode_iconv.h +22 -0
- data/vendor/libgit2/deps/ntlmclient/util.c +15 -1
- data/vendor/libgit2/deps/ntlmclient/util.h +2 -1
- data/vendor/libgit2/deps/pcre/LICENCE +93 -0
- data/vendor/libgit2/deps/pcre/pcre.h +2 -2
- data/vendor/libgit2/deps/pcre/pcre_compile.c +29 -17
- data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +4 -4
- data/vendor/libgit2/deps/pcre/pcreposix.c +2 -3
- data/vendor/libgit2/deps/zlib/CMakeLists.txt +6 -5
- data/vendor/libgit2/deps/zlib/deflate.c +1 -0
- data/vendor/libgit2/include/git2/annotated_commit.h +1 -1
- data/vendor/libgit2/include/git2/apply.h +2 -0
- data/vendor/libgit2/include/git2/attr.h +89 -0
- data/vendor/libgit2/include/git2/blame.h +95 -42
- data/vendor/libgit2/include/git2/blob.h +31 -3
- data/vendor/libgit2/include/git2/branch.h +25 -0
- data/vendor/libgit2/include/git2/cert.h +42 -5
- data/vendor/libgit2/include/git2/checkout.h +28 -12
- data/vendor/libgit2/include/git2/commit.h +35 -19
- data/vendor/libgit2/include/git2/common.h +33 -6
- data/vendor/libgit2/include/git2/config.h +1 -1
- data/vendor/libgit2/include/git2/deprecated.h +248 -8
- data/vendor/libgit2/include/git2/diff.h +35 -20
- data/vendor/libgit2/include/git2/errors.h +8 -7
- data/vendor/libgit2/include/git2/filter.h +57 -17
- data/vendor/libgit2/include/git2/graph.h +20 -2
- data/vendor/libgit2/include/git2/index.h +4 -5
- data/vendor/libgit2/include/git2/indexer.h +2 -1
- data/vendor/libgit2/include/git2/odb.h +44 -20
- data/vendor/libgit2/include/git2/pack.h +1 -1
- data/vendor/libgit2/include/git2/patch.h +8 -0
- data/vendor/libgit2/include/git2/rebase.h +25 -1
- data/vendor/libgit2/include/git2/refs.h +9 -5
- data/vendor/libgit2/include/git2/remote.h +59 -6
- data/vendor/libgit2/include/git2/repository.h +95 -52
- data/vendor/libgit2/include/git2/revparse.h +5 -5
- data/vendor/libgit2/include/git2/status.h +115 -59
- data/vendor/libgit2/include/git2/strarray.h +6 -10
- data/vendor/libgit2/include/git2/submodule.h +9 -0
- data/vendor/libgit2/include/git2/sys/commit_graph.h +174 -0
- data/vendor/libgit2/include/git2/sys/filter.h +49 -28
- data/vendor/libgit2/include/git2/sys/midx.h +74 -0
- data/vendor/libgit2/include/git2/sys/odb_backend.h +7 -0
- data/vendor/libgit2/include/git2/sys/transport.h +1 -0
- data/vendor/libgit2/include/git2/tag.h +12 -0
- data/vendor/libgit2/include/git2/transport.h +1 -1
- data/vendor/libgit2/include/git2/tree.h +2 -14
- data/vendor/libgit2/include/git2/types.h +9 -0
- data/vendor/libgit2/include/git2/version.h +3 -3
- data/vendor/libgit2/include/git2/worktree.h +1 -0
- data/vendor/libgit2/src/CMakeLists.txt +77 -44
- data/vendor/libgit2/src/alloc.c +21 -8
- data/vendor/libgit2/src/allocators/failalloc.c +92 -0
- data/vendor/libgit2/src/allocators/failalloc.h +23 -0
- data/vendor/libgit2/src/allocators/stdalloc.c +41 -10
- data/vendor/libgit2/src/allocators/win32_leakcheck.c +118 -0
- data/vendor/libgit2/src/allocators/{win32_crtdbg.h → win32_leakcheck.h} +3 -3
- data/vendor/libgit2/src/annotated_commit.c +21 -9
- data/vendor/libgit2/src/apply.c +21 -8
- data/vendor/libgit2/src/array.h +11 -11
- data/vendor/libgit2/src/assert_safe.h +58 -0
- data/vendor/libgit2/src/attr.c +181 -74
- data/vendor/libgit2/src/attr_file.c +92 -42
- data/vendor/libgit2/src/attr_file.h +32 -11
- data/vendor/libgit2/src/attrcache.c +44 -40
- data/vendor/libgit2/src/attrcache.h +4 -5
- data/vendor/libgit2/src/blame.c +28 -15
- data/vendor/libgit2/src/blame_git.c +6 -3
- data/vendor/libgit2/src/blob.c +46 -24
- data/vendor/libgit2/src/branch.c +87 -37
- data/vendor/libgit2/src/buffer.c +339 -27
- data/vendor/libgit2/src/buffer.h +153 -2
- data/vendor/libgit2/src/cache.c +3 -24
- data/vendor/libgit2/src/cache.h +7 -7
- data/vendor/libgit2/src/cc-compat.h +10 -2
- data/vendor/libgit2/src/checkout.c +97 -98
- data/vendor/libgit2/src/cherrypick.c +8 -2
- data/vendor/libgit2/src/clone.c +104 -29
- data/vendor/libgit2/src/commit.c +41 -28
- data/vendor/libgit2/src/commit_graph.c +1209 -0
- data/vendor/libgit2/src/commit_graph.h +162 -0
- data/vendor/libgit2/src/commit_list.c +46 -0
- data/vendor/libgit2/src/commit_list.h +2 -0
- data/vendor/libgit2/src/common.h +26 -2
- data/vendor/libgit2/src/config.c +40 -22
- data/vendor/libgit2/src/config_cache.c +9 -4
- data/vendor/libgit2/src/config_entries.c +35 -27
- data/vendor/libgit2/src/config_file.c +25 -8
- data/vendor/libgit2/src/config_parse.c +5 -7
- data/vendor/libgit2/src/config_snapshot.c +2 -1
- data/vendor/libgit2/src/crlf.c +16 -6
- data/vendor/libgit2/src/date.c +4 -3
- data/vendor/libgit2/src/delta.c +1 -1
- data/vendor/libgit2/src/describe.c +11 -4
- data/vendor/libgit2/src/diff.c +23 -19
- data/vendor/libgit2/src/diff_driver.c +21 -17
- data/vendor/libgit2/src/diff_file.c +5 -7
- data/vendor/libgit2/src/diff_generate.c +56 -28
- data/vendor/libgit2/src/diff_parse.c +2 -3
- data/vendor/libgit2/src/diff_print.c +81 -65
- data/vendor/libgit2/src/diff_stats.c +19 -16
- data/vendor/libgit2/src/diff_tform.c +13 -13
- data/vendor/libgit2/src/diff_xdiff.c +4 -2
- data/vendor/libgit2/src/diff_xdiff.h +1 -1
- data/vendor/libgit2/src/errors.c +26 -19
- data/vendor/libgit2/src/features.h.in +5 -1
- data/vendor/libgit2/src/fetch.c +7 -2
- data/vendor/libgit2/src/fetchhead.c +8 -4
- data/vendor/libgit2/src/filebuf.c +9 -7
- data/vendor/libgit2/src/filter.c +209 -113
- data/vendor/libgit2/src/filter.h +24 -5
- data/vendor/libgit2/src/futils.c +8 -8
- data/vendor/libgit2/src/futils.h +4 -4
- data/vendor/libgit2/src/graph.c +64 -9
- data/vendor/libgit2/src/hash/sha1/collisiondetect.c +3 -3
- data/vendor/libgit2/src/hash/sha1/common_crypto.c +3 -3
- data/vendor/libgit2/src/hash/sha1/generic.h +1 -1
- data/vendor/libgit2/src/hash/sha1/mbedtls.c +12 -12
- data/vendor/libgit2/src/hash/sha1/openssl.c +3 -3
- data/vendor/libgit2/src/hash/sha1/sha1dc/sha1.c +0 -2
- data/vendor/libgit2/src/hash/sha1/win32.c +15 -11
- data/vendor/libgit2/src/hash.c +16 -13
- data/vendor/libgit2/src/hash.h +1 -1
- data/vendor/libgit2/src/hashsig.c +23 -10
- data/vendor/libgit2/src/ident.c +13 -3
- data/vendor/libgit2/src/idxmap.c +0 -22
- data/vendor/libgit2/src/ignore.c +35 -19
- data/vendor/libgit2/src/index.c +126 -84
- data/vendor/libgit2/src/index.h +1 -1
- data/vendor/libgit2/src/indexer.c +60 -36
- data/vendor/libgit2/src/integer.h +79 -2
- data/vendor/libgit2/src/iterator.c +40 -28
- data/vendor/libgit2/src/iterator.h +1 -1
- data/vendor/libgit2/src/khash.h +2 -11
- data/vendor/libgit2/src/{settings.c → libgit2.c} +125 -49
- data/vendor/libgit2/src/libgit2.h +15 -0
- data/vendor/libgit2/src/mailmap.c +23 -10
- data/vendor/libgit2/src/map.h +3 -3
- data/vendor/libgit2/src/merge.c +108 -46
- data/vendor/libgit2/src/merge.h +2 -1
- data/vendor/libgit2/src/merge_driver.c +19 -13
- data/vendor/libgit2/src/merge_file.c +15 -9
- data/vendor/libgit2/src/message.c +3 -1
- data/vendor/libgit2/src/midx.c +879 -0
- data/vendor/libgit2/src/midx.h +110 -0
- data/vendor/libgit2/src/mwindow.c +214 -95
- data/vendor/libgit2/src/mwindow.h +3 -3
- data/vendor/libgit2/src/net.c +133 -4
- data/vendor/libgit2/src/net.h +16 -2
- data/vendor/libgit2/src/netops.c +6 -4
- data/vendor/libgit2/src/netops.h +2 -2
- data/vendor/libgit2/src/notes.c +10 -10
- data/vendor/libgit2/src/object.c +24 -15
- data/vendor/libgit2/src/odb.c +298 -57
- data/vendor/libgit2/src/odb.h +16 -2
- data/vendor/libgit2/src/odb_loose.c +31 -21
- data/vendor/libgit2/src/odb_mempack.c +3 -1
- data/vendor/libgit2/src/odb_pack.c +391 -114
- data/vendor/libgit2/src/oid.c +7 -4
- data/vendor/libgit2/src/pack-objects.c +83 -69
- data/vendor/libgit2/src/pack.c +383 -150
- data/vendor/libgit2/src/pack.h +44 -9
- data/vendor/libgit2/src/patch.c +14 -7
- data/vendor/libgit2/src/patch_generate.c +3 -5
- data/vendor/libgit2/src/patch_parse.c +6 -3
- data/vendor/libgit2/src/path.c +102 -57
- data/vendor/libgit2/src/path.h +79 -6
- data/vendor/libgit2/src/pathspec.c +12 -11
- data/vendor/libgit2/src/pool.c +34 -22
- data/vendor/libgit2/src/pool.h +9 -1
- data/vendor/libgit2/src/posix.c +43 -12
- data/vendor/libgit2/src/posix.h +9 -0
- data/vendor/libgit2/src/proxy.c +2 -0
- data/vendor/libgit2/src/push.c +2 -0
- data/vendor/libgit2/src/reader.c +10 -6
- data/vendor/libgit2/src/rebase.c +95 -49
- data/vendor/libgit2/src/refdb.c +165 -13
- data/vendor/libgit2/src/refdb.h +69 -0
- data/vendor/libgit2/src/refdb_fs.c +144 -152
- data/vendor/libgit2/src/reflog.c +21 -20
- data/vendor/libgit2/src/refs.c +151 -231
- data/vendor/libgit2/src/refs.h +2 -20
- data/vendor/libgit2/src/refspec.c +80 -44
- data/vendor/libgit2/src/regexp.c +2 -2
- data/vendor/libgit2/src/remote.c +312 -121
- data/vendor/libgit2/src/remote.h +2 -1
- data/vendor/libgit2/src/repository.c +351 -189
- data/vendor/libgit2/src/repository.h +23 -29
- data/vendor/libgit2/src/reset.c +7 -6
- data/vendor/libgit2/src/revert.c +8 -2
- data/vendor/libgit2/src/revparse.c +19 -13
- data/vendor/libgit2/src/revwalk.c +35 -20
- data/vendor/libgit2/src/runtime.c +162 -0
- data/vendor/libgit2/src/runtime.h +62 -0
- data/vendor/libgit2/src/{refdb_fs.h → settings.h} +3 -11
- data/vendor/libgit2/src/signature.c +6 -5
- data/vendor/libgit2/src/sortedcache.c +2 -3
- data/vendor/libgit2/src/sortedcache.h +10 -8
- data/vendor/libgit2/src/stash.c +7 -3
- data/vendor/libgit2/src/status.c +9 -4
- data/vendor/libgit2/src/strarray.c +64 -0
- data/vendor/libgit2/src/streams/mbedtls.c +14 -17
- data/vendor/libgit2/src/streams/mbedtls.h +1 -1
- data/vendor/libgit2/src/streams/openssl.c +113 -207
- data/vendor/libgit2/src/streams/openssl.h +9 -1
- data/vendor/libgit2/src/streams/openssl_dynamic.c +309 -0
- data/vendor/libgit2/src/streams/openssl_dynamic.h +348 -0
- data/vendor/libgit2/src/streams/openssl_legacy.c +203 -0
- data/vendor/libgit2/src/streams/openssl_legacy.h +63 -0
- data/vendor/libgit2/src/streams/registry.c +10 -9
- data/vendor/libgit2/src/streams/socket.c +6 -2
- data/vendor/libgit2/src/streams/stransport.c +6 -3
- data/vendor/libgit2/src/streams/tls.c +5 -3
- data/vendor/libgit2/src/submodule.c +134 -66
- data/vendor/libgit2/src/submodule.h +9 -9
- data/vendor/libgit2/src/sysdir.c +8 -26
- data/vendor/libgit2/src/sysdir.h +0 -11
- data/vendor/libgit2/src/tag.c +49 -11
- data/vendor/libgit2/src/thread.c +140 -0
- data/vendor/libgit2/src/thread.h +479 -0
- data/vendor/libgit2/src/threadstate.c +83 -0
- data/vendor/libgit2/src/threadstate.h +24 -0
- data/vendor/libgit2/src/trace.c +2 -2
- data/vendor/libgit2/src/trace.h +17 -13
- data/vendor/libgit2/src/transaction.c +21 -9
- data/vendor/libgit2/src/transport.c +3 -3
- data/vendor/libgit2/src/transports/auth.c +1 -1
- data/vendor/libgit2/src/transports/auth_negotiate.c +11 -4
- data/vendor/libgit2/src/transports/auth_ntlm.c +10 -6
- data/vendor/libgit2/src/transports/credential.c +17 -7
- data/vendor/libgit2/src/transports/credential_helpers.c +2 -0
- data/vendor/libgit2/src/transports/git.c +1 -3
- data/vendor/libgit2/src/transports/http.c +19 -17
- data/vendor/libgit2/src/transports/http.h +1 -0
- data/vendor/libgit2/src/transports/httpclient.c +84 -42
- data/vendor/libgit2/src/transports/httpclient.h +1 -1
- data/vendor/libgit2/src/transports/local.c +5 -5
- data/vendor/libgit2/src/transports/smart.c +14 -9
- data/vendor/libgit2/src/transports/smart.h +1 -1
- data/vendor/libgit2/src/transports/smart_protocol.c +11 -5
- data/vendor/libgit2/src/transports/ssh.c +51 -17
- data/vendor/libgit2/src/transports/winhttp.c +156 -88
- data/vendor/libgit2/src/tree.c +100 -77
- data/vendor/libgit2/src/tree.h +1 -0
- data/vendor/libgit2/src/tsort.c +0 -2
- data/vendor/libgit2/src/unix/map.c +3 -1
- data/vendor/libgit2/src/unix/posix.h +16 -1
- data/vendor/libgit2/src/unix/pthread.h +2 -1
- data/vendor/libgit2/src/utf8.c +150 -0
- data/vendor/libgit2/src/utf8.h +52 -0
- data/vendor/libgit2/src/util.c +74 -183
- data/vendor/libgit2/src/util.h +33 -39
- data/vendor/libgit2/src/vector.c +23 -19
- data/vendor/libgit2/src/vector.h +4 -2
- data/vendor/libgit2/src/win32/findfile.c +4 -2
- data/vendor/libgit2/src/win32/git2.rc +18 -3
- data/vendor/libgit2/src/win32/map.c +1 -1
- data/vendor/libgit2/src/win32/msvc-compat.h +9 -1
- data/vendor/libgit2/src/win32/path_w32.c +23 -25
- data/vendor/libgit2/src/win32/path_w32.h +0 -1
- data/vendor/libgit2/src/win32/posix_w32.c +77 -1
- data/vendor/libgit2/src/win32/precompiled.h +0 -1
- data/vendor/libgit2/src/win32/reparse.h +4 -4
- data/vendor/libgit2/src/win32/thread.c +24 -15
- data/vendor/libgit2/src/win32/thread.h +1 -1
- data/vendor/libgit2/src/win32/w32_buffer.c +3 -3
- data/vendor/libgit2/src/win32/w32_common.h +18 -9
- data/vendor/libgit2/src/win32/{w32_crtdbg_stacktrace.c → w32_leakcheck.c} +269 -33
- data/vendor/libgit2/src/win32/w32_leakcheck.h +222 -0
- data/vendor/libgit2/src/win32/w32_util.h +6 -6
- data/vendor/libgit2/src/worktree.c +37 -15
- data/vendor/libgit2/src/zstream.c +1 -1
- metadata +56 -38
- data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in +0 -29
- data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake +0 -96
- data/vendor/libgit2/src/allocators/win32_crtdbg.c +0 -118
- data/vendor/libgit2/src/buf_text.c +0 -316
- data/vendor/libgit2/src/buf_text.h +0 -122
- data/vendor/libgit2/src/global.c +0 -361
- data/vendor/libgit2/src/global.h +0 -41
- data/vendor/libgit2/src/thread-utils.c +0 -58
- data/vendor/libgit2/src/thread-utils.h +0 -246
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +0 -127
- data/vendor/libgit2/src/win32/w32_stack.c +0 -188
- data/vendor/libgit2/src/win32/w32_stack.h +0 -140
|
@@ -52,9 +52,8 @@ static git_diff_parsed *diff_parsed_alloc(void)
|
|
|
52
52
|
|
|
53
53
|
diff->base.opts.flags &= ~GIT_DIFF_IGNORE_CASE;
|
|
54
54
|
|
|
55
|
-
git_pool_init(&diff->base.pool, 1)
|
|
56
|
-
|
|
57
|
-
if (git_vector_init(&diff->patches, 0, NULL) < 0 ||
|
|
55
|
+
if (git_pool_init(&diff->base.pool, 1) < 0 ||
|
|
56
|
+
git_vector_init(&diff->patches, 0, NULL) < 0 ||
|
|
58
57
|
git_vector_init(&diff->base.deltas, 0, git_diff_delta__cmp) < 0) {
|
|
59
58
|
git_diff_free(&diff->base);
|
|
60
59
|
return NULL;
|
|
@@ -95,7 +95,7 @@ static int diff_print_info_init_frompatch(
|
|
|
95
95
|
git_diff_line_cb cb,
|
|
96
96
|
void *payload)
|
|
97
97
|
{
|
|
98
|
-
|
|
98
|
+
GIT_ASSERT_ARG(patch);
|
|
99
99
|
|
|
100
100
|
memset(pi, 0, sizeof(diff_print_info));
|
|
101
101
|
|
|
@@ -337,7 +337,7 @@ static int diff_delta_format_with_paths(
|
|
|
337
337
|
return git_buf_printf(out, template, oldpath, newpath);
|
|
338
338
|
}
|
|
339
339
|
|
|
340
|
-
int diff_delta_format_similarity_header(
|
|
340
|
+
static int diff_delta_format_similarity_header(
|
|
341
341
|
git_buf *out,
|
|
342
342
|
const git_diff_delta *delta)
|
|
343
343
|
{
|
|
@@ -351,17 +351,16 @@ int diff_delta_format_similarity_header(
|
|
|
351
351
|
goto done;
|
|
352
352
|
}
|
|
353
353
|
|
|
354
|
+
GIT_ASSERT(delta->status == GIT_DELTA_RENAMED || delta->status == GIT_DELTA_COPIED);
|
|
354
355
|
if (delta->status == GIT_DELTA_RENAMED)
|
|
355
356
|
type = "rename";
|
|
356
|
-
else if (delta->status == GIT_DELTA_COPIED)
|
|
357
|
-
type = "copy";
|
|
358
357
|
else
|
|
359
|
-
|
|
358
|
+
type = "copy";
|
|
360
359
|
|
|
361
360
|
if ((error = git_buf_puts(&old_path, delta->old_file.path)) < 0 ||
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
361
|
+
(error = git_buf_puts(&new_path, delta->new_file.path)) < 0 ||
|
|
362
|
+
(error = git_buf_quote(&old_path)) < 0 ||
|
|
363
|
+
(error = git_buf_quote(&new_path)) < 0)
|
|
365
364
|
goto done;
|
|
366
365
|
|
|
367
366
|
git_buf_printf(out,
|
|
@@ -428,8 +427,11 @@ int git_diff_delta__format_file_header(
|
|
|
428
427
|
git_buf_printf(out, "diff --git %s %s\n",
|
|
429
428
|
old_path.ptr, new_path.ptr);
|
|
430
429
|
|
|
430
|
+
if (unchanged && delta->old_file.mode != delta->new_file.mode)
|
|
431
|
+
diff_print_modes(out, delta);
|
|
432
|
+
|
|
431
433
|
if (delta->status == GIT_DELTA_RENAMED ||
|
|
432
|
-
|
|
434
|
+
(delta->status == GIT_DELTA_COPIED && unchanged)) {
|
|
433
435
|
if ((error = diff_delta_format_similarity_header(out, delta)) < 0)
|
|
434
436
|
goto done;
|
|
435
437
|
}
|
|
@@ -444,9 +446,6 @@ int git_diff_delta__format_file_header(
|
|
|
444
446
|
"--- %s\n+++ %s\n", old_path.ptr, new_path.ptr);
|
|
445
447
|
}
|
|
446
448
|
|
|
447
|
-
if (unchanged && delta->old_file.mode != delta->new_file.mode)
|
|
448
|
-
diff_print_modes(out, delta);
|
|
449
|
-
|
|
450
449
|
if (git_buf_oom(out))
|
|
451
450
|
error = -1;
|
|
452
451
|
|
|
@@ -492,6 +491,9 @@ static int format_binary(
|
|
|
492
491
|
}
|
|
493
492
|
git_buf_putc(pi->buf, '\n');
|
|
494
493
|
|
|
494
|
+
if (git_buf_oom(pi->buf))
|
|
495
|
+
return -1;
|
|
496
|
+
|
|
495
497
|
return 0;
|
|
496
498
|
}
|
|
497
499
|
|
|
@@ -502,21 +504,17 @@ static int diff_print_patch_file_binary_noshow(
|
|
|
502
504
|
git_buf old_path = GIT_BUF_INIT, new_path = GIT_BUF_INIT;
|
|
503
505
|
int error;
|
|
504
506
|
|
|
505
|
-
if ((error = diff_delta_format_path(
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
507
|
+
if ((error = diff_delta_format_path(&old_path, old_pfx, delta->old_file.path)) < 0 ||
|
|
508
|
+
(error = diff_delta_format_path(&new_path, new_pfx, delta->new_file.path)) < 0 ||
|
|
509
|
+
(error = diff_delta_format_with_paths(pi->buf, delta, "Binary files %s and %s differ\n",
|
|
510
|
+
old_path.ptr, new_path.ptr)) < 0)
|
|
509
511
|
goto done;
|
|
510
512
|
|
|
511
513
|
pi->line.num_lines = 1;
|
|
512
|
-
error = diff_delta_format_with_paths(
|
|
513
|
-
pi->buf, delta, "Binary files %s and %s differ\n",
|
|
514
|
-
old_path.ptr, new_path.ptr);
|
|
515
514
|
|
|
516
515
|
done:
|
|
517
516
|
git_buf_dispose(&old_path);
|
|
518
517
|
git_buf_dispose(&new_path);
|
|
519
|
-
|
|
520
518
|
return error;
|
|
521
519
|
}
|
|
522
520
|
|
|
@@ -540,10 +538,9 @@ static int diff_print_patch_file_binary(
|
|
|
540
538
|
pi->line.num_lines++;
|
|
541
539
|
|
|
542
540
|
if ((error = format_binary(pi, binary->new_file.type, binary->new_file.data,
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
541
|
+
binary->new_file.datalen, binary->new_file.inflatedlen)) < 0 ||
|
|
542
|
+
(error = format_binary(pi, binary->old_file.type, binary->old_file.data,
|
|
543
|
+
binary->old_file.datalen, binary->old_file.inflatedlen)) < 0) {
|
|
547
544
|
if (error == GIT_EBUFS) {
|
|
548
545
|
git_error_clear();
|
|
549
546
|
git_buf_truncate(pi->buf, pre_binary_size);
|
|
@@ -580,16 +577,15 @@ static int diff_print_patch_file(
|
|
|
580
577
|
GIT_UNUSED(progress);
|
|
581
578
|
|
|
582
579
|
if (S_ISDIR(delta->new_file.mode) ||
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
580
|
+
delta->status == GIT_DELTA_UNMODIFIED ||
|
|
581
|
+
delta->status == GIT_DELTA_IGNORED ||
|
|
582
|
+
delta->status == GIT_DELTA_UNREADABLE ||
|
|
583
|
+
(delta->status == GIT_DELTA_UNTRACKED &&
|
|
587
584
|
(pi->flags & GIT_DIFF_SHOW_UNTRACKED_CONTENT) == 0))
|
|
588
585
|
return 0;
|
|
589
586
|
|
|
590
|
-
if ((error = git_diff_delta__format_file_header(
|
|
591
|
-
|
|
592
|
-
id_strlen, print_index)) < 0)
|
|
587
|
+
if ((error = git_diff_delta__format_file_header(pi->buf, delta, oldpfx, newpfx,
|
|
588
|
+
id_strlen, print_index)) < 0)
|
|
593
589
|
return error;
|
|
594
590
|
|
|
595
591
|
pi->line.origin = GIT_DIFF_LINE_FILE_HDR;
|
|
@@ -699,17 +695,16 @@ int git_diff_print(
|
|
|
699
695
|
return -1;
|
|
700
696
|
}
|
|
701
697
|
|
|
702
|
-
if (
|
|
703
|
-
|
|
704
|
-
error = git_diff_foreach(
|
|
705
|
-
diff, print_file, print_binary, print_hunk, print_line, &pi);
|
|
698
|
+
if ((error = diff_print_info_init_fromdiff(&pi, &buf, diff, format, print_cb, payload)) < 0)
|
|
699
|
+
goto out;
|
|
706
700
|
|
|
707
|
-
|
|
708
|
-
|
|
701
|
+
if ((error = git_diff_foreach(diff, print_file, print_binary, print_hunk, print_line, &pi)) != 0) {
|
|
702
|
+
git_error_set_after_callback_function(error, "git_diff_print");
|
|
703
|
+
goto out;
|
|
709
704
|
}
|
|
710
705
|
|
|
706
|
+
out:
|
|
711
707
|
git_buf_dispose(&buf);
|
|
712
|
-
|
|
713
708
|
return error;
|
|
714
709
|
}
|
|
715
710
|
|
|
@@ -728,8 +723,8 @@ int git_diff_print_callback__to_buf(
|
|
|
728
723
|
}
|
|
729
724
|
|
|
730
725
|
if (line->origin == GIT_DIFF_LINE_ADDITION ||
|
|
731
|
-
|
|
732
|
-
|
|
726
|
+
line->origin == GIT_DIFF_LINE_DELETION ||
|
|
727
|
+
line->origin == GIT_DIFF_LINE_CONTEXT)
|
|
733
728
|
git_buf_putc(output, line->origin);
|
|
734
729
|
|
|
735
730
|
return git_buf_put(output, line->content, line->content_len);
|
|
@@ -742,24 +737,42 @@ int git_diff_print_callback__to_file_handle(
|
|
|
742
737
|
void *payload)
|
|
743
738
|
{
|
|
744
739
|
FILE *fp = payload ? payload : stdout;
|
|
740
|
+
int error;
|
|
745
741
|
|
|
746
|
-
GIT_UNUSED(delta);
|
|
742
|
+
GIT_UNUSED(delta);
|
|
743
|
+
GIT_UNUSED(hunk);
|
|
747
744
|
|
|
748
745
|
if (line->origin == GIT_DIFF_LINE_CONTEXT ||
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
fputc(line->origin, fp)
|
|
752
|
-
|
|
746
|
+
line->origin == GIT_DIFF_LINE_ADDITION ||
|
|
747
|
+
line->origin == GIT_DIFF_LINE_DELETION) {
|
|
748
|
+
while ((error = fputc(line->origin, fp)) == EINTR)
|
|
749
|
+
continue;
|
|
750
|
+
if (error) {
|
|
751
|
+
git_error_set(GIT_ERROR_OS, "could not write status");
|
|
752
|
+
return -1;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
if (fwrite(line->content, line->content_len, 1, fp) != 1) {
|
|
757
|
+
git_error_set(GIT_ERROR_OS, "could not write line");
|
|
758
|
+
return -1;
|
|
759
|
+
}
|
|
760
|
+
|
|
753
761
|
return 0;
|
|
754
762
|
}
|
|
755
763
|
|
|
756
764
|
/* print a git_diff to a git_buf */
|
|
757
765
|
int git_diff_to_buf(git_buf *out, git_diff *diff, git_diff_format_t format)
|
|
758
766
|
{
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
767
|
+
int error;
|
|
768
|
+
|
|
769
|
+
GIT_ASSERT_ARG(out);
|
|
770
|
+
GIT_ASSERT_ARG(diff);
|
|
771
|
+
|
|
772
|
+
if ((error = git_buf_sanitize(out)) < 0)
|
|
773
|
+
return error;
|
|
774
|
+
|
|
775
|
+
return git_diff_print(diff, format, git_diff_print_callback__to_buf, out);
|
|
763
776
|
}
|
|
764
777
|
|
|
765
778
|
/* print a git_patch to an output callback */
|
|
@@ -768,35 +781,38 @@ int git_patch_print(
|
|
|
768
781
|
git_diff_line_cb print_cb,
|
|
769
782
|
void *payload)
|
|
770
783
|
{
|
|
771
|
-
int error;
|
|
772
784
|
git_buf temp = GIT_BUF_INIT;
|
|
773
785
|
diff_print_info pi;
|
|
786
|
+
int error;
|
|
774
787
|
|
|
775
|
-
|
|
788
|
+
GIT_ASSERT_ARG(patch);
|
|
789
|
+
GIT_ASSERT_ARG(print_cb);
|
|
776
790
|
|
|
777
|
-
if (
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
{
|
|
781
|
-
error = git_patch__invoke_callbacks(
|
|
782
|
-
patch,
|
|
783
|
-
diff_print_patch_file, diff_print_patch_binary,
|
|
784
|
-
diff_print_patch_hunk, diff_print_patch_line,
|
|
785
|
-
&pi);
|
|
791
|
+
if ((error = diff_print_info_init_frompatch(&pi, &temp, patch,
|
|
792
|
+
GIT_DIFF_FORMAT_PATCH, print_cb, payload)) < 0)
|
|
793
|
+
goto out;
|
|
786
794
|
|
|
787
|
-
|
|
788
|
-
|
|
795
|
+
if ((error = git_patch__invoke_callbacks(patch, diff_print_patch_file, diff_print_patch_binary,
|
|
796
|
+
diff_print_patch_hunk, diff_print_patch_line, &pi)) < 0) {
|
|
797
|
+
git_error_set_after_callback_function(error, "git_patch_print");
|
|
798
|
+
goto out;
|
|
789
799
|
}
|
|
790
800
|
|
|
801
|
+
out:
|
|
791
802
|
git_buf_dispose(&temp);
|
|
792
|
-
|
|
793
803
|
return error;
|
|
794
804
|
}
|
|
795
805
|
|
|
796
806
|
/* print a git_patch to a git_buf */
|
|
797
807
|
int git_patch_to_buf(git_buf *out, git_patch *patch)
|
|
798
808
|
{
|
|
799
|
-
|
|
800
|
-
|
|
809
|
+
int error;
|
|
810
|
+
|
|
811
|
+
GIT_ASSERT_ARG(out);
|
|
812
|
+
GIT_ASSERT_ARG(patch);
|
|
813
|
+
|
|
814
|
+
if ((error = git_buf_sanitize(out)) < 0)
|
|
815
|
+
return error;
|
|
816
|
+
|
|
801
817
|
return git_patch_print(patch, git_diff_print_callback__to_buf, out);
|
|
802
818
|
}
|
|
@@ -46,14 +46,14 @@ static int digits_for_value(size_t val)
|
|
|
46
46
|
return count;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
int
|
|
49
|
+
static int diff_file_stats_full_to_buf(
|
|
50
50
|
git_buf *out,
|
|
51
51
|
const git_diff_delta *delta,
|
|
52
52
|
const diff_file_stats *filestat,
|
|
53
53
|
const git_diff_stats *stats,
|
|
54
54
|
size_t width)
|
|
55
55
|
{
|
|
56
|
-
const char *old_path = NULL, *new_path = NULL;
|
|
56
|
+
const char *old_path = NULL, *new_path = NULL, *adddel_path = NULL;
|
|
57
57
|
size_t padding;
|
|
58
58
|
git_object_size_t old_size, new_size;
|
|
59
59
|
|
|
@@ -62,7 +62,7 @@ int git_diff_file_stats__full_to_buf(
|
|
|
62
62
|
old_size = delta->old_file.size;
|
|
63
63
|
new_size = delta->new_file.size;
|
|
64
64
|
|
|
65
|
-
if (strcmp(old_path, new_path) != 0) {
|
|
65
|
+
if (old_path && new_path && strcmp(old_path, new_path) != 0) {
|
|
66
66
|
size_t common_dirlen;
|
|
67
67
|
int error;
|
|
68
68
|
|
|
@@ -82,10 +82,11 @@ int git_diff_file_stats__full_to_buf(
|
|
|
82
82
|
if (error < 0)
|
|
83
83
|
goto on_error;
|
|
84
84
|
} else {
|
|
85
|
-
|
|
85
|
+
adddel_path = new_path ? new_path : old_path;
|
|
86
|
+
if (git_buf_printf(out, " %s", adddel_path) < 0)
|
|
86
87
|
goto on_error;
|
|
87
88
|
|
|
88
|
-
padding = stats->max_name - strlen(
|
|
89
|
+
padding = stats->max_name - strlen(adddel_path);
|
|
89
90
|
|
|
90
91
|
if (stats->renames > 0)
|
|
91
92
|
padding += strlen(DIFF_RENAME_FILE_SEPARATOR);
|
|
@@ -134,7 +135,7 @@ on_error:
|
|
|
134
135
|
return (git_buf_oom(out) ? -1 : 0);
|
|
135
136
|
}
|
|
136
137
|
|
|
137
|
-
int
|
|
138
|
+
static int diff_file_stats_number_to_buf(
|
|
138
139
|
git_buf *out,
|
|
139
140
|
const git_diff_delta *delta,
|
|
140
141
|
const diff_file_stats *filestats)
|
|
@@ -151,7 +152,7 @@ int git_diff_file_stats__number_to_buf(
|
|
|
151
152
|
return error;
|
|
152
153
|
}
|
|
153
154
|
|
|
154
|
-
int
|
|
155
|
+
static int diff_file_stats_summary_to_buf(
|
|
155
156
|
git_buf *out,
|
|
156
157
|
const git_diff_delta *delta)
|
|
157
158
|
{
|
|
@@ -182,7 +183,8 @@ int git_diff_get_stats(
|
|
|
182
183
|
git_diff_stats *stats = NULL;
|
|
183
184
|
int error = 0;
|
|
184
185
|
|
|
185
|
-
|
|
186
|
+
GIT_ASSERT_ARG(out);
|
|
187
|
+
GIT_ASSERT_ARG(diff);
|
|
186
188
|
|
|
187
189
|
stats = git__calloc(1, sizeof(git_diff_stats));
|
|
188
190
|
GIT_ERROR_CHECK_ALLOC(stats);
|
|
@@ -211,7 +213,7 @@ int git_diff_get_stats(
|
|
|
211
213
|
|
|
212
214
|
/* TODO ugh */
|
|
213
215
|
namelen = strlen(delta->new_file.path);
|
|
214
|
-
if (strcmp(delta->old_file.path, delta->new_file.path) != 0) {
|
|
216
|
+
if (delta->old_file.path && strcmp(delta->old_file.path, delta->new_file.path) != 0) {
|
|
215
217
|
namelen += strlen(delta->old_file.path);
|
|
216
218
|
stats->renames++;
|
|
217
219
|
}
|
|
@@ -250,7 +252,7 @@ int git_diff_get_stats(
|
|
|
250
252
|
size_t git_diff_stats_files_changed(
|
|
251
253
|
const git_diff_stats *stats)
|
|
252
254
|
{
|
|
253
|
-
|
|
255
|
+
GIT_ASSERT_ARG(stats);
|
|
254
256
|
|
|
255
257
|
return stats->files_changed;
|
|
256
258
|
}
|
|
@@ -258,7 +260,7 @@ size_t git_diff_stats_files_changed(
|
|
|
258
260
|
size_t git_diff_stats_insertions(
|
|
259
261
|
const git_diff_stats *stats)
|
|
260
262
|
{
|
|
261
|
-
|
|
263
|
+
GIT_ASSERT_ARG(stats);
|
|
262
264
|
|
|
263
265
|
return stats->insertions;
|
|
264
266
|
}
|
|
@@ -266,7 +268,7 @@ size_t git_diff_stats_insertions(
|
|
|
266
268
|
size_t git_diff_stats_deletions(
|
|
267
269
|
const git_diff_stats *stats)
|
|
268
270
|
{
|
|
269
|
-
|
|
271
|
+
GIT_ASSERT_ARG(stats);
|
|
270
272
|
|
|
271
273
|
return stats->deletions;
|
|
272
274
|
}
|
|
@@ -281,14 +283,15 @@ int git_diff_stats_to_buf(
|
|
|
281
283
|
size_t i;
|
|
282
284
|
const git_diff_delta *delta;
|
|
283
285
|
|
|
284
|
-
|
|
286
|
+
GIT_ASSERT_ARG(out);
|
|
287
|
+
GIT_ASSERT_ARG(stats);
|
|
285
288
|
|
|
286
289
|
if (format & GIT_DIFF_STATS_NUMBER) {
|
|
287
290
|
for (i = 0; i < stats->files_changed; ++i) {
|
|
288
291
|
if ((delta = git_diff_get_delta(stats->diff, i)) == NULL)
|
|
289
292
|
continue;
|
|
290
293
|
|
|
291
|
-
error =
|
|
294
|
+
error = diff_file_stats_number_to_buf(
|
|
292
295
|
out, delta, &stats->filestats[i]);
|
|
293
296
|
if (error < 0)
|
|
294
297
|
return error;
|
|
@@ -309,7 +312,7 @@ int git_diff_stats_to_buf(
|
|
|
309
312
|
if ((delta = git_diff_get_delta(stats->diff, i)) == NULL)
|
|
310
313
|
continue;
|
|
311
314
|
|
|
312
|
-
error =
|
|
315
|
+
error = diff_file_stats_full_to_buf(
|
|
313
316
|
out, delta, &stats->filestats[i], stats, width);
|
|
314
317
|
if (error < 0)
|
|
315
318
|
return error;
|
|
@@ -342,7 +345,7 @@ int git_diff_stats_to_buf(
|
|
|
342
345
|
if ((delta = git_diff_get_delta(stats->diff, i)) == NULL)
|
|
343
346
|
continue;
|
|
344
347
|
|
|
345
|
-
error =
|
|
348
|
+
error = diff_file_stats_summary_to_buf(out, delta);
|
|
346
349
|
if (error < 0)
|
|
347
350
|
return error;
|
|
348
351
|
}
|
|
@@ -87,7 +87,7 @@ git_diff_delta *git_diff__merge_like_cgit(
|
|
|
87
87
|
a->status == GIT_DELTA_UNREADABLE)
|
|
88
88
|
return dup;
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
GIT_ASSERT_WITH_RETVAL(b->status != GIT_DELTA_UNMODIFIED, NULL);
|
|
91
91
|
|
|
92
92
|
/* A cgit exception is that the diff of a file that is only in the
|
|
93
93
|
* index (i.e. not in HEAD nor workdir) is given as empty.
|
|
@@ -121,7 +121,8 @@ int git_diff__merge(
|
|
|
121
121
|
bool ignore_case, reversed;
|
|
122
122
|
unsigned int i, j;
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
GIT_ASSERT_ARG(onto);
|
|
125
|
+
GIT_ASSERT_ARG(from);
|
|
125
126
|
|
|
126
127
|
if (!from->deltas.length)
|
|
127
128
|
return 0;
|
|
@@ -136,11 +137,10 @@ int git_diff__merge(
|
|
|
136
137
|
return -1;
|
|
137
138
|
}
|
|
138
139
|
|
|
139
|
-
if (git_vector_init(&onto_new, onto->deltas.length, git_diff_delta__cmp) < 0
|
|
140
|
+
if (git_vector_init(&onto_new, onto->deltas.length, git_diff_delta__cmp) < 0 ||
|
|
141
|
+
git_pool_init(&onto_pool, 1) < 0)
|
|
140
142
|
return -1;
|
|
141
143
|
|
|
142
|
-
git_pool_init(&onto_pool, 1);
|
|
143
|
-
|
|
144
144
|
for (i = 0, j = 0; i < onto->deltas.length || j < from->deltas.length; ) {
|
|
145
145
|
git_diff_delta *o = GIT_VECTOR_GET(&onto->deltas, i);
|
|
146
146
|
const git_diff_delta *f = GIT_VECTOR_GET(&from->deltas, j);
|
|
@@ -476,8 +476,8 @@ static int similarity_sig(
|
|
|
476
476
|
git_diff_file *file = info->file;
|
|
477
477
|
|
|
478
478
|
if (info->src == GIT_ITERATOR_WORKDIR) {
|
|
479
|
-
if ((error =
|
|
480
|
-
&info->data,
|
|
479
|
+
if ((error = git_repository_workdir_path(
|
|
480
|
+
&info->data, info->repo, file->path)) < 0)
|
|
481
481
|
return error;
|
|
482
482
|
|
|
483
483
|
/* if path is not a regular file, just skip this item */
|
|
@@ -816,7 +816,7 @@ int git_diff_find_similar(
|
|
|
816
816
|
diff_find_match *best_match;
|
|
817
817
|
git_diff_file swap;
|
|
818
818
|
|
|
819
|
-
|
|
819
|
+
GIT_ASSERT_ARG(diff);
|
|
820
820
|
|
|
821
821
|
if ((error = normalize_find_opts(diff, &opts, given_opts)) < 0)
|
|
822
822
|
return error;
|
|
@@ -979,7 +979,7 @@ find_best_matches:
|
|
|
979
979
|
src->flags |= GIT_DIFF_FLAG__TO_DELETE;
|
|
980
980
|
num_rewrites++;
|
|
981
981
|
} else {
|
|
982
|
-
|
|
982
|
+
GIT_ASSERT(delta_is_split(tgt));
|
|
983
983
|
|
|
984
984
|
if (best_match->similarity < opts.rename_from_rewrite_threshold)
|
|
985
985
|
continue;
|
|
@@ -989,7 +989,7 @@ find_best_matches:
|
|
|
989
989
|
delta_make_rename(tgt, src, best_match->similarity);
|
|
990
990
|
num_rewrites--;
|
|
991
991
|
|
|
992
|
-
|
|
992
|
+
GIT_ASSERT(src->status == GIT_DELTA_DELETED);
|
|
993
993
|
memcpy(&src->old_file, &swap, sizeof(src->old_file));
|
|
994
994
|
memset(&src->new_file, 0, sizeof(src->new_file));
|
|
995
995
|
src->new_file.path = src->old_file.path;
|
|
@@ -1025,7 +1025,7 @@ find_best_matches:
|
|
|
1025
1025
|
|
|
1026
1026
|
num_updates++;
|
|
1027
1027
|
} else {
|
|
1028
|
-
|
|
1028
|
+
GIT_ASSERT(delta_is_split(src));
|
|
1029
1029
|
|
|
1030
1030
|
if (best_match->similarity < opts.rename_from_rewrite_threshold)
|
|
1031
1031
|
continue;
|
|
@@ -1039,7 +1039,7 @@ find_best_matches:
|
|
|
1039
1039
|
memcpy(&src->old_file, &swap, sizeof(src->old_file));
|
|
1040
1040
|
|
|
1041
1041
|
/* if we've just swapped the new element into the correct
|
|
1042
|
-
* place, clear the SPLIT
|
|
1042
|
+
* place, clear the SPLIT and RENAME_TARGET flags
|
|
1043
1043
|
*/
|
|
1044
1044
|
if (tgt2src[s].idx == t &&
|
|
1045
1045
|
tgt2src[s].similarity >
|
|
@@ -1047,7 +1047,7 @@ find_best_matches:
|
|
|
1047
1047
|
src->status = GIT_DELTA_RENAMED;
|
|
1048
1048
|
src->similarity = tgt2src[s].similarity;
|
|
1049
1049
|
tgt2src[s].similarity = 0;
|
|
1050
|
-
src->flags &= ~GIT_DIFF_FLAG__TO_SPLIT;
|
|
1050
|
+
src->flags &= ~(GIT_DIFF_FLAG__TO_SPLIT | GIT_DIFF_FLAG__IS_RENAME_TARGET);
|
|
1051
1051
|
num_rewrites--;
|
|
1052
1052
|
}
|
|
1053
1053
|
/* otherwise, if we just overwrote a source, update mapping */
|