rugged 0.27.9 → 0.27.10
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 +1 -0
- data/vendor/libgit2/CMakeLists.txt +98 -54
- data/vendor/libgit2/COPYING +28 -0
- data/vendor/libgit2/cmake/Modules/AddCFlagIfSupported.cmake +15 -1
- data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +9 -8
- data/vendor/libgit2/cmake/Modules/FindCoreFoundation.cmake +2 -2
- data/vendor/libgit2/cmake/Modules/FindGSSAPI.cmake +1 -1
- data/vendor/libgit2/cmake/Modules/FindGSSFramework.cmake +28 -0
- data/vendor/libgit2/cmake/Modules/FindPCRE.cmake +38 -0
- data/vendor/libgit2/cmake/Modules/FindPCRE2.cmake +37 -0
- data/vendor/libgit2/cmake/Modules/FindSecurity.cmake +2 -2
- data/vendor/libgit2/cmake/Modules/FindStatNsec.cmake +6 -0
- data/vendor/libgit2/cmake/Modules/FindmbedTLS.cmake +93 -0
- data/vendor/libgit2/cmake/Modules/PkgBuildConfig.cmake +110 -0
- data/vendor/libgit2/cmake/Modules/SelectGSSAPI.cmake +53 -0
- data/vendor/libgit2/cmake/Modules/SelectHTTPSBackend.cmake +124 -0
- data/vendor/libgit2/cmake/Modules/SelectHashes.cmake +66 -0
- data/vendor/libgit2/deps/http-parser/CMakeLists.txt +2 -0
- data/vendor/libgit2/deps/http-parser/{LICENSE-MIT → COPYING} +0 -0
- data/vendor/libgit2/deps/http-parser/http_parser.c +11 -6
- data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +21 -0
- data/vendor/libgit2/deps/ntlmclient/compat.h +33 -0
- data/vendor/libgit2/deps/ntlmclient/crypt.h +64 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +120 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +18 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +145 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +18 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +130 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +21 -0
- data/vendor/libgit2/deps/ntlmclient/ntlm.c +1420 -0
- data/vendor/libgit2/deps/ntlmclient/ntlm.h +174 -0
- data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +320 -0
- data/vendor/libgit2/deps/ntlmclient/unicode.h +36 -0
- data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +445 -0
- data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +201 -0
- data/vendor/libgit2/deps/ntlmclient/utf8.h +1257 -0
- data/vendor/libgit2/deps/ntlmclient/util.c +21 -0
- data/vendor/libgit2/deps/ntlmclient/util.h +14 -0
- data/vendor/libgit2/deps/pcre/CMakeLists.txt +140 -0
- data/vendor/libgit2/deps/pcre/COPYING +5 -0
- data/vendor/libgit2/deps/pcre/cmake/COPYING-CMAKE-SCRIPTS +22 -0
- data/vendor/libgit2/deps/pcre/cmake/FindEditline.cmake +17 -0
- data/vendor/libgit2/deps/pcre/cmake/FindPackageHandleStandardArgs.cmake +58 -0
- data/vendor/libgit2/deps/pcre/cmake/FindReadline.cmake +29 -0
- data/vendor/libgit2/deps/pcre/config.h.in +57 -0
- data/vendor/libgit2/deps/pcre/pcre.h +641 -0
- data/vendor/libgit2/deps/pcre/pcre_byte_order.c +319 -0
- data/vendor/libgit2/deps/pcre/pcre_chartables.c +198 -0
- data/vendor/libgit2/deps/pcre/pcre_compile.c +9800 -0
- data/vendor/libgit2/deps/pcre/pcre_config.c +190 -0
- data/vendor/libgit2/deps/pcre/pcre_dfa_exec.c +3676 -0
- data/vendor/libgit2/deps/pcre/pcre_exec.c +7173 -0
- data/vendor/libgit2/deps/pcre/pcre_fullinfo.c +245 -0
- data/vendor/libgit2/deps/pcre/pcre_get.c +669 -0
- data/vendor/libgit2/deps/pcre/pcre_globals.c +86 -0
- data/vendor/libgit2/deps/pcre/pcre_internal.h +2787 -0
- data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +11913 -0
- data/vendor/libgit2/deps/pcre/pcre_maketables.c +156 -0
- data/vendor/libgit2/deps/pcre/pcre_newline.c +210 -0
- data/vendor/libgit2/deps/pcre/pcre_ord2utf8.c +94 -0
- data/vendor/libgit2/deps/pcre/pcre_printint.c +834 -0
- data/vendor/libgit2/deps/pcre/pcre_refcount.c +92 -0
- data/vendor/libgit2/deps/pcre/pcre_string_utils.c +211 -0
- data/vendor/libgit2/deps/pcre/pcre_study.c +1686 -0
- data/vendor/libgit2/deps/pcre/pcre_tables.c +727 -0
- data/vendor/libgit2/deps/pcre/pcre_ucd.c +3644 -0
- data/vendor/libgit2/deps/pcre/pcre_valid_utf8.c +301 -0
- data/vendor/libgit2/deps/pcre/pcre_version.c +98 -0
- data/vendor/libgit2/deps/pcre/pcre_xclass.c +268 -0
- data/vendor/libgit2/deps/pcre/pcreposix.c +421 -0
- data/vendor/libgit2/deps/pcre/pcreposix.h +117 -0
- data/vendor/libgit2/deps/pcre/ucp.h +224 -0
- data/vendor/libgit2/deps/winhttp/COPYING.GPL +993 -0
- data/vendor/libgit2/deps/winhttp/COPYING.LGPL +502 -0
- data/vendor/libgit2/deps/zlib/CMakeLists.txt +1 -0
- data/vendor/libgit2/deps/zlib/COPYING +27 -0
- data/vendor/libgit2/deps/zlib/adler32.c +0 -7
- data/vendor/libgit2/deps/zlib/crc32.c +0 -7
- data/vendor/libgit2/include/git2.h +5 -0
- data/vendor/libgit2/include/git2/annotated_commit.h +9 -0
- data/vendor/libgit2/include/git2/apply.h +149 -0
- data/vendor/libgit2/include/git2/attr.h +38 -20
- data/vendor/libgit2/include/git2/blame.h +42 -25
- data/vendor/libgit2/include/git2/blob.h +45 -13
- data/vendor/libgit2/include/git2/branch.h +1 -1
- data/vendor/libgit2/include/git2/buffer.h +22 -16
- data/vendor/libgit2/include/git2/cert.h +135 -0
- data/vendor/libgit2/include/git2/checkout.h +65 -32
- data/vendor/libgit2/include/git2/cherrypick.h +9 -7
- data/vendor/libgit2/include/git2/clone.h +12 -10
- data/vendor/libgit2/include/git2/commit.h +53 -3
- data/vendor/libgit2/include/git2/common.h +60 -8
- data/vendor/libgit2/include/git2/config.h +30 -19
- data/vendor/libgit2/include/git2/cred.h +308 -0
- data/vendor/libgit2/include/git2/deprecated.h +493 -0
- data/vendor/libgit2/include/git2/describe.h +32 -9
- data/vendor/libgit2/include/git2/diff.h +208 -156
- data/vendor/libgit2/include/git2/errors.h +54 -46
- data/vendor/libgit2/include/git2/filter.h +8 -0
- data/vendor/libgit2/include/git2/ignore.h +2 -2
- data/vendor/libgit2/include/git2/index.h +74 -52
- data/vendor/libgit2/include/git2/indexer.h +76 -6
- data/vendor/libgit2/include/git2/mailmap.h +115 -0
- data/vendor/libgit2/include/git2/merge.h +35 -18
- data/vendor/libgit2/include/git2/net.h +0 -5
- data/vendor/libgit2/include/git2/notes.h +1 -1
- data/vendor/libgit2/include/git2/object.h +17 -29
- data/vendor/libgit2/include/git2/odb.h +12 -11
- data/vendor/libgit2/include/git2/odb_backend.h +10 -9
- data/vendor/libgit2/include/git2/oid.h +2 -2
- data/vendor/libgit2/include/git2/pack.h +14 -3
- data/vendor/libgit2/include/git2/proxy.h +14 -8
- data/vendor/libgit2/include/git2/rebase.h +53 -6
- data/vendor/libgit2/include/git2/refs.h +33 -15
- data/vendor/libgit2/include/git2/refspec.h +17 -0
- data/vendor/libgit2/include/git2/remote.h +123 -24
- data/vendor/libgit2/include/git2/repository.h +76 -39
- data/vendor/libgit2/include/git2/revert.h +6 -4
- 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 +15 -12
- data/vendor/libgit2/include/git2/status.h +33 -20
- data/vendor/libgit2/include/git2/submodule.h +30 -12
- data/vendor/libgit2/include/git2/sys/alloc.h +101 -0
- data/vendor/libgit2/include/git2/sys/commit.h +1 -1
- data/vendor/libgit2/include/git2/sys/config.h +13 -13
- data/vendor/libgit2/include/git2/sys/cred.h +90 -0
- data/vendor/libgit2/include/git2/sys/filter.h +6 -6
- data/vendor/libgit2/include/git2/sys/index.h +3 -0
- data/vendor/libgit2/include/git2/sys/mempack.h +35 -35
- data/vendor/libgit2/include/git2/sys/merge.h +9 -4
- data/vendor/libgit2/include/git2/sys/odb_backend.h +66 -22
- data/vendor/libgit2/include/git2/sys/path.h +64 -0
- data/vendor/libgit2/include/git2/sys/refdb_backend.h +76 -40
- data/vendor/libgit2/include/git2/sys/repository.h +5 -1
- data/vendor/libgit2/include/git2/sys/stream.h +92 -12
- data/vendor/libgit2/include/git2/sys/transport.h +129 -83
- data/vendor/libgit2/include/git2/tag.h +13 -4
- data/vendor/libgit2/include/git2/trace.h +2 -2
- data/vendor/libgit2/include/git2/transaction.h +1 -0
- data/vendor/libgit2/include/git2/transport.h +11 -311
- data/vendor/libgit2/include/git2/tree.h +4 -4
- data/vendor/libgit2/include/git2/types.h +33 -111
- data/vendor/libgit2/include/git2/version.h +4 -4
- data/vendor/libgit2/include/git2/worktree.h +48 -13
- data/vendor/libgit2/src/CMakeLists.txt +96 -164
- data/vendor/libgit2/src/alloc.c +43 -0
- data/vendor/libgit2/src/alloc.h +40 -0
- data/vendor/libgit2/src/allocators/stdalloc.c +119 -0
- data/vendor/libgit2/src/{streams/curl.h → allocators/stdalloc.h} +5 -5
- data/vendor/libgit2/src/allocators/win32_crtdbg.c +118 -0
- data/vendor/libgit2/src/{transports/cred.h → allocators/win32_crtdbg.h} +5 -4
- data/vendor/libgit2/src/annotated_commit.c +15 -8
- data/vendor/libgit2/src/apply.c +537 -31
- data/vendor/libgit2/src/apply.h +3 -1
- data/vendor/libgit2/src/array.h +2 -2
- data/vendor/libgit2/src/attr.c +81 -75
- data/vendor/libgit2/src/attr_file.c +207 -121
- data/vendor/libgit2/src/attr_file.h +9 -9
- data/vendor/libgit2/src/attrcache.c +51 -53
- data/vendor/libgit2/src/attrcache.h +2 -1
- data/vendor/libgit2/src/blame.c +47 -20
- data/vendor/libgit2/src/blame.h +2 -1
- data/vendor/libgit2/src/blame_git.c +37 -20
- data/vendor/libgit2/src/blob.c +128 -42
- data/vendor/libgit2/src/blob.h +19 -2
- data/vendor/libgit2/src/branch.c +67 -43
- data/vendor/libgit2/src/buf_text.c +7 -6
- data/vendor/libgit2/src/buffer.c +69 -57
- data/vendor/libgit2/src/buffer.h +1 -1
- data/vendor/libgit2/src/cache.c +38 -45
- data/vendor/libgit2/src/cache.h +3 -3
- data/vendor/libgit2/src/cc-compat.h +20 -3
- data/vendor/libgit2/src/checkout.c +109 -90
- data/vendor/libgit2/src/cherrypick.c +15 -9
- data/vendor/libgit2/src/clone.c +49 -27
- data/vendor/libgit2/src/clone.h +4 -0
- data/vendor/libgit2/src/commit.c +117 -49
- data/vendor/libgit2/src/commit.h +7 -0
- data/vendor/libgit2/src/commit_list.c +30 -78
- data/vendor/libgit2/src/commit_list.h +2 -2
- data/vendor/libgit2/src/common.h +27 -91
- data/vendor/libgit2/src/config.c +194 -176
- data/vendor/libgit2/src/config.h +8 -20
- data/vendor/libgit2/src/config_backend.h +96 -0
- data/vendor/libgit2/src/config_cache.c +41 -35
- data/vendor/libgit2/src/config_entries.c +229 -0
- data/vendor/libgit2/src/config_entries.h +24 -0
- data/vendor/libgit2/src/config_file.c +439 -753
- data/vendor/libgit2/src/config_mem.c +220 -0
- data/vendor/libgit2/src/config_parse.c +114 -63
- data/vendor/libgit2/src/config_parse.h +17 -16
- data/vendor/libgit2/src/config_snapshot.c +206 -0
- data/vendor/libgit2/src/crlf.c +219 -190
- data/vendor/libgit2/src/delta.c +25 -18
- data/vendor/libgit2/src/describe.c +42 -41
- data/vendor/libgit2/src/diff.c +53 -68
- data/vendor/libgit2/src/diff.h +2 -1
- data/vendor/libgit2/src/diff_driver.c +47 -49
- data/vendor/libgit2/src/diff_file.c +19 -17
- data/vendor/libgit2/src/diff_file.h +1 -1
- data/vendor/libgit2/src/diff_generate.c +162 -106
- 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 +42 -30
- data/vendor/libgit2/src/diff_stats.c +22 -7
- data/vendor/libgit2/src/diff_tform.c +16 -16
- data/vendor/libgit2/src/diff_xdiff.c +15 -3
- data/vendor/libgit2/src/errors.c +51 -39
- data/vendor/libgit2/src/errors.h +81 -0
- data/vendor/libgit2/src/features.h.in +11 -3
- data/vendor/libgit2/src/fetch.c +10 -5
- data/vendor/libgit2/src/fetchhead.c +17 -17
- data/vendor/libgit2/src/filebuf.c +32 -36
- data/vendor/libgit2/src/filebuf.h +2 -2
- data/vendor/libgit2/src/filter.c +46 -38
- data/vendor/libgit2/src/filter.h +0 -10
- data/vendor/libgit2/src/{fileops.c → futils.c} +80 -73
- data/vendor/libgit2/src/{fileops.h → futils.h} +6 -6
- data/vendor/libgit2/src/global.c +48 -63
- data/vendor/libgit2/src/global.h +0 -2
- data/vendor/libgit2/src/hash.c +61 -0
- data/vendor/libgit2/src/hash.h +20 -19
- data/vendor/libgit2/src/hash/sha1.h +38 -0
- data/vendor/libgit2/src/hash/sha1/collisiondetect.c +48 -0
- data/vendor/libgit2/src/hash/sha1/collisiondetect.h +19 -0
- data/vendor/libgit2/src/hash/{hash_common_crypto.h → sha1/common_crypto.c} +17 -17
- data/vendor/libgit2/src/hash/sha1/common_crypto.h +19 -0
- data/vendor/libgit2/src/hash/{hash_generic.c → sha1/generic.c} +22 -10
- data/vendor/libgit2/src/hash/{hash_generic.h → sha1/generic.h} +4 -10
- data/vendor/libgit2/src/hash/sha1/mbedtls.c +46 -0
- data/vendor/libgit2/src/hash/sha1/mbedtls.h +19 -0
- data/vendor/libgit2/src/hash/sha1/openssl.c +59 -0
- data/vendor/libgit2/src/hash/sha1/openssl.h +19 -0
- data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.c +14 -3
- data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.h +0 -0
- data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.c +0 -0
- data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.h +0 -0
- data/vendor/libgit2/src/hash/{hash_win32.c → sha1/win32.c} +47 -37
- data/vendor/libgit2/src/hash/{hash_win32.h → sha1/win32.h} +6 -19
- data/vendor/libgit2/src/hashsig.c +5 -5
- data/vendor/libgit2/src/idxmap.c +107 -61
- data/vendor/libgit2/src/idxmap.h +153 -31
- data/vendor/libgit2/src/ignore.c +43 -47
- data/vendor/libgit2/src/index.c +337 -232
- data/vendor/libgit2/src/index.h +17 -1
- data/vendor/libgit2/src/indexer.c +346 -175
- data/vendor/libgit2/src/integer.h +71 -26
- data/vendor/libgit2/src/iterator.c +142 -70
- data/vendor/libgit2/src/iterator.h +15 -0
- data/vendor/libgit2/src/khash.h +3 -1
- data/vendor/libgit2/src/mailmap.c +485 -0
- data/vendor/libgit2/src/mailmap.h +35 -0
- data/vendor/libgit2/src/map.h +1 -1
- data/vendor/libgit2/src/merge.c +144 -100
- data/vendor/libgit2/src/merge_driver.c +11 -11
- data/vendor/libgit2/src/merge_file.c +2 -2
- data/vendor/libgit2/src/mwindow.c +24 -29
- data/vendor/libgit2/src/mwindow.h +4 -4
- data/vendor/libgit2/src/net.c +184 -0
- data/vendor/libgit2/src/net.h +36 -0
- data/vendor/libgit2/src/netops.c +55 -156
- data/vendor/libgit2/src/netops.h +3 -23
- data/vendor/libgit2/src/notes.c +16 -11
- data/vendor/libgit2/src/object.c +120 -69
- data/vendor/libgit2/src/object.h +22 -9
- data/vendor/libgit2/src/object_api.c +8 -8
- data/vendor/libgit2/src/odb.c +116 -93
- data/vendor/libgit2/src/odb.h +8 -7
- data/vendor/libgit2/src/odb_loose.c +62 -55
- data/vendor/libgit2/src/odb_mempack.c +21 -34
- data/vendor/libgit2/src/odb_pack.c +18 -14
- data/vendor/libgit2/src/offmap.c +53 -35
- data/vendor/libgit2/src/offmap.h +108 -21
- data/vendor/libgit2/src/oid.c +12 -7
- data/vendor/libgit2/src/oidmap.c +49 -47
- data/vendor/libgit2/src/oidmap.h +101 -24
- data/vendor/libgit2/src/pack-objects.c +88 -87
- data/vendor/libgit2/src/pack-objects.h +2 -8
- data/vendor/libgit2/src/pack.c +99 -101
- data/vendor/libgit2/src/pack.h +17 -19
- data/vendor/libgit2/src/parse.c +10 -0
- 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 +151 -63
- data/vendor/libgit2/src/path.c +169 -125
- data/vendor/libgit2/src/path.h +3 -71
- data/vendor/libgit2/src/pathspec.c +19 -19
- data/vendor/libgit2/src/pool.c +26 -22
- data/vendor/libgit2/src/pool.h +7 -7
- data/vendor/libgit2/src/posix.c +10 -10
- data/vendor/libgit2/src/posix.h +12 -1
- data/vendor/libgit2/src/proxy.c +8 -3
- data/vendor/libgit2/src/push.c +37 -31
- data/vendor/libgit2/src/push.h +2 -1
- data/vendor/libgit2/src/reader.c +265 -0
- data/vendor/libgit2/src/reader.h +107 -0
- data/vendor/libgit2/src/rebase.c +115 -59
- data/vendor/libgit2/src/refdb.c +15 -3
- data/vendor/libgit2/src/refdb_fs.c +381 -254
- data/vendor/libgit2/src/reflog.c +13 -15
- data/vendor/libgit2/src/refs.c +118 -88
- data/vendor/libgit2/src/refs.h +5 -3
- data/vendor/libgit2/src/refspec.c +56 -37
- data/vendor/libgit2/src/refspec.h +1 -1
- data/vendor/libgit2/src/regexp.c +221 -0
- data/vendor/libgit2/src/regexp.h +97 -0
- data/vendor/libgit2/src/remote.c +266 -215
- data/vendor/libgit2/src/remote.h +11 -2
- data/vendor/libgit2/src/repository.c +280 -225
- data/vendor/libgit2/src/repository.h +52 -40
- data/vendor/libgit2/src/reset.c +8 -8
- data/vendor/libgit2/src/revert.c +14 -9
- data/vendor/libgit2/src/revparse.c +47 -48
- data/vendor/libgit2/src/revwalk.c +120 -57
- data/vendor/libgit2/src/revwalk.h +22 -1
- data/vendor/libgit2/src/settings.c +47 -10
- data/vendor/libgit2/src/signature.c +11 -11
- data/vendor/libgit2/src/sortedcache.c +22 -36
- data/vendor/libgit2/src/sortedcache.h +1 -1
- data/vendor/libgit2/src/stash.c +125 -99
- data/vendor/libgit2/src/status.c +28 -22
- data/vendor/libgit2/src/stream.h +17 -2
- data/vendor/libgit2/src/streams/mbedtls.c +483 -0
- data/vendor/libgit2/src/streams/mbedtls.h +23 -0
- data/vendor/libgit2/src/streams/openssl.c +224 -114
- data/vendor/libgit2/src/streams/openssl.h +4 -108
- data/vendor/libgit2/src/streams/registry.c +118 -0
- data/vendor/libgit2/src/streams/registry.h +19 -0
- data/vendor/libgit2/src/streams/socket.c +55 -30
- data/vendor/libgit2/src/streams/stransport.c +57 -32
- data/vendor/libgit2/src/streams/stransport.h +5 -0
- data/vendor/libgit2/src/streams/tls.c +50 -19
- data/vendor/libgit2/src/streams/tls.h +12 -4
- data/vendor/libgit2/src/strmap.c +47 -74
- data/vendor/libgit2/src/strmap.h +108 -33
- data/vendor/libgit2/src/submodule.c +272 -216
- data/vendor/libgit2/src/submodule.h +1 -1
- data/vendor/libgit2/src/sysdir.c +29 -19
- data/vendor/libgit2/src/tag.c +41 -28
- data/vendor/libgit2/src/tag.h +2 -1
- data/vendor/libgit2/src/trace.c +2 -2
- data/vendor/libgit2/src/trace.h +3 -3
- data/vendor/libgit2/src/trailer.c +52 -38
- data/vendor/libgit2/src/transaction.c +30 -29
- data/vendor/libgit2/src/transport.c +5 -5
- data/vendor/libgit2/src/transports/auth.c +15 -11
- data/vendor/libgit2/src/transports/auth.h +10 -3
- data/vendor/libgit2/src/transports/auth_negotiate.c +33 -18
- data/vendor/libgit2/src/transports/auth_negotiate.h +2 -2
- data/vendor/libgit2/src/transports/auth_ntlm.c +223 -0
- data/vendor/libgit2/src/transports/auth_ntlm.h +35 -0
- data/vendor/libgit2/src/transports/cred.c +24 -24
- data/vendor/libgit2/src/transports/git.c +26 -31
- data/vendor/libgit2/src/transports/http.c +881 -348
- data/vendor/libgit2/src/transports/http.h +2 -0
- data/vendor/libgit2/src/transports/local.c +35 -35
- data/vendor/libgit2/src/transports/smart.c +70 -47
- data/vendor/libgit2/src/transports/smart.h +3 -4
- data/vendor/libgit2/src/transports/smart_pkt.c +43 -40
- data/vendor/libgit2/src/transports/smart_protocol.c +96 -116
- data/vendor/libgit2/src/transports/ssh.c +77 -66
- data/vendor/libgit2/src/transports/winhttp.c +318 -314
- data/vendor/libgit2/src/tree-cache.c +19 -12
- data/vendor/libgit2/src/tree.c +103 -142
- data/vendor/libgit2/src/tree.h +1 -12
- data/vendor/libgit2/src/unix/map.c +3 -3
- data/vendor/libgit2/src/unix/posix.h +1 -11
- data/vendor/libgit2/src/userdiff.h +3 -1
- data/vendor/libgit2/src/util.c +70 -56
- data/vendor/libgit2/src/util.h +28 -156
- data/vendor/libgit2/src/vector.c +4 -4
- data/vendor/libgit2/src/wildmatch.c +320 -0
- data/vendor/libgit2/src/wildmatch.h +23 -0
- data/vendor/libgit2/src/win32/dir.c +3 -3
- data/vendor/libgit2/src/win32/findfile.c +3 -3
- data/vendor/libgit2/src/win32/map.c +9 -11
- data/vendor/libgit2/src/win32/msvc-compat.h +6 -0
- data/vendor/libgit2/src/win32/path_w32.c +113 -9
- data/vendor/libgit2/src/win32/path_w32.h +18 -29
- data/vendor/libgit2/src/win32/posix.h +1 -4
- data/vendor/libgit2/src/win32/posix_w32.c +70 -45
- data/vendor/libgit2/src/win32/precompiled.h +0 -2
- data/vendor/libgit2/src/win32/thread.c +5 -10
- data/vendor/libgit2/src/win32/w32_buffer.c +9 -5
- data/vendor/libgit2/src/win32/w32_common.h +39 -0
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +3 -2
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +26 -75
- data/vendor/libgit2/src/win32/w32_stack.c +6 -11
- data/vendor/libgit2/src/win32/w32_stack.h +3 -3
- data/vendor/libgit2/src/win32/w32_util.c +27 -64
- data/vendor/libgit2/src/win32/w32_util.h +5 -49
- data/vendor/libgit2/src/worktree.c +95 -60
- data/vendor/libgit2/src/worktree.h +2 -0
- data/vendor/libgit2/src/xdiff/xdiffi.c +7 -5
- data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
- data/vendor/libgit2/src/xdiff/xmerge.c +27 -15
- data/vendor/libgit2/src/xdiff/xpatience.c +3 -0
- data/vendor/libgit2/src/zstream.c +4 -4
- metadata +122 -33
- data/vendor/libgit2/deps/regex/CMakeLists.txt +0 -2
- data/vendor/libgit2/deps/regex/config.h +0 -7
- data/vendor/libgit2/deps/regex/regcomp.c +0 -3857
- data/vendor/libgit2/deps/regex/regex.c +0 -92
- data/vendor/libgit2/deps/regex/regex.h +0 -582
- data/vendor/libgit2/deps/regex/regex_internal.c +0 -1744
- data/vendor/libgit2/deps/regex/regex_internal.h +0 -819
- data/vendor/libgit2/deps/regex/regexec.c +0 -4369
- data/vendor/libgit2/include/git2/inttypes.h +0 -309
- data/vendor/libgit2/include/git2/sys/time.h +0 -31
- data/vendor/libgit2/libgit2.pc.in +0 -13
- data/vendor/libgit2/src/config_file.h +0 -73
- data/vendor/libgit2/src/fnmatch.c +0 -248
- data/vendor/libgit2/src/fnmatch.h +0 -48
- data/vendor/libgit2/src/hash/hash_collisiondetect.h +0 -47
- data/vendor/libgit2/src/hash/hash_openssl.h +0 -59
- data/vendor/libgit2/src/streams/curl.c +0 -385
@@ -0,0 +1,107 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
|
+
*
|
4
|
+
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
|
+
* a Linking Exception. For full terms see the included COPYING file.
|
6
|
+
*/
|
7
|
+
#ifndef INCLUDE_reader_h__
|
8
|
+
#define INCLUDE_reader_h__
|
9
|
+
|
10
|
+
#include "common.h"
|
11
|
+
|
12
|
+
/* Returned when the workdir does not match the index */
|
13
|
+
#define GIT_READER_MISMATCH 1
|
14
|
+
|
15
|
+
typedef struct git_reader git_reader;
|
16
|
+
|
17
|
+
/*
|
18
|
+
* The `git_reader` structure is a generic interface for reading the
|
19
|
+
* contents of a file by its name, and implementations are provided
|
20
|
+
* for reading out of a tree, the index, and the working directory.
|
21
|
+
*
|
22
|
+
* Note that the reader implementation is meant to have a short
|
23
|
+
* lifecycle and does not increase the refcount of the object that
|
24
|
+
* it's reading. Callers should ensure that they do not use a
|
25
|
+
* reader after disposing the underlying object that it reads.
|
26
|
+
*/
|
27
|
+
struct git_reader {
|
28
|
+
int (*read)(git_buf *out, git_oid *out_oid, git_filemode_t *mode, git_reader *reader, const char *filename);
|
29
|
+
};
|
30
|
+
|
31
|
+
/**
|
32
|
+
* Create a `git_reader` that will allow random access to the given
|
33
|
+
* tree. Paths requested via `git_reader_read` will be rooted at this
|
34
|
+
* tree, callers are not expected to recurse through tree lookups. Thus,
|
35
|
+
* you can request to read `/src/foo.c` and the tree provided to this
|
36
|
+
* function will be searched to find another tree named `src`, which
|
37
|
+
* will then be opened to find `foo.c`.
|
38
|
+
*
|
39
|
+
* @param out The reader for the given tree
|
40
|
+
* @param tree The tree object to read
|
41
|
+
* @return 0 on success, or an error code < 0
|
42
|
+
*/
|
43
|
+
extern int git_reader_for_tree(
|
44
|
+
git_reader **out,
|
45
|
+
git_tree *tree);
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Create a `git_reader` that will allow random access to the given
|
49
|
+
* index, or the repository's index.
|
50
|
+
*
|
51
|
+
* @param out The reader for the given index
|
52
|
+
* @param repo The repository containing the index
|
53
|
+
* @param index The index to read, or NULL to use the repository's index
|
54
|
+
* @return 0 on success, or an error code < 0
|
55
|
+
*/
|
56
|
+
extern int git_reader_for_index(
|
57
|
+
git_reader **out,
|
58
|
+
git_repository *repo,
|
59
|
+
git_index *index);
|
60
|
+
|
61
|
+
/**
|
62
|
+
* Create a `git_reader` that will allow random access to the given
|
63
|
+
* repository's working directory. Note that the contents are read
|
64
|
+
* in repository format, meaning any workdir -> odb filters are
|
65
|
+
* applied.
|
66
|
+
*
|
67
|
+
* If `validate_index` is set to true, reads of files will hash the
|
68
|
+
* on-disk contents and ensure that the resulting object ID matches
|
69
|
+
* the repository's index. This ensures that the working directory
|
70
|
+
* is unmodified from the index contents.
|
71
|
+
*
|
72
|
+
* @param out The reader for the given working directory
|
73
|
+
* @param repo The repository containing the working directory
|
74
|
+
* @param validate_index If true, the working directory contents will
|
75
|
+
* be compared to the index contents during read to ensure that
|
76
|
+
* the working directory is unmodified.
|
77
|
+
* @return 0 on success, or an error code < 0
|
78
|
+
*/
|
79
|
+
extern int git_reader_for_workdir(
|
80
|
+
git_reader **out,
|
81
|
+
git_repository *repo,
|
82
|
+
bool validate_index);
|
83
|
+
|
84
|
+
/**
|
85
|
+
* Read the given filename from the reader and populate the given buffer
|
86
|
+
* with the contents and the given oid with the object ID.
|
87
|
+
*
|
88
|
+
* @param out The buffer to populate with the file contents
|
89
|
+
* @param out_id The oid to populate with the object ID
|
90
|
+
* @param reader The reader to read
|
91
|
+
* @param filename The filename to read from the reader
|
92
|
+
*/
|
93
|
+
extern int git_reader_read(
|
94
|
+
git_buf *out,
|
95
|
+
git_oid *out_id,
|
96
|
+
git_filemode_t *out_filemode,
|
97
|
+
git_reader *reader,
|
98
|
+
const char *filename);
|
99
|
+
|
100
|
+
/**
|
101
|
+
* Free the given reader and any associated objects.
|
102
|
+
*
|
103
|
+
* @param reader The reader to free
|
104
|
+
*/
|
105
|
+
extern void git_reader_free(git_reader *reader);
|
106
|
+
|
107
|
+
#endif
|
data/vendor/libgit2/src/rebase.c
CHANGED
@@ -116,7 +116,7 @@ done:
|
|
116
116
|
if (type != GIT_REBASE_TYPE_NONE && path_out)
|
117
117
|
*path_out = git_buf_detach(&path);
|
118
118
|
|
119
|
-
|
119
|
+
git_buf_dispose(&path);
|
120
120
|
|
121
121
|
return 0;
|
122
122
|
}
|
@@ -153,7 +153,7 @@ GIT_INLINE(int) rebase_readint(
|
|
153
153
|
return error;
|
154
154
|
|
155
155
|
if (git__strntol32(&num, asc_out->ptr, asc_out->size, &eol, 10) < 0 || num < 0 || *eol) {
|
156
|
-
|
156
|
+
git_error_set(GIT_ERROR_REBASE, "the file '%s' contains an invalid numeric value", filename);
|
157
157
|
return -1;
|
158
158
|
}
|
159
159
|
|
@@ -171,7 +171,7 @@ GIT_INLINE(int) rebase_readoid(
|
|
171
171
|
return error;
|
172
172
|
|
173
173
|
if (str_out->size != GIT_OID_HEXSZ || git_oid_fromstr(out, str_out->ptr) < 0) {
|
174
|
-
|
174
|
+
git_error_set(GIT_ERROR_REBASE, "the file '%s' contains an invalid object ID", filename);
|
175
175
|
return -1;
|
176
176
|
}
|
177
177
|
|
@@ -231,7 +231,7 @@ static int rebase_open_merge(git_rebase *rebase)
|
|
231
231
|
|
232
232
|
/* Read cmt.* */
|
233
233
|
git_array_init_to_size(rebase->operations, end);
|
234
|
-
|
234
|
+
GIT_ERROR_CHECK_ARRAY(rebase->operations);
|
235
235
|
|
236
236
|
for (i = 0; i < end; i++) {
|
237
237
|
git_buf_clear(&cmt);
|
@@ -241,7 +241,7 @@ static int rebase_open_merge(git_rebase *rebase)
|
|
241
241
|
goto done;
|
242
242
|
|
243
243
|
operation = rebase_operation_alloc(rebase, GIT_REBASE_OPERATION_PICK, &id, NULL);
|
244
|
-
|
244
|
+
GIT_ERROR_CHECK_ALLOC(operation);
|
245
245
|
}
|
246
246
|
|
247
247
|
/* Read 'onto_name' */
|
@@ -251,9 +251,9 @@ static int rebase_open_merge(git_rebase *rebase)
|
|
251
251
|
rebase->onto_name = git_buf_detach(&buf);
|
252
252
|
|
253
253
|
done:
|
254
|
-
|
255
|
-
|
256
|
-
|
254
|
+
git_buf_dispose(&cmt);
|
255
|
+
git_buf_dispose(&state_path);
|
256
|
+
git_buf_dispose(&buf);
|
257
257
|
|
258
258
|
return error;
|
259
259
|
}
|
@@ -261,23 +261,20 @@ done:
|
|
261
261
|
static int rebase_alloc(git_rebase **out, const git_rebase_options *rebase_opts)
|
262
262
|
{
|
263
263
|
git_rebase *rebase = git__calloc(1, sizeof(git_rebase));
|
264
|
-
|
264
|
+
GIT_ERROR_CHECK_ALLOC(rebase);
|
265
265
|
|
266
266
|
*out = NULL;
|
267
267
|
|
268
268
|
if (rebase_opts)
|
269
269
|
memcpy(&rebase->options, rebase_opts, sizeof(git_rebase_options));
|
270
270
|
else
|
271
|
-
|
271
|
+
git_rebase_options_init(&rebase->options, GIT_REBASE_OPTIONS_VERSION);
|
272
272
|
|
273
273
|
if (rebase_opts && rebase_opts->rewrite_notes_ref) {
|
274
274
|
rebase->options.rewrite_notes_ref = git__strdup(rebase_opts->rewrite_notes_ref);
|
275
|
-
|
275
|
+
GIT_ERROR_CHECK_ALLOC(rebase->options.rewrite_notes_ref);
|
276
276
|
}
|
277
277
|
|
278
|
-
if ((rebase->options.checkout_options.checkout_strategy & (GIT_CHECKOUT_SAFE | GIT_CHECKOUT_FORCE)) == 0)
|
279
|
-
rebase->options.checkout_options.checkout_strategy = GIT_CHECKOUT_SAFE;
|
280
|
-
|
281
278
|
*out = rebase;
|
282
279
|
|
283
280
|
return 0;
|
@@ -285,10 +282,10 @@ static int rebase_alloc(git_rebase **out, const git_rebase_options *rebase_opts)
|
|
285
282
|
|
286
283
|
static int rebase_check_versions(const git_rebase_options *given_opts)
|
287
284
|
{
|
288
|
-
|
285
|
+
GIT_ERROR_CHECK_VERSION(given_opts, GIT_REBASE_OPTIONS_VERSION, "git_rebase_options");
|
289
286
|
|
290
287
|
if (given_opts)
|
291
|
-
|
288
|
+
GIT_ERROR_CHECK_VERSION(&given_opts->checkout_options, GIT_CHECKOUT_OPTIONS_VERSION, "git_checkout_options");
|
292
289
|
|
293
290
|
return 0;
|
294
291
|
}
|
@@ -301,7 +298,8 @@ int git_rebase_open(
|
|
301
298
|
git_rebase *rebase;
|
302
299
|
git_buf path = GIT_BUF_INIT, orig_head_name = GIT_BUF_INIT,
|
303
300
|
orig_head_id = GIT_BUF_INIT, onto_id = GIT_BUF_INIT;
|
304
|
-
|
301
|
+
size_t state_path_len;
|
302
|
+
int error;
|
305
303
|
|
306
304
|
assert(repo);
|
307
305
|
|
@@ -317,7 +315,7 @@ int git_rebase_open(
|
|
317
315
|
goto done;
|
318
316
|
|
319
317
|
if (rebase->type == GIT_REBASE_TYPE_NONE) {
|
320
|
-
|
318
|
+
git_error_set(GIT_ERROR_REBASE, "there is no rebase in progress");
|
321
319
|
error = GIT_ENOTFOUND;
|
322
320
|
goto done;
|
323
321
|
}
|
@@ -373,14 +371,14 @@ int git_rebase_open(
|
|
373
371
|
|
374
372
|
switch (rebase->type) {
|
375
373
|
case GIT_REBASE_TYPE_INTERACTIVE:
|
376
|
-
|
374
|
+
git_error_set(GIT_ERROR_REBASE, "interactive rebase is not supported");
|
377
375
|
error = -1;
|
378
376
|
break;
|
379
377
|
case GIT_REBASE_TYPE_MERGE:
|
380
378
|
error = rebase_open_merge(rebase);
|
381
379
|
break;
|
382
380
|
case GIT_REBASE_TYPE_APPLY:
|
383
|
-
|
381
|
+
git_error_set(GIT_ERROR_REBASE, "patch application rebase is not supported");
|
384
382
|
error = -1;
|
385
383
|
break;
|
386
384
|
default:
|
@@ -393,10 +391,10 @@ done:
|
|
393
391
|
else
|
394
392
|
git_rebase_free(rebase);
|
395
393
|
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
394
|
+
git_buf_dispose(&path);
|
395
|
+
git_buf_dispose(&orig_head_name);
|
396
|
+
git_buf_dispose(&orig_head_id);
|
397
|
+
git_buf_dispose(&onto_id);
|
400
398
|
return error;
|
401
399
|
}
|
402
400
|
|
@@ -424,8 +422,8 @@ static int rebase_setupfile(git_rebase *rebase, const char *filename, int flags,
|
|
424
422
|
if ((error = git_buf_joinpath(&path, rebase->state_path, filename)) == 0)
|
425
423
|
error = git_futils_writebuffer(&contents, path.ptr, flags, REBASE_FILE_MODE);
|
426
424
|
|
427
|
-
|
428
|
-
|
425
|
+
git_buf_dispose(&path);
|
426
|
+
git_buf_dispose(&contents);
|
429
427
|
|
430
428
|
return error;
|
431
429
|
}
|
@@ -466,7 +464,7 @@ static int rebase_setupfiles_merge(git_rebase *rebase)
|
|
466
464
|
}
|
467
465
|
|
468
466
|
done:
|
469
|
-
|
467
|
+
git_buf_dispose(&commit_filename);
|
470
468
|
return error;
|
471
469
|
}
|
472
470
|
|
@@ -479,7 +477,7 @@ static int rebase_setupfiles(git_rebase *rebase)
|
|
479
477
|
git_oid_fmt(orig_head, &rebase->orig_head_id);
|
480
478
|
|
481
479
|
if (p_mkdir(rebase->state_path, REBASE_DIR_MODE) < 0) {
|
482
|
-
|
480
|
+
git_error_set(GIT_ERROR_OS, "failed to create rebase directory '%s'", rebase->state_path);
|
483
481
|
return -1;
|
484
482
|
}
|
485
483
|
|
@@ -496,13 +494,18 @@ static int rebase_setupfiles(git_rebase *rebase)
|
|
496
494
|
return rebase_setupfiles_merge(rebase);
|
497
495
|
}
|
498
496
|
|
499
|
-
int
|
497
|
+
int git_rebase_options_init(git_rebase_options *opts, unsigned int version)
|
500
498
|
{
|
501
499
|
GIT_INIT_STRUCTURE_FROM_TEMPLATE(
|
502
500
|
opts, version, git_rebase_options, GIT_REBASE_OPTIONS_INIT);
|
503
501
|
return 0;
|
504
502
|
}
|
505
503
|
|
504
|
+
int git_rebase_init_options(git_rebase_options *opts, unsigned int version)
|
505
|
+
{
|
506
|
+
return git_rebase_options_init(opts, version);
|
507
|
+
}
|
508
|
+
|
506
509
|
static int rebase_ensure_not_in_progress(git_repository *repo)
|
507
510
|
{
|
508
511
|
int error;
|
@@ -512,7 +515,7 @@ static int rebase_ensure_not_in_progress(git_repository *repo)
|
|
512
515
|
return error;
|
513
516
|
|
514
517
|
if (type != GIT_REBASE_TYPE_NONE) {
|
515
|
-
|
518
|
+
git_error_set(GIT_ERROR_REBASE, "there is an existing rebase in progress");
|
516
519
|
return -1;
|
517
520
|
}
|
518
521
|
|
@@ -537,7 +540,7 @@ static int rebase_ensure_not_dirty(
|
|
537
540
|
goto done;
|
538
541
|
|
539
542
|
if (git_diff_num_deltas(diff) > 0) {
|
540
|
-
|
543
|
+
git_error_set(GIT_ERROR_REBASE, "uncommitted changes exist in index");
|
541
544
|
error = fail_with;
|
542
545
|
goto done;
|
543
546
|
}
|
@@ -553,7 +556,7 @@ static int rebase_ensure_not_dirty(
|
|
553
556
|
goto done;
|
554
557
|
|
555
558
|
if (git_diff_num_deltas(diff) > 0) {
|
556
|
-
|
559
|
+
git_error_set(GIT_ERROR_REBASE, "unstaged changes exist in workdir");
|
557
560
|
error = fail_with;
|
558
561
|
goto done;
|
559
562
|
}
|
@@ -602,7 +605,7 @@ static int rebase_init_operations(
|
|
602
605
|
continue;
|
603
606
|
|
604
607
|
operation = rebase_operation_alloc(rebase, GIT_REBASE_OPERATION_PICK, &id, NULL);
|
605
|
-
|
608
|
+
GIT_ERROR_CHECK_ALLOC(operation);
|
606
609
|
}
|
607
610
|
|
608
611
|
error = 0;
|
@@ -631,17 +634,17 @@ static int rebase_init_merge(
|
|
631
634
|
goto done;
|
632
635
|
|
633
636
|
rebase->state_path = git_buf_detach(&state_path);
|
634
|
-
|
637
|
+
GIT_ERROR_CHECK_ALLOC(rebase->state_path);
|
635
638
|
|
636
639
|
if (branch->ref_name && strcmp(branch->ref_name, "HEAD")) {
|
637
640
|
rebase->orig_head_name = git__strdup(branch->ref_name);
|
638
|
-
|
641
|
+
GIT_ERROR_CHECK_ALLOC(rebase->orig_head_name);
|
639
642
|
} else {
|
640
643
|
rebase->head_detached = 1;
|
641
644
|
}
|
642
645
|
|
643
646
|
rebase->onto_name = git__strdup(rebase_onto_name(onto));
|
644
|
-
|
647
|
+
GIT_ERROR_CHECK_ALLOC(rebase->onto_name);
|
645
648
|
|
646
649
|
rebase->quiet = rebase->options.quiet;
|
647
650
|
|
@@ -662,8 +665,8 @@ static int rebase_init_merge(
|
|
662
665
|
done:
|
663
666
|
git_reference_free(head_ref);
|
664
667
|
git_commit_free(onto_commit);
|
665
|
-
|
666
|
-
|
668
|
+
git_buf_dispose(&reflog);
|
669
|
+
git_buf_dispose(&state_path);
|
667
670
|
|
668
671
|
return error;
|
669
672
|
}
|
@@ -810,7 +813,7 @@ static int rebase_next_merge(
|
|
810
813
|
goto done;
|
811
814
|
|
812
815
|
if ((parent_count = git_commit_parentcount(current_commit)) > 1) {
|
813
|
-
|
816
|
+
git_error_set(GIT_ERROR_REBASE, "cannot rebase a merge commit");
|
814
817
|
error = -1;
|
815
818
|
goto done;
|
816
819
|
} else if (parent_count) {
|
@@ -842,7 +845,7 @@ done:
|
|
842
845
|
git_tree_free(parent_tree);
|
843
846
|
git_commit_free(parent_commit);
|
844
847
|
git_commit_free(current_commit);
|
845
|
-
|
848
|
+
git_buf_dispose(&path);
|
846
849
|
|
847
850
|
return error;
|
848
851
|
}
|
@@ -867,7 +870,7 @@ static int rebase_next_inmemory(
|
|
867
870
|
goto done;
|
868
871
|
|
869
872
|
if ((parent_count = git_commit_parentcount(current_commit)) > 1) {
|
870
|
-
|
873
|
+
git_error_set(GIT_ERROR_REBASE, "cannot rebase a merge commit");
|
871
874
|
error = -1;
|
872
875
|
goto done;
|
873
876
|
} else if (parent_count) {
|
@@ -948,12 +951,16 @@ static int rebase_commit__create(
|
|
948
951
|
git_commit *current_commit = NULL, *commit = NULL;
|
949
952
|
git_tree *parent_tree = NULL, *tree = NULL;
|
950
953
|
git_oid tree_id, commit_id;
|
954
|
+
git_buf commit_content = GIT_BUF_INIT, commit_signature = GIT_BUF_INIT,
|
955
|
+
signature_field = GIT_BUF_INIT;
|
956
|
+
const char *signature_field_string = NULL,
|
957
|
+
*commit_signature_string = NULL;
|
951
958
|
int error;
|
952
959
|
|
953
960
|
operation = git_array_get(rebase->operations, rebase->current);
|
954
961
|
|
955
962
|
if (git_index_has_conflicts(index)) {
|
956
|
-
|
963
|
+
git_error_set(GIT_ERROR_REBASE, "conflicts have not been resolved");
|
957
964
|
error = GIT_EUNMERGED;
|
958
965
|
goto done;
|
959
966
|
}
|
@@ -965,7 +972,7 @@ static int rebase_commit__create(
|
|
965
972
|
goto done;
|
966
973
|
|
967
974
|
if (git_oid_equal(&tree_id, git_tree_id(parent_tree))) {
|
968
|
-
|
975
|
+
git_error_set(GIT_ERROR_REBASE, "this patch has already been applied");
|
969
976
|
error = GIT_EAPPLIED;
|
970
977
|
goto done;
|
971
978
|
}
|
@@ -978,10 +985,40 @@ static int rebase_commit__create(
|
|
978
985
|
message = git_commit_message(current_commit);
|
979
986
|
}
|
980
987
|
|
981
|
-
if ((error =
|
982
|
-
|
983
|
-
|
984
|
-
|
988
|
+
if ((error = git_commit_create_buffer(&commit_content, rebase->repo, author, committer,
|
989
|
+
message_encoding, message, tree, 1, (const git_commit **)&parent_commit)) < 0)
|
990
|
+
goto done;
|
991
|
+
|
992
|
+
if (rebase->options.signing_cb) {
|
993
|
+
git_error_clear();
|
994
|
+
error = git_error_set_after_callback_function(rebase->options.signing_cb(
|
995
|
+
&commit_signature, &signature_field, git_buf_cstr(&commit_content),
|
996
|
+
rebase->options.payload), "commit signing_cb failed");
|
997
|
+
if (error == GIT_PASSTHROUGH) {
|
998
|
+
git_buf_dispose(&commit_signature);
|
999
|
+
git_buf_dispose(&signature_field);
|
1000
|
+
git_error_clear();
|
1001
|
+
error = GIT_OK;
|
1002
|
+
} else if (error < 0)
|
1003
|
+
goto done;
|
1004
|
+
}
|
1005
|
+
|
1006
|
+
if (git_buf_is_allocated(&commit_signature)) {
|
1007
|
+
assert(git_buf_contains_nul(&commit_signature));
|
1008
|
+
commit_signature_string = git_buf_cstr(&commit_signature);
|
1009
|
+
}
|
1010
|
+
|
1011
|
+
if (git_buf_is_allocated(&signature_field)) {
|
1012
|
+
assert(git_buf_contains_nul(&signature_field));
|
1013
|
+
signature_field_string = git_buf_cstr(&signature_field);
|
1014
|
+
}
|
1015
|
+
|
1016
|
+
if ((error = git_commit_create_with_signature(&commit_id, rebase->repo,
|
1017
|
+
git_buf_cstr(&commit_content), commit_signature_string,
|
1018
|
+
signature_field_string)))
|
1019
|
+
goto done;
|
1020
|
+
|
1021
|
+
if ((error = git_commit_lookup(&commit, rebase->repo, &commit_id)) < 0)
|
985
1022
|
goto done;
|
986
1023
|
|
987
1024
|
*out = commit;
|
@@ -990,6 +1027,9 @@ done:
|
|
990
1027
|
if (error < 0)
|
991
1028
|
git_commit_free(commit);
|
992
1029
|
|
1030
|
+
git_buf_dispose(&commit_signature);
|
1031
|
+
git_buf_dispose(&signature_field);
|
1032
|
+
git_buf_dispose(&commit_content);
|
993
1033
|
git_commit_free(current_commit);
|
994
1034
|
git_tree_free(parent_tree);
|
995
1035
|
git_tree_free(tree);
|
@@ -1017,7 +1057,7 @@ static int rebase_commit_merge(
|
|
1017
1057
|
|
1018
1058
|
if ((error = rebase_ensure_not_dirty(rebase->repo, false, true, GIT_EUNMERGED)) < 0 ||
|
1019
1059
|
(error = git_repository_head(&head, rebase->repo)) < 0 ||
|
1020
|
-
(error = git_reference_peel((git_object **)&head_commit, head,
|
1060
|
+
(error = git_reference_peel((git_object **)&head_commit, head, GIT_OBJECT_COMMIT)) < 0 ||
|
1021
1061
|
(error = git_repository_index(&index, rebase->repo)) < 0 ||
|
1022
1062
|
(error = rebase_commit__create(&commit, rebase, index, head_commit,
|
1023
1063
|
author, committer, message_encoding, message)) < 0 ||
|
@@ -1151,7 +1191,7 @@ static int notes_ref_lookup(git_buf *out, git_rebase *rebase)
|
|
1151
1191
|
if (error != GIT_ENOTFOUND)
|
1152
1192
|
goto done;
|
1153
1193
|
|
1154
|
-
|
1194
|
+
git_error_clear();
|
1155
1195
|
do_rewrite = 1;
|
1156
1196
|
}
|
1157
1197
|
|
@@ -1178,7 +1218,7 @@ static int rebase_copy_note(
|
|
1178
1218
|
|
1179
1219
|
if ((error = git_note_read(¬e, rebase->repo, notes_ref, from)) < 0) {
|
1180
1220
|
if (error == GIT_ENOTFOUND) {
|
1181
|
-
|
1221
|
+
git_error_clear();
|
1182
1222
|
error = 0;
|
1183
1223
|
}
|
1184
1224
|
|
@@ -1191,7 +1231,7 @@ static int rebase_copy_note(
|
|
1191
1231
|
(error = git_signature_now(&who, "unknown", "unknown")) < 0)
|
1192
1232
|
goto done;
|
1193
1233
|
|
1194
|
-
|
1234
|
+
git_error_clear();
|
1195
1235
|
}
|
1196
1236
|
|
1197
1237
|
committer = who;
|
@@ -1219,7 +1259,7 @@ static int rebase_copy_notes(
|
|
1219
1259
|
|
1220
1260
|
if ((error = notes_ref_lookup(¬es_ref, rebase)) < 0) {
|
1221
1261
|
if (error == GIT_ENOTFOUND) {
|
1222
|
-
|
1262
|
+
git_error_clear();
|
1223
1263
|
error = 0;
|
1224
1264
|
}
|
1225
1265
|
|
@@ -1262,13 +1302,13 @@ static int rebase_copy_notes(
|
|
1262
1302
|
goto done;
|
1263
1303
|
|
1264
1304
|
on_error:
|
1265
|
-
|
1305
|
+
git_error_set(GIT_ERROR_REBASE, "invalid rewritten file at line %d", linenum);
|
1266
1306
|
error = -1;
|
1267
1307
|
|
1268
1308
|
done:
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1309
|
+
git_buf_dispose(&rewritten);
|
1310
|
+
git_buf_dispose(&path);
|
1311
|
+
git_buf_dispose(¬es_ref);
|
1272
1312
|
|
1273
1313
|
return error;
|
1274
1314
|
}
|
@@ -1291,7 +1331,7 @@ static int return_to_orig_head(git_rebase *rebase)
|
|
1291
1331
|
rebase->orig_head_name)) == 0 &&
|
1292
1332
|
(error = git_repository_head(&terminal_ref, rebase->repo)) == 0 &&
|
1293
1333
|
(error = git_reference_peel((git_object **)&terminal_commit,
|
1294
|
-
terminal_ref,
|
1334
|
+
terminal_ref, GIT_OBJECT_COMMIT)) == 0 &&
|
1295
1335
|
(error = git_reference_create_matching(&branch_ref,
|
1296
1336
|
rebase->repo, rebase->orig_head_name,
|
1297
1337
|
git_commit_id(terminal_commit), 1,
|
@@ -1300,8 +1340,8 @@ static int return_to_orig_head(git_rebase *rebase)
|
|
1300
1340
|
rebase->repo, GIT_HEAD_FILE, rebase->orig_head_name, 1,
|
1301
1341
|
head_msg.ptr);
|
1302
1342
|
|
1303
|
-
|
1304
|
-
|
1343
|
+
git_buf_dispose(&head_msg);
|
1344
|
+
git_buf_dispose(&branch_msg);
|
1305
1345
|
git_commit_free(terminal_commit);
|
1306
1346
|
git_reference_free(head_ref);
|
1307
1347
|
git_reference_free(branch_ref);
|
@@ -1330,6 +1370,22 @@ int git_rebase_finish(
|
|
1330
1370
|
return error;
|
1331
1371
|
}
|
1332
1372
|
|
1373
|
+
const char *git_rebase_orig_head_name(git_rebase *rebase) {
|
1374
|
+
return rebase->orig_head_name;
|
1375
|
+
}
|
1376
|
+
|
1377
|
+
const git_oid *git_rebase_orig_head_id(git_rebase *rebase) {
|
1378
|
+
return &rebase->orig_head_id;
|
1379
|
+
}
|
1380
|
+
|
1381
|
+
const char *git_rebase_onto_name(git_rebase *rebase) {
|
1382
|
+
return rebase->onto_name;
|
1383
|
+
}
|
1384
|
+
|
1385
|
+
const git_oid *git_rebase_onto_id(git_rebase *rebase) {
|
1386
|
+
return &rebase->onto_id;
|
1387
|
+
}
|
1388
|
+
|
1333
1389
|
size_t git_rebase_operation_entrycount(git_rebase *rebase)
|
1334
1390
|
{
|
1335
1391
|
assert(rebase);
|