rugged 1.0.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -0
- data/README.md +1 -1
- data/ext/rugged/rugged.c +7 -4
- data/ext/rugged/rugged_commit.c +1 -1
- data/ext/rugged/rugged_object.c +1 -1
- data/ext/rugged/rugged_repo.c +3 -3
- data/lib/rugged/commit.rb +16 -2
- data/lib/rugged/repository.rb +2 -2
- 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/FindLibSSH2.cmake +13 -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 +95 -0
- data/vendor/libgit2/include/git2/blame.h +95 -42
- data/vendor/libgit2/include/git2/blob.h +37 -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/clone.h +1 -1
- data/vendor/libgit2/include/git2/commit.h +35 -19
- data/vendor/libgit2/include/git2/common.h +51 -6
- data/vendor/libgit2/include/git2/config.h +1 -1
- data/vendor/libgit2/include/git2/deprecated.h +368 -8
- data/vendor/libgit2/include/git2/diff.h +34 -113
- data/vendor/libgit2/include/git2/email.h +127 -0
- data/vendor/libgit2/include/git2/errors.h +8 -7
- data/vendor/libgit2/include/git2/filter.h +63 -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/notes.h +2 -2
- data/vendor/libgit2/include/git2/odb.h +44 -20
- data/vendor/libgit2/include/git2/oidarray.h +5 -8
- 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 +62 -9
- data/vendor/libgit2/include/git2/repository.h +107 -62
- data/vendor/libgit2/include/git2/revparse.h +5 -5
- data/vendor/libgit2/include/git2/stash.h +1 -1
- data/vendor/libgit2/include/git2/status.h +115 -59
- data/vendor/libgit2/include/git2/stdint.h +3 -3
- 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/email.h +45 -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 +4 -4
- data/vendor/libgit2/include/git2/worktree.h +1 -0
- data/vendor/libgit2/include/git2.h +1 -0
- data/vendor/libgit2/src/CMakeLists.txt +84 -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 +192 -70
- data/vendor/libgit2/src/attr_file.c +99 -41
- 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 +32 -19
- data/vendor/libgit2/src/blame_git.c +7 -4
- data/vendor/libgit2/src/blob.c +60 -32
- data/vendor/libgit2/src/branch.c +87 -37
- data/vendor/libgit2/src/buffer.c +349 -29
- data/vendor/libgit2/src/buffer.h +154 -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 -8
- data/vendor/libgit2/src/checkout.c +103 -105
- data/vendor/libgit2/src/cherrypick.c +8 -2
- data/vendor/libgit2/src/clone.c +105 -30
- 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 +41 -23
- 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 +17 -9
- data/vendor/libgit2/src/config_parse.c +6 -8
- 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 +12 -5
- data/vendor/libgit2/src/diff.c +55 -183
- 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/email.c +299 -0
- data/vendor/libgit2/src/email.h +25 -0
- 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 +215 -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 +8 -10
- 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 +33 -17
- data/vendor/libgit2/src/index.c +124 -82
- data/vendor/libgit2/src/index.h +1 -1
- data/vendor/libgit2/src/indexer.c +95 -37
- 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} +148 -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 +95 -43
- 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 +40 -40
- 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/oidarray.c +10 -1
- 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 +103 -58
- data/vendor/libgit2/src/path.h +80 -7
- 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 +145 -153
- data/vendor/libgit2/src/reflog.c +21 -20
- data/vendor/libgit2/src/refs.c +153 -233
- data/vendor/libgit2/src/refs.h +2 -20
- data/vendor/libgit2/src/refspec.c +81 -45
- data/vendor/libgit2/src/regexp.c +2 -2
- data/vendor/libgit2/src/remote.c +320 -122
- data/vendor/libgit2/src/remote.h +2 -1
- data/vendor/libgit2/src/repository.c +476 -203
- data/vendor/libgit2/src/repository.h +27 -29
- data/vendor/libgit2/src/reset.c +8 -7
- data/vendor/libgit2/src/revert.c +8 -2
- data/vendor/libgit2/src/revparse.c +23 -17
- 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 +6 -2
- 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 +84 -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/trailer.c +1 -1
- 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 +68 -38
- 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 +55 -21
- data/vendor/libgit2/src/transports/winhttp.c +157 -89
- 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 +75 -184
- data/vendor/libgit2/src/util.h +34 -40
- data/vendor/libgit2/src/vector.c +23 -19
- data/vendor/libgit2/src/vector.h +4 -2
- data/vendor/libgit2/src/win32/findfile.c +5 -3
- 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.h +6 -6
- data/vendor/libgit2/src/win32/posix_w32.c +86 -7
- 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 +36 -14
- data/vendor/libgit2/src/zstream.c +1 -1
- metadata +65 -42
- 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
data/vendor/libgit2/src/merge.c
CHANGED
@@ -80,7 +80,7 @@ static int cache_invalid_marker;
|
|
80
80
|
|
81
81
|
/* Merge base computation */
|
82
82
|
|
83
|
-
int merge_bases_many(git_commit_list **out, git_revwalk **walk_out, git_repository *repo, size_t length, const git_oid input_array[])
|
83
|
+
static int merge_bases_many(git_commit_list **out, git_revwalk **walk_out, git_repository *repo, size_t length, const git_oid input_array[])
|
84
84
|
{
|
85
85
|
git_revwalk *walk = NULL;
|
86
86
|
git_vector list;
|
@@ -112,7 +112,7 @@ int merge_bases_many(git_commit_list **out, git_revwalk **walk_out, git_reposito
|
|
112
112
|
if (commit == NULL)
|
113
113
|
goto on_error;
|
114
114
|
|
115
|
-
if (git_merge__bases_many(&result, walk, commit, &list) < 0)
|
115
|
+
if (git_merge__bases_many(&result, walk, commit, &list, 0) < 0)
|
116
116
|
goto on_error;
|
117
117
|
|
118
118
|
if (!result) {
|
@@ -139,7 +139,9 @@ int git_merge_base_many(git_oid *out, git_repository *repo, size_t length, const
|
|
139
139
|
git_commit_list *result = NULL;
|
140
140
|
int error = 0;
|
141
141
|
|
142
|
-
|
142
|
+
GIT_ASSERT_ARG(out);
|
143
|
+
GIT_ASSERT_ARG(repo);
|
144
|
+
GIT_ASSERT_ARG(input_array);
|
143
145
|
|
144
146
|
if ((error = merge_bases_many(&result, &walk, repo, length, input_array)) < 0)
|
145
147
|
return error;
|
@@ -159,7 +161,9 @@ int git_merge_bases_many(git_oidarray *out, git_repository *repo, size_t length,
|
|
159
161
|
int error = 0;
|
160
162
|
git_array_oid_t array;
|
161
163
|
|
162
|
-
|
164
|
+
GIT_ASSERT_ARG(out);
|
165
|
+
GIT_ASSERT_ARG(repo);
|
166
|
+
GIT_ASSERT_ARG(input_array);
|
163
167
|
|
164
168
|
if ((error = merge_bases_many(&result, &walk, repo, length, input_array)) < 0)
|
165
169
|
return error;
|
@@ -193,7 +197,9 @@ int git_merge_base_octopus(git_oid *out, git_repository *repo, size_t length, co
|
|
193
197
|
unsigned int i;
|
194
198
|
int error = -1;
|
195
199
|
|
196
|
-
|
200
|
+
GIT_ASSERT_ARG(out);
|
201
|
+
GIT_ASSERT_ARG(repo);
|
202
|
+
GIT_ASSERT_ARG(input_array);
|
197
203
|
|
198
204
|
if (length < 2) {
|
199
205
|
git_error_set(GIT_ERROR_INVALID, "at least two commits are required to find an ancestor");
|
@@ -237,7 +243,7 @@ static int merge_bases(git_commit_list **out, git_revwalk **walk_out, git_reposi
|
|
237
243
|
if (commit == NULL)
|
238
244
|
goto on_error;
|
239
245
|
|
240
|
-
if (git_merge__bases_many(&result, walk, commit, &list) < 0)
|
246
|
+
if (git_merge__bases_many(&result, walk, commit, &list, 0) < 0)
|
241
247
|
goto on_error;
|
242
248
|
|
243
249
|
if (!result) {
|
@@ -372,7 +378,11 @@ static int clear_commit_marks(git_commit_list_node *commit, unsigned int mark)
|
|
372
378
|
}
|
373
379
|
|
374
380
|
static int paint_down_to_common(
|
375
|
-
|
381
|
+
git_commit_list **out,
|
382
|
+
git_revwalk *walk,
|
383
|
+
git_commit_list_node *one,
|
384
|
+
git_vector *twos,
|
385
|
+
uint32_t minimum_generation)
|
376
386
|
{
|
377
387
|
git_pqueue list;
|
378
388
|
git_commit_list *result = NULL;
|
@@ -381,7 +391,7 @@ static int paint_down_to_common(
|
|
381
391
|
int error;
|
382
392
|
unsigned int i;
|
383
393
|
|
384
|
-
if (git_pqueue_init(&list, 0, twos->length * 2,
|
394
|
+
if (git_pqueue_init(&list, 0, twos->length * 2, git_commit_list_generation_cmp) < 0)
|
385
395
|
return -1;
|
386
396
|
|
387
397
|
one->flags |= PARENT1;
|
@@ -393,7 +403,6 @@ static int paint_down_to_common(
|
|
393
403
|
return -1;
|
394
404
|
|
395
405
|
two->flags |= PARENT2;
|
396
|
-
|
397
406
|
if (git_pqueue_insert(&list, two) < 0)
|
398
407
|
return -1;
|
399
408
|
}
|
@@ -421,6 +430,8 @@ static int paint_down_to_common(
|
|
421
430
|
git_commit_list_node *p = commit->parents[i];
|
422
431
|
if ((p->flags & flags) == flags)
|
423
432
|
continue;
|
433
|
+
if (p->generation < minimum_generation)
|
434
|
+
continue;
|
424
435
|
|
425
436
|
if ((error = git_commit_list_parse(walk, p)) < 0)
|
426
437
|
return error;
|
@@ -436,7 +447,7 @@ static int paint_down_to_common(
|
|
436
447
|
return 0;
|
437
448
|
}
|
438
449
|
|
439
|
-
static int remove_redundant(git_revwalk *walk, git_vector *commits)
|
450
|
+
static int remove_redundant(git_revwalk *walk, git_vector *commits, uint32_t minimum_generation)
|
440
451
|
{
|
441
452
|
git_vector work = GIT_VECTOR_INIT;
|
442
453
|
unsigned char *redundant;
|
@@ -472,7 +483,7 @@ static int remove_redundant(git_revwalk *walk, git_vector *commits)
|
|
472
483
|
goto done;
|
473
484
|
}
|
474
485
|
|
475
|
-
error = paint_down_to_common(&common, walk, commit, &work);
|
486
|
+
error = paint_down_to_common(&common, walk, commit, &work, minimum_generation);
|
476
487
|
if (error < 0)
|
477
488
|
goto done;
|
478
489
|
|
@@ -504,7 +515,12 @@ done:
|
|
504
515
|
return error;
|
505
516
|
}
|
506
517
|
|
507
|
-
int git_merge__bases_many(
|
518
|
+
int git_merge__bases_many(
|
519
|
+
git_commit_list **out,
|
520
|
+
git_revwalk *walk,
|
521
|
+
git_commit_list_node *one,
|
522
|
+
git_vector *twos,
|
523
|
+
uint32_t minimum_generation)
|
508
524
|
{
|
509
525
|
int error;
|
510
526
|
unsigned int i;
|
@@ -526,7 +542,7 @@ int git_merge__bases_many(git_commit_list **out, git_revwalk *walk, git_commit_l
|
|
526
542
|
if (git_commit_list_parse(walk, one) < 0)
|
527
543
|
return -1;
|
528
544
|
|
529
|
-
error = paint_down_to_common(&result, walk, one, twos);
|
545
|
+
error = paint_down_to_common(&result, walk, one, twos, minimum_generation);
|
530
546
|
if (error < 0)
|
531
547
|
return error;
|
532
548
|
|
@@ -553,7 +569,7 @@ int git_merge__bases_many(git_commit_list **out, git_revwalk *walk, git_commit_l
|
|
553
569
|
|
554
570
|
if ((error = clear_commit_marks(one, ALL_FLAGS)) < 0 ||
|
555
571
|
(error = clear_commit_marks_many(twos, ALL_FLAGS)) < 0 ||
|
556
|
-
(error = remove_redundant(walk, &redundant)) < 0) {
|
572
|
+
(error = remove_redundant(walk, &redundant, minimum_generation)) < 0) {
|
557
573
|
git_vector_free(&redundant);
|
558
574
|
return error;
|
559
575
|
}
|
@@ -581,7 +597,8 @@ int git_repository_mergehead_foreach(
|
|
581
597
|
git_oid oid;
|
582
598
|
int error = 0;
|
583
599
|
|
584
|
-
|
600
|
+
GIT_ASSERT_ARG(repo);
|
601
|
+
GIT_ASSERT_ARG(cb);
|
585
602
|
|
586
603
|
if ((error = git_buf_joinpath(&merge_head_path, repo->gitdir,
|
587
604
|
GIT_MERGE_HEAD_FILE)) < 0)
|
@@ -650,7 +667,9 @@ static int merge_conflict_resolve_trivial(
|
|
650
667
|
git_index_entry const *result = NULL;
|
651
668
|
int error = 0;
|
652
669
|
|
653
|
-
|
670
|
+
GIT_ASSERT_ARG(resolved);
|
671
|
+
GIT_ASSERT_ARG(diff_list);
|
672
|
+
GIT_ASSERT_ARG(conflict);
|
654
673
|
|
655
674
|
*resolved = 0;
|
656
675
|
|
@@ -733,7 +752,9 @@ static int merge_conflict_resolve_one_removed(
|
|
733
752
|
int ours_changed, theirs_changed;
|
734
753
|
int error = 0;
|
735
754
|
|
736
|
-
|
755
|
+
GIT_ASSERT_ARG(resolved);
|
756
|
+
GIT_ASSERT_ARG(diff_list);
|
757
|
+
GIT_ASSERT_ARG(conflict);
|
737
758
|
|
738
759
|
*resolved = 0;
|
739
760
|
|
@@ -773,7 +794,9 @@ static int merge_conflict_resolve_one_renamed(
|
|
773
794
|
git_index_entry *merged;
|
774
795
|
int error = 0;
|
775
796
|
|
776
|
-
|
797
|
+
GIT_ASSERT_ARG(resolved);
|
798
|
+
GIT_ASSERT_ARG(diff_list);
|
799
|
+
GIT_ASSERT_ARG(conflict);
|
777
800
|
|
778
801
|
*resolved = 0;
|
779
802
|
|
@@ -793,8 +816,11 @@ static int merge_conflict_resolve_one_renamed(
|
|
793
816
|
conflict->type == GIT_MERGE_DIFF_RENAMED_ADDED)
|
794
817
|
return 0;
|
795
818
|
|
796
|
-
ours_changed = (git_oid__cmp(&conflict->ancestor_entry.id, &conflict->our_entry.id) != 0)
|
797
|
-
|
819
|
+
ours_changed = (git_oid__cmp(&conflict->ancestor_entry.id, &conflict->our_entry.id) != 0) ||
|
820
|
+
(conflict->ancestor_entry.mode != conflict->our_entry.mode);
|
821
|
+
|
822
|
+
theirs_changed = (git_oid__cmp(&conflict->ancestor_entry.id, &conflict->their_entry.id) != 0) ||
|
823
|
+
(conflict->ancestor_entry.mode != conflict->their_entry.mode);
|
798
824
|
|
799
825
|
/* if both are modified (and not to a common target) require a merge */
|
800
826
|
if (ours_changed && theirs_changed &&
|
@@ -917,7 +943,9 @@ static int merge_conflict_resolve_contents(
|
|
917
943
|
bool fallback = false;
|
918
944
|
int error;
|
919
945
|
|
920
|
-
|
946
|
+
GIT_ASSERT_ARG(resolved);
|
947
|
+
GIT_ASSERT_ARG(diff_list);
|
948
|
+
GIT_ASSERT_ARG(conflict);
|
921
949
|
|
922
950
|
*resolved = 0;
|
923
951
|
|
@@ -1126,7 +1154,7 @@ static void deletes_by_oid_free(git_oidmap *map) {
|
|
1126
1154
|
git_oidmap_free(map);
|
1127
1155
|
}
|
1128
1156
|
|
1129
|
-
static int deletes_by_oid_enqueue(git_oidmap *map, git_pool*
|
1157
|
+
static int deletes_by_oid_enqueue(git_oidmap *map, git_pool *pool, const git_oid *id, size_t idx)
|
1130
1158
|
{
|
1131
1159
|
deletes_by_oid_queue *queue;
|
1132
1160
|
size_t *array_entry;
|
@@ -1517,9 +1545,11 @@ int git_merge_diff_list__find_renames(
|
|
1517
1545
|
size_t src_count, tgt_count, i;
|
1518
1546
|
int error = 0;
|
1519
1547
|
|
1520
|
-
|
1548
|
+
GIT_ASSERT_ARG(diff_list);
|
1549
|
+
GIT_ASSERT_ARG(opts);
|
1521
1550
|
|
1522
|
-
if ((opts->flags & GIT_MERGE_FIND_RENAMES) == 0
|
1551
|
+
if ((opts->flags & GIT_MERGE_FIND_RENAMES) == 0 ||
|
1552
|
+
!diff_list->conflicts.length)
|
1523
1553
|
return 0;
|
1524
1554
|
|
1525
1555
|
similarity_ours = git__calloc(diff_list->conflicts.length,
|
@@ -1810,12 +1840,12 @@ git_merge_diff_list *git_merge_diff_list__alloc(git_repository *repo)
|
|
1810
1840
|
|
1811
1841
|
diff_list->repo = repo;
|
1812
1842
|
|
1813
|
-
git_pool_init(&diff_list->pool, 1);
|
1814
1843
|
|
1815
|
-
if (
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1844
|
+
if (git_pool_init(&diff_list->pool, 1) < 0 ||
|
1845
|
+
git_vector_init(&diff_list->staged, 0, NULL) < 0 ||
|
1846
|
+
git_vector_init(&diff_list->conflicts, 0, NULL) < 0 ||
|
1847
|
+
git_vector_init(&diff_list->resolved, 0, NULL) < 0) {
|
1848
|
+
git_merge_diff_list__free(diff_list);
|
1819
1849
|
return NULL;
|
1820
1850
|
}
|
1821
1851
|
|
@@ -1843,7 +1873,8 @@ static int merge_normalize_opts(
|
|
1843
1873
|
git_config_entry *entry = NULL;
|
1844
1874
|
int error = 0;
|
1845
1875
|
|
1846
|
-
|
1876
|
+
GIT_ASSERT_ARG(repo);
|
1877
|
+
GIT_ASSERT_ARG(opts);
|
1847
1878
|
|
1848
1879
|
if ((error = git_repository_config__weakptr(&cfg, repo)) < 0)
|
1849
1880
|
return error;
|
@@ -2070,7 +2101,8 @@ int git_merge__iterators(
|
|
2070
2101
|
size_t i;
|
2071
2102
|
int error = 0;
|
2072
2103
|
|
2073
|
-
|
2104
|
+
GIT_ASSERT_ARG(out);
|
2105
|
+
GIT_ASSERT_ARG(repo);
|
2074
2106
|
|
2075
2107
|
*out = NULL;
|
2076
2108
|
|
@@ -2154,7 +2186,8 @@ int git_merge_trees(
|
|
2154
2186
|
git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT;
|
2155
2187
|
int error;
|
2156
2188
|
|
2157
|
-
|
2189
|
+
GIT_ASSERT_ARG(out);
|
2190
|
+
GIT_ASSERT_ARG(repo);
|
2158
2191
|
|
2159
2192
|
/* if one side is treesame to the ancestor, take the other side */
|
2160
2193
|
if (ancestor_tree && merge_opts && (merge_opts->flags & GIT_MERGE_SKIP_REUC)) {
|
@@ -2258,8 +2291,11 @@ static int create_virtual_base(
|
|
2258
2291
|
result->type = GIT_ANNOTATED_COMMIT_VIRTUAL;
|
2259
2292
|
result->index = index;
|
2260
2293
|
|
2261
|
-
insert_head_ids(&result->parents, one)
|
2262
|
-
|
2294
|
+
if (insert_head_ids(&result->parents, one) < 0 ||
|
2295
|
+
insert_head_ids(&result->parents, two) < 0) {
|
2296
|
+
git_annotated_commit_free(result);
|
2297
|
+
return -1;
|
2298
|
+
}
|
2263
2299
|
|
2264
2300
|
*out = result;
|
2265
2301
|
return 0;
|
@@ -2333,7 +2369,7 @@ done:
|
|
2333
2369
|
|
2334
2370
|
git_annotated_commit_free(other);
|
2335
2371
|
git_annotated_commit_free(new_base);
|
2336
|
-
|
2372
|
+
git_oidarray_dispose(&bases);
|
2337
2373
|
git_array_clear(head_ids);
|
2338
2374
|
return error;
|
2339
2375
|
}
|
@@ -2441,7 +2477,8 @@ static int write_merge_head(
|
|
2441
2477
|
size_t i;
|
2442
2478
|
int error = 0;
|
2443
2479
|
|
2444
|
-
|
2480
|
+
GIT_ASSERT_ARG(repo);
|
2481
|
+
GIT_ASSERT_ARG(heads);
|
2445
2482
|
|
2446
2483
|
if ((error = git_buf_joinpath(&file_path, repo->gitdir, GIT_MERGE_HEAD_FILE)) < 0 ||
|
2447
2484
|
(error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_CREATE_LEADING_DIRS, GIT_MERGE_FILE_MODE)) < 0)
|
@@ -2469,7 +2506,7 @@ static int write_merge_mode(git_repository *repo)
|
|
2469
2506
|
git_buf file_path = GIT_BUF_INIT;
|
2470
2507
|
int error = 0;
|
2471
2508
|
|
2472
|
-
|
2509
|
+
GIT_ASSERT_ARG(repo);
|
2473
2510
|
|
2474
2511
|
if ((error = git_buf_joinpath(&file_path, repo->gitdir, GIT_MERGE_MODE_FILE)) < 0 ||
|
2475
2512
|
(error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_CREATE_LEADING_DIRS, GIT_MERGE_FILE_MODE)) < 0)
|
@@ -2689,7 +2726,8 @@ static int write_merge_msg(
|
|
2689
2726
|
char sep = 0;
|
2690
2727
|
int error = 0;
|
2691
2728
|
|
2692
|
-
|
2729
|
+
GIT_ASSERT_ARG(repo);
|
2730
|
+
GIT_ASSERT_ARG(heads);
|
2693
2731
|
|
2694
2732
|
entries = git__calloc(heads_len, sizeof(struct merge_msg_entry));
|
2695
2733
|
GIT_ERROR_CHECK_ALLOC(entries);
|
@@ -2800,7 +2838,9 @@ int git_merge__setup(
|
|
2800
2838
|
{
|
2801
2839
|
int error = 0;
|
2802
2840
|
|
2803
|
-
|
2841
|
+
GIT_ASSERT_ARG(repo);
|
2842
|
+
GIT_ASSERT_ARG(our_head);
|
2843
|
+
GIT_ASSERT_ARG(heads);
|
2804
2844
|
|
2805
2845
|
if ((error = git_repository__set_orig_head(repo, git_annotated_commit_id(our_head))) == 0 &&
|
2806
2846
|
(error = write_merge_head(repo, heads, heads_len)) == 0 &&
|
@@ -2824,7 +2864,9 @@ static int merge_ancestor_head(
|
|
2824
2864
|
size_t i, alloc_len;
|
2825
2865
|
int error = 0;
|
2826
2866
|
|
2827
|
-
|
2867
|
+
GIT_ASSERT_ARG(repo);
|
2868
|
+
GIT_ASSERT_ARG(our_head);
|
2869
|
+
GIT_ASSERT_ARG(their_heads);
|
2828
2870
|
|
2829
2871
|
GIT_ERROR_CHECK_ALLOC_ADD(&alloc_len, their_heads_len, 1);
|
2830
2872
|
oids = git__calloc(alloc_len, sizeof(git_oid));
|
@@ -2845,7 +2887,7 @@ on_error:
|
|
2845
2887
|
return error;
|
2846
2888
|
}
|
2847
2889
|
|
2848
|
-
const char *merge_their_label(const char *branchname)
|
2890
|
+
static const char *merge_their_label(const char *branchname)
|
2849
2891
|
{
|
2850
2892
|
const char *slash;
|
2851
2893
|
|
@@ -3202,7 +3244,10 @@ int git_merge_analysis_for_ref(
|
|
3202
3244
|
int error = 0;
|
3203
3245
|
bool unborn;
|
3204
3246
|
|
3205
|
-
|
3247
|
+
GIT_ASSERT_ARG(analysis_out);
|
3248
|
+
GIT_ASSERT_ARG(preference_out);
|
3249
|
+
GIT_ASSERT_ARG(repo);
|
3250
|
+
GIT_ASSERT_ARG(their_heads && their_heads_len > 0);
|
3206
3251
|
|
3207
3252
|
if (their_heads_len != 1) {
|
3208
3253
|
git_error_set(GIT_ERROR_MERGE, "can only merge a single branch");
|
@@ -3284,7 +3329,8 @@ int git_merge(
|
|
3284
3329
|
unsigned int checkout_strategy;
|
3285
3330
|
int error = 0;
|
3286
3331
|
|
3287
|
-
|
3332
|
+
GIT_ASSERT_ARG(repo);
|
3333
|
+
GIT_ASSERT_ARG(their_heads && their_heads_len > 0);
|
3288
3334
|
|
3289
3335
|
if (their_heads_len != 1) {
|
3290
3336
|
git_error_set(GIT_ERROR_MERGE, "can only merge a single branch");
|
@@ -3351,10 +3397,12 @@ int git_merge_options_init(git_merge_options *opts, unsigned int version)
|
|
3351
3397
|
return 0;
|
3352
3398
|
}
|
3353
3399
|
|
3400
|
+
#ifndef GIT_DEPRECATE_HARD
|
3354
3401
|
int git_merge_init_options(git_merge_options *opts, unsigned int version)
|
3355
3402
|
{
|
3356
3403
|
return git_merge_options_init(opts, version);
|
3357
3404
|
}
|
3405
|
+
#endif
|
3358
3406
|
|
3359
3407
|
int git_merge_file_input_init(git_merge_file_input *input, unsigned int version)
|
3360
3408
|
{
|
@@ -3363,10 +3411,12 @@ int git_merge_file_input_init(git_merge_file_input *input, unsigned int version)
|
|
3363
3411
|
return 0;
|
3364
3412
|
}
|
3365
3413
|
|
3414
|
+
#ifndef GIT_DEPRECATE_HARD
|
3366
3415
|
int git_merge_file_init_input(git_merge_file_input *input, unsigned int version)
|
3367
3416
|
{
|
3368
3417
|
return git_merge_file_input_init(input, version);
|
3369
3418
|
}
|
3419
|
+
#endif
|
3370
3420
|
|
3371
3421
|
int git_merge_file_options_init(
|
3372
3422
|
git_merge_file_options *opts, unsigned int version)
|
@@ -3376,8 +3426,10 @@ int git_merge_file_options_init(
|
|
3376
3426
|
return 0;
|
3377
3427
|
}
|
3378
3428
|
|
3429
|
+
#ifndef GIT_DEPRECATE_HARD
|
3379
3430
|
int git_merge_file_init_options(
|
3380
3431
|
git_merge_file_options *opts, unsigned int version)
|
3381
3432
|
{
|
3382
3433
|
return git_merge_file_options_init(opts, version);
|
3383
3434
|
}
|
3435
|
+
#endif
|
data/vendor/libgit2/src/merge.h
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
#include "merge_driver.h"
|
9
9
|
|
10
10
|
#include "vector.h"
|
11
|
-
#include "
|
11
|
+
#include "runtime.h"
|
12
12
|
#include "merge.h"
|
13
13
|
#include "git2/merge.h"
|
14
14
|
#include "git2/sys/merge.h"
|
@@ -32,33 +32,38 @@ static struct merge_driver_registry merge_driver_registry;
|
|
32
32
|
|
33
33
|
static void git_merge_driver_global_shutdown(void);
|
34
34
|
|
35
|
-
git_repository*
|
35
|
+
git_repository *git_merge_driver_source_repo(
|
36
|
+
const git_merge_driver_source *src)
|
36
37
|
{
|
37
|
-
|
38
|
+
GIT_ASSERT_ARG_WITH_RETVAL(src, NULL);
|
38
39
|
return src->repo;
|
39
40
|
}
|
40
41
|
|
41
|
-
const git_index_entry*
|
42
|
+
const git_index_entry *git_merge_driver_source_ancestor(
|
43
|
+
const git_merge_driver_source *src)
|
42
44
|
{
|
43
|
-
|
45
|
+
GIT_ASSERT_ARG_WITH_RETVAL(src, NULL);
|
44
46
|
return src->ancestor;
|
45
47
|
}
|
46
48
|
|
47
|
-
const git_index_entry*
|
49
|
+
const git_index_entry *git_merge_driver_source_ours(
|
50
|
+
const git_merge_driver_source *src)
|
48
51
|
{
|
49
|
-
|
52
|
+
GIT_ASSERT_ARG_WITH_RETVAL(src, NULL);
|
50
53
|
return src->ours;
|
51
54
|
}
|
52
55
|
|
53
|
-
const git_index_entry*
|
56
|
+
const git_index_entry *git_merge_driver_source_theirs(
|
57
|
+
const git_merge_driver_source *src)
|
54
58
|
{
|
55
|
-
|
59
|
+
GIT_ASSERT_ARG_WITH_RETVAL(src, NULL);
|
56
60
|
return src->theirs;
|
57
61
|
}
|
58
62
|
|
59
|
-
const git_merge_file_options*
|
63
|
+
const git_merge_file_options *git_merge_driver_source_file_options(
|
64
|
+
const git_merge_driver_source *src)
|
60
65
|
{
|
61
|
-
|
66
|
+
GIT_ASSERT_ARG_WITH_RETVAL(src, NULL);
|
62
67
|
return src->file_opts;
|
63
68
|
}
|
64
69
|
|
@@ -209,7 +214,7 @@ int git_merge_driver_global_init(void)
|
|
209
214
|
merge_driver_name__binary, &git_merge_driver__binary)) < 0)
|
210
215
|
goto done;
|
211
216
|
|
212
|
-
|
217
|
+
error = git_runtime_shutdown_register(git_merge_driver_global_shutdown);
|
213
218
|
|
214
219
|
done:
|
215
220
|
if (error < 0)
|
@@ -262,7 +267,8 @@ int git_merge_driver_register(const char *name, git_merge_driver *driver)
|
|
262
267
|
{
|
263
268
|
int error;
|
264
269
|
|
265
|
-
|
270
|
+
GIT_ASSERT_ARG(name);
|
271
|
+
GIT_ASSERT_ARG(driver);
|
266
272
|
|
267
273
|
if (git_rwlock_wrlock(&merge_driver_registry.lock) < 0) {
|
268
274
|
git_error_set(GIT_ERROR_OS, "failed to lock merge driver registry");
|
@@ -28,7 +28,7 @@
|
|
28
28
|
|
29
29
|
#define GIT_MERGE_FILE_SIDE_EXISTS(X) ((X)->mode != 0)
|
30
30
|
|
31
|
-
int
|
31
|
+
static int merge_file_input_from_index(
|
32
32
|
git_merge_file_input *input_out,
|
33
33
|
git_odb_object **odb_object_out,
|
34
34
|
git_odb *odb,
|
@@ -36,7 +36,10 @@ int git_merge_file__input_from_index(
|
|
36
36
|
{
|
37
37
|
int error = 0;
|
38
38
|
|
39
|
-
|
39
|
+
GIT_ASSERT_ARG(input_out);
|
40
|
+
GIT_ASSERT_ARG(odb_object_out);
|
41
|
+
GIT_ASSERT_ARG(odb);
|
42
|
+
GIT_ASSERT_ARG(entry);
|
40
43
|
|
41
44
|
if ((error = git_odb_read(odb_object_out, odb, &entry->id)) < 0)
|
42
45
|
goto done;
|
@@ -241,7 +244,9 @@ int git_merge_file(
|
|
241
244
|
{
|
242
245
|
git_merge_file_input inputs[3] = { {0} };
|
243
246
|
|
244
|
-
|
247
|
+
GIT_ASSERT_ARG(out);
|
248
|
+
GIT_ASSERT_ARG(ours);
|
249
|
+
GIT_ASSERT_ARG(theirs);
|
245
250
|
|
246
251
|
memset(out, 0x0, sizeof(git_merge_file_result));
|
247
252
|
|
@@ -268,7 +273,10 @@ int git_merge_file_from_index(
|
|
268
273
|
git_odb_object *odb_object[3] = { 0 };
|
269
274
|
int error = 0;
|
270
275
|
|
271
|
-
|
276
|
+
GIT_ASSERT_ARG(out);
|
277
|
+
GIT_ASSERT_ARG(repo);
|
278
|
+
GIT_ASSERT_ARG(ours);
|
279
|
+
GIT_ASSERT_ARG(theirs);
|
272
280
|
|
273
281
|
memset(out, 0x0, sizeof(git_merge_file_result));
|
274
282
|
|
@@ -276,17 +284,15 @@ int git_merge_file_from_index(
|
|
276
284
|
goto done;
|
277
285
|
|
278
286
|
if (ancestor) {
|
279
|
-
if ((error =
|
287
|
+
if ((error = merge_file_input_from_index(
|
280
288
|
&ancestor_input, &odb_object[0], odb, ancestor)) < 0)
|
281
289
|
goto done;
|
282
290
|
|
283
291
|
ancestor_ptr = &ancestor_input;
|
284
292
|
}
|
285
293
|
|
286
|
-
if ((error =
|
287
|
-
|
288
|
-
(error = git_merge_file__input_from_index(
|
289
|
-
&their_input, &odb_object[2], odb, theirs)) < 0)
|
294
|
+
if ((error = merge_file_input_from_index(&our_input, &odb_object[1], odb, ours)) < 0 ||
|
295
|
+
(error = merge_file_input_from_index(&their_input, &odb_object[2], odb, theirs)) < 0)
|
290
296
|
goto done;
|
291
297
|
|
292
298
|
error = merge_file__from_inputs(out,
|
@@ -28,8 +28,10 @@ int git_message_prettify(git_buf *message_out, const char *message, int strip_co
|
|
28
28
|
int consecutive_empty_lines = 0;
|
29
29
|
size_t i, line_length, rtrimmed_line_length;
|
30
30
|
char *next_newline;
|
31
|
+
int error;
|
31
32
|
|
32
|
-
git_buf_sanitize(message_out)
|
33
|
+
if ((error = git_buf_sanitize(message_out)) < 0)
|
34
|
+
return error;
|
33
35
|
|
34
36
|
for (i = 0; i < strlen(message); i += line_length) {
|
35
37
|
next_newline = memchr(message + i, '\n', message_len - i);
|