rugged 0.27.7 → 0.27.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/AUTHORS +1 -0
- data/vendor/libgit2/CMakeLists.txt +99 -51
- data/vendor/libgit2/COPYING +28 -0
- data/vendor/libgit2/cmake/Modules/AddCFlagIfSupported.cmake +15 -1
- data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in +29 -0
- data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake +96 -0
- data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +9 -8
- data/vendor/libgit2/cmake/Modules/FindCoreFoundation.cmake +2 -2
- data/vendor/libgit2/cmake/Modules/FindGSSAPI.cmake +1 -1
- data/vendor/libgit2/cmake/Modules/FindGSSFramework.cmake +28 -0
- data/vendor/libgit2/cmake/Modules/FindIconv.cmake +11 -6
- data/vendor/libgit2/cmake/Modules/FindPCRE.cmake +38 -0
- data/vendor/libgit2/cmake/Modules/FindPCRE2.cmake +37 -0
- data/vendor/libgit2/cmake/Modules/FindSecurity.cmake +2 -2
- data/vendor/libgit2/cmake/Modules/FindStatNsec.cmake +6 -0
- data/vendor/libgit2/cmake/Modules/PkgBuildConfig.cmake +110 -0
- data/vendor/libgit2/cmake/Modules/SelectGSSAPI.cmake +53 -0
- data/vendor/libgit2/cmake/Modules/SelectHTTPSBackend.cmake +124 -0
- data/vendor/libgit2/cmake/Modules/SelectHashes.cmake +66 -0
- data/vendor/libgit2/deps/http-parser/http_parser.c +11 -6
- data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +21 -0
- data/vendor/libgit2/deps/ntlmclient/compat.h +33 -0
- data/vendor/libgit2/deps/ntlmclient/crypt.h +64 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +120 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +18 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +145 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +18 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +130 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +21 -0
- data/vendor/libgit2/deps/ntlmclient/ntlm.c +1420 -0
- data/vendor/libgit2/deps/ntlmclient/ntlm.h +174 -0
- data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +320 -0
- data/vendor/libgit2/deps/ntlmclient/unicode.h +36 -0
- data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +445 -0
- data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +201 -0
- data/vendor/libgit2/deps/ntlmclient/utf8.h +1257 -0
- data/vendor/libgit2/deps/ntlmclient/util.c +21 -0
- data/vendor/libgit2/deps/ntlmclient/util.h +14 -0
- data/vendor/libgit2/deps/pcre/CMakeLists.txt +140 -0
- data/vendor/libgit2/deps/pcre/COPYING +5 -0
- data/vendor/libgit2/deps/pcre/cmake/COPYING-CMAKE-SCRIPTS +22 -0
- data/vendor/libgit2/deps/pcre/cmake/FindEditline.cmake +17 -0
- data/vendor/libgit2/deps/pcre/cmake/FindPackageHandleStandardArgs.cmake +58 -0
- data/vendor/libgit2/deps/pcre/cmake/FindReadline.cmake +29 -0
- data/vendor/libgit2/deps/pcre/config.h.in +57 -0
- data/vendor/libgit2/deps/pcre/pcre.h +641 -0
- data/vendor/libgit2/deps/pcre/pcre_byte_order.c +319 -0
- data/vendor/libgit2/deps/pcre/pcre_chartables.c +198 -0
- data/vendor/libgit2/deps/pcre/pcre_compile.c +9800 -0
- data/vendor/libgit2/deps/pcre/pcre_config.c +190 -0
- data/vendor/libgit2/deps/pcre/pcre_dfa_exec.c +3676 -0
- data/vendor/libgit2/deps/pcre/pcre_exec.c +7173 -0
- data/vendor/libgit2/deps/pcre/pcre_fullinfo.c +245 -0
- data/vendor/libgit2/deps/pcre/pcre_get.c +669 -0
- data/vendor/libgit2/deps/pcre/pcre_globals.c +86 -0
- data/vendor/libgit2/deps/pcre/pcre_internal.h +2787 -0
- data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +11913 -0
- data/vendor/libgit2/deps/pcre/pcre_maketables.c +156 -0
- data/vendor/libgit2/deps/pcre/pcre_newline.c +210 -0
- data/vendor/libgit2/deps/pcre/pcre_ord2utf8.c +94 -0
- data/vendor/libgit2/deps/pcre/pcre_printint.c +834 -0
- data/vendor/libgit2/deps/pcre/pcre_refcount.c +92 -0
- data/vendor/libgit2/deps/pcre/pcre_string_utils.c +211 -0
- data/vendor/libgit2/deps/pcre/pcre_study.c +1686 -0
- data/vendor/libgit2/deps/pcre/pcre_tables.c +727 -0
- data/vendor/libgit2/deps/pcre/pcre_ucd.c +3644 -0
- data/vendor/libgit2/deps/pcre/pcre_valid_utf8.c +301 -0
- data/vendor/libgit2/deps/pcre/pcre_version.c +98 -0
- data/vendor/libgit2/deps/pcre/pcre_xclass.c +268 -0
- data/vendor/libgit2/deps/pcre/pcreposix.c +421 -0
- data/vendor/libgit2/deps/pcre/pcreposix.h +117 -0
- data/vendor/libgit2/deps/pcre/ucp.h +224 -0
- data/vendor/libgit2/deps/winhttp/COPYING.GPL +993 -0
- data/vendor/libgit2/deps/winhttp/COPYING.LGPL +502 -0
- data/vendor/libgit2/deps/zlib/CMakeLists.txt +1 -0
- data/vendor/libgit2/deps/zlib/COPYING +27 -0
- data/vendor/libgit2/deps/zlib/adler32.c +0 -7
- data/vendor/libgit2/deps/zlib/crc32.c +0 -7
- data/vendor/libgit2/include/git2/annotated_commit.h +9 -0
- data/vendor/libgit2/include/git2/apply.h +149 -0
- data/vendor/libgit2/include/git2/attr.h +20 -13
- data/vendor/libgit2/include/git2/blame.h +4 -4
- data/vendor/libgit2/include/git2/blob.h +44 -12
- data/vendor/libgit2/include/git2/buffer.h +20 -26
- data/vendor/libgit2/include/git2/cert.h +135 -0
- data/vendor/libgit2/include/git2/checkout.h +53 -21
- data/vendor/libgit2/include/git2/cherrypick.h +3 -3
- data/vendor/libgit2/include/git2/clone.h +5 -5
- data/vendor/libgit2/include/git2/commit.h +25 -3
- data/vendor/libgit2/include/git2/common.h +35 -10
- data/vendor/libgit2/include/git2/config.h +29 -19
- data/vendor/libgit2/include/git2/cred.h +308 -0
- data/vendor/libgit2/include/git2/deprecated.h +493 -0
- data/vendor/libgit2/include/git2/describe.h +4 -4
- data/vendor/libgit2/include/git2/diff.h +177 -135
- data/vendor/libgit2/include/git2/errors.h +53 -46
- data/vendor/libgit2/include/git2/filter.h +8 -0
- data/vendor/libgit2/include/git2/index.h +74 -52
- data/vendor/libgit2/include/git2/indexer.h +76 -6
- data/vendor/libgit2/include/git2/merge.h +25 -10
- data/vendor/libgit2/include/git2/net.h +0 -5
- data/vendor/libgit2/include/git2/notes.h +1 -1
- data/vendor/libgit2/include/git2/object.h +17 -29
- data/vendor/libgit2/include/git2/odb.h +12 -11
- data/vendor/libgit2/include/git2/odb_backend.h +10 -9
- data/vendor/libgit2/include/git2/oid.h +2 -2
- data/vendor/libgit2/include/git2/pack.h +14 -3
- data/vendor/libgit2/include/git2/proxy.h +5 -3
- data/vendor/libgit2/include/git2/rebase.h +46 -2
- data/vendor/libgit2/include/git2/refs.h +34 -16
- data/vendor/libgit2/include/git2/remote.h +111 -14
- data/vendor/libgit2/include/git2/repository.h +69 -34
- data/vendor/libgit2/include/git2/revert.h +1 -1
- data/vendor/libgit2/include/git2/revwalk.h +7 -7
- data/vendor/libgit2/include/git2/signature.h +2 -2
- data/vendor/libgit2/include/git2/stash.h +5 -5
- data/vendor/libgit2/include/git2/status.h +26 -17
- data/vendor/libgit2/include/git2/submodule.h +23 -6
- data/vendor/libgit2/include/git2/sys/alloc.h +18 -18
- data/vendor/libgit2/include/git2/sys/commit.h +1 -1
- data/vendor/libgit2/include/git2/sys/config.h +13 -13
- data/vendor/libgit2/include/git2/sys/cred.h +90 -0
- data/vendor/libgit2/include/git2/sys/filter.h +6 -6
- data/vendor/libgit2/include/git2/sys/merge.h +3 -3
- data/vendor/libgit2/include/git2/sys/odb_backend.h +66 -22
- data/vendor/libgit2/include/git2/sys/path.h +14 -5
- data/vendor/libgit2/include/git2/sys/refdb_backend.h +76 -40
- data/vendor/libgit2/include/git2/sys/repository.h +5 -1
- data/vendor/libgit2/include/git2/sys/stream.h +92 -12
- data/vendor/libgit2/include/git2/sys/transport.h +129 -83
- data/vendor/libgit2/include/git2/tag.h +13 -4
- data/vendor/libgit2/include/git2/trace.h +2 -2
- data/vendor/libgit2/include/git2/transport.h +11 -311
- data/vendor/libgit2/include/git2/tree.h +4 -4
- data/vendor/libgit2/include/git2/types.h +25 -106
- data/vendor/libgit2/include/git2/version.h +3 -3
- data/vendor/libgit2/include/git2/worktree.h +5 -5
- data/vendor/libgit2/include/git2.h +4 -0
- data/vendor/libgit2/src/CMakeLists.txt +104 -235
- data/vendor/libgit2/src/alloc.c +14 -18
- data/vendor/libgit2/src/{stdalloc.c → allocators/stdalloc.c} +7 -8
- data/vendor/libgit2/src/{stdalloc.h → allocators/stdalloc.h} +4 -4
- data/vendor/libgit2/src/allocators/win32_crtdbg.c +118 -0
- data/vendor/libgit2/src/{transports/cred.h → allocators/win32_crtdbg.h} +5 -4
- data/vendor/libgit2/src/annotated_commit.c +18 -11
- data/vendor/libgit2/src/apply.c +535 -28
- data/vendor/libgit2/src/apply.h +3 -1
- data/vendor/libgit2/src/array.h +2 -2
- data/vendor/libgit2/src/attr.c +77 -71
- data/vendor/libgit2/src/attr_file.c +203 -117
- data/vendor/libgit2/src/attr_file.h +9 -9
- data/vendor/libgit2/src/attrcache.c +49 -51
- data/vendor/libgit2/src/attrcache.h +2 -1
- data/vendor/libgit2/src/blame.c +38 -18
- data/vendor/libgit2/src/blame.h +1 -1
- data/vendor/libgit2/src/blame_git.c +29 -15
- data/vendor/libgit2/src/blob.c +123 -37
- data/vendor/libgit2/src/blob.h +19 -2
- data/vendor/libgit2/src/branch.c +47 -23
- data/vendor/libgit2/src/buf_text.c +7 -6
- data/vendor/libgit2/src/buffer.c +60 -53
- data/vendor/libgit2/src/cache.c +38 -45
- data/vendor/libgit2/src/cache.h +3 -3
- data/vendor/libgit2/src/cc-compat.h +20 -3
- data/vendor/libgit2/src/checkout.c +77 -67
- data/vendor/libgit2/src/cherrypick.c +12 -6
- data/vendor/libgit2/src/clone.c +36 -14
- data/vendor/libgit2/src/clone.h +4 -0
- data/vendor/libgit2/src/commit.c +103 -48
- data/vendor/libgit2/src/commit.h +7 -0
- data/vendor/libgit2/src/commit_list.c +36 -78
- data/vendor/libgit2/src/commit_list.h +2 -2
- data/vendor/libgit2/src/common.h +24 -90
- data/vendor/libgit2/src/config.c +203 -176
- data/vendor/libgit2/src/config.h +8 -20
- data/vendor/libgit2/src/config_backend.h +96 -0
- data/vendor/libgit2/src/config_cache.c +41 -35
- data/vendor/libgit2/src/config_entries.c +229 -0
- data/vendor/libgit2/src/config_entries.h +24 -0
- data/vendor/libgit2/src/config_file.c +422 -680
- data/vendor/libgit2/src/config_mem.c +220 -0
- data/vendor/libgit2/src/config_parse.c +96 -68
- data/vendor/libgit2/src/config_parse.h +15 -14
- data/vendor/libgit2/src/config_snapshot.c +206 -0
- data/vendor/libgit2/src/crlf.c +219 -196
- data/vendor/libgit2/src/delta.c +25 -18
- data/vendor/libgit2/src/describe.c +42 -41
- data/vendor/libgit2/src/diff.c +52 -67
- data/vendor/libgit2/src/diff.h +2 -1
- data/vendor/libgit2/src/diff_driver.c +44 -46
- data/vendor/libgit2/src/diff_file.c +16 -14
- data/vendor/libgit2/src/diff_file.h +1 -1
- data/vendor/libgit2/src/diff_generate.c +158 -103
- data/vendor/libgit2/src/diff_generate.h +3 -3
- data/vendor/libgit2/src/diff_parse.c +4 -4
- data/vendor/libgit2/src/diff_print.c +34 -22
- data/vendor/libgit2/src/diff_stats.c +22 -7
- data/vendor/libgit2/src/diff_tform.c +18 -16
- data/vendor/libgit2/src/diff_xdiff.c +3 -3
- data/vendor/libgit2/src/errors.c +51 -39
- data/vendor/libgit2/src/errors.h +81 -0
- data/vendor/libgit2/src/features.h.in +9 -3
- data/vendor/libgit2/src/fetch.c +8 -3
- data/vendor/libgit2/src/fetchhead.c +12 -12
- data/vendor/libgit2/src/filebuf.c +28 -32
- data/vendor/libgit2/src/filebuf.h +2 -2
- data/vendor/libgit2/src/filter.c +47 -33
- data/vendor/libgit2/src/filter.h +0 -10
- data/vendor/libgit2/src/{fileops.c → futils.c} +70 -63
- data/vendor/libgit2/src/{fileops.h → futils.h} +6 -6
- data/vendor/libgit2/src/global.c +35 -55
- data/vendor/libgit2/src/global.h +0 -2
- data/vendor/libgit2/src/hash/sha1/collisiondetect.c +48 -0
- data/vendor/libgit2/src/hash/sha1/collisiondetect.h +19 -0
- data/vendor/libgit2/src/hash/{hash_common_crypto.h → sha1/common_crypto.c} +17 -17
- data/vendor/libgit2/src/hash/sha1/common_crypto.h +19 -0
- data/vendor/libgit2/src/hash/{hash_generic.c → sha1/generic.c} +22 -10
- data/vendor/libgit2/src/hash/{hash_generic.h → sha1/generic.h} +4 -10
- data/vendor/libgit2/src/hash/{hash_mbedtls.c → sha1/mbedtls.c} +15 -7
- data/vendor/libgit2/src/hash/{hash_mbedtls.h → sha1/mbedtls.h} +6 -7
- data/vendor/libgit2/src/hash/sha1/openssl.c +59 -0
- data/vendor/libgit2/src/hash/sha1/openssl.h +19 -0
- data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.c +14 -3
- data/vendor/libgit2/src/hash/{hash_win32.c → sha1/win32.c} +47 -37
- data/vendor/libgit2/src/hash/{hash_win32.h → sha1/win32.h} +6 -19
- data/vendor/libgit2/src/hash/sha1.h +38 -0
- data/vendor/libgit2/src/hash.c +61 -0
- data/vendor/libgit2/src/hash.h +20 -21
- data/vendor/libgit2/src/hashsig.c +5 -5
- data/vendor/libgit2/src/idxmap.c +107 -61
- data/vendor/libgit2/src/idxmap.h +153 -31
- data/vendor/libgit2/src/ignore.c +38 -42
- data/vendor/libgit2/src/index.c +264 -199
- data/vendor/libgit2/src/index.h +7 -1
- data/vendor/libgit2/src/indexer.c +338 -167
- data/vendor/libgit2/src/integer.h +71 -26
- data/vendor/libgit2/src/iterator.c +134 -62
- data/vendor/libgit2/src/iterator.h +15 -0
- data/vendor/libgit2/src/mailmap.c +8 -8
- data/vendor/libgit2/src/map.h +1 -1
- data/vendor/libgit2/src/merge.c +137 -93
- data/vendor/libgit2/src/merge_driver.c +11 -11
- data/vendor/libgit2/src/merge_file.c +2 -2
- data/vendor/libgit2/src/mwindow.c +24 -29
- data/vendor/libgit2/src/mwindow.h +4 -4
- data/vendor/libgit2/src/net.c +184 -0
- data/vendor/libgit2/src/net.h +36 -0
- data/vendor/libgit2/src/netops.c +55 -156
- data/vendor/libgit2/src/netops.h +3 -23
- data/vendor/libgit2/src/notes.c +14 -9
- data/vendor/libgit2/src/object.c +120 -69
- data/vendor/libgit2/src/object.h +22 -9
- data/vendor/libgit2/src/object_api.c +8 -8
- data/vendor/libgit2/src/odb.c +111 -88
- data/vendor/libgit2/src/odb.h +8 -7
- data/vendor/libgit2/src/odb_loose.c +58 -47
- data/vendor/libgit2/src/odb_mempack.c +21 -34
- data/vendor/libgit2/src/odb_pack.c +17 -13
- data/vendor/libgit2/src/offmap.c +53 -35
- data/vendor/libgit2/src/offmap.h +108 -21
- data/vendor/libgit2/src/oid.c +12 -7
- data/vendor/libgit2/src/oidmap.c +49 -47
- data/vendor/libgit2/src/oidmap.h +101 -24
- data/vendor/libgit2/src/pack-objects.c +87 -86
- data/vendor/libgit2/src/pack-objects.h +2 -8
- data/vendor/libgit2/src/pack.c +94 -96
- data/vendor/libgit2/src/pack.h +16 -18
- data/vendor/libgit2/src/parse.c +17 -4
- data/vendor/libgit2/src/parse.h +3 -3
- data/vendor/libgit2/src/patch.c +3 -3
- data/vendor/libgit2/src/patch_generate.c +18 -18
- data/vendor/libgit2/src/patch_parse.c +147 -79
- data/vendor/libgit2/src/path.c +207 -62
- data/vendor/libgit2/src/path.h +14 -0
- data/vendor/libgit2/src/pathspec.c +18 -18
- data/vendor/libgit2/src/pool.c +26 -22
- data/vendor/libgit2/src/pool.h +7 -7
- data/vendor/libgit2/src/posix.c +10 -10
- data/vendor/libgit2/src/posix.h +12 -1
- data/vendor/libgit2/src/proxy.c +8 -3
- data/vendor/libgit2/src/push.c +35 -29
- data/vendor/libgit2/src/push.h +2 -1
- data/vendor/libgit2/src/reader.c +265 -0
- data/vendor/libgit2/src/reader.h +107 -0
- data/vendor/libgit2/src/rebase.c +97 -38
- data/vendor/libgit2/src/refdb.c +15 -3
- data/vendor/libgit2/src/refdb_fs.c +318 -222
- data/vendor/libgit2/src/reflog.c +13 -15
- data/vendor/libgit2/src/refs.c +122 -89
- data/vendor/libgit2/src/refs.h +5 -3
- data/vendor/libgit2/src/refspec.c +27 -33
- data/vendor/libgit2/src/regexp.c +221 -0
- data/vendor/libgit2/src/regexp.h +97 -0
- data/vendor/libgit2/src/remote.c +229 -178
- data/vendor/libgit2/src/remote.h +11 -2
- data/vendor/libgit2/src/repository.c +227 -172
- data/vendor/libgit2/src/repository.h +52 -40
- data/vendor/libgit2/src/reset.c +7 -7
- data/vendor/libgit2/src/revert.c +11 -6
- data/vendor/libgit2/src/revparse.c +46 -46
- data/vendor/libgit2/src/revwalk.c +89 -54
- data/vendor/libgit2/src/revwalk.h +20 -0
- data/vendor/libgit2/src/settings.c +22 -9
- data/vendor/libgit2/src/signature.c +15 -13
- data/vendor/libgit2/src/sortedcache.c +22 -36
- data/vendor/libgit2/src/sortedcache.h +1 -1
- data/vendor/libgit2/src/stash.c +56 -76
- data/vendor/libgit2/src/status.c +27 -21
- data/vendor/libgit2/src/stream.h +17 -2
- data/vendor/libgit2/src/streams/mbedtls.c +100 -80
- data/vendor/libgit2/src/streams/mbedtls.h +5 -2
- data/vendor/libgit2/src/streams/openssl.c +93 -81
- data/vendor/libgit2/src/streams/openssl.h +5 -2
- data/vendor/libgit2/src/streams/registry.c +118 -0
- data/vendor/libgit2/src/streams/registry.h +19 -0
- data/vendor/libgit2/src/streams/socket.c +55 -30
- data/vendor/libgit2/src/streams/stransport.c +57 -32
- data/vendor/libgit2/src/streams/stransport.h +5 -0
- data/vendor/libgit2/src/streams/tls.c +48 -20
- data/vendor/libgit2/src/streams/tls.h +12 -4
- data/vendor/libgit2/src/strmap.c +47 -74
- data/vendor/libgit2/src/strmap.h +108 -33
- data/vendor/libgit2/src/submodule.c +190 -169
- data/vendor/libgit2/src/submodule.h +1 -1
- data/vendor/libgit2/src/sysdir.c +25 -15
- data/vendor/libgit2/src/tag.c +39 -26
- data/vendor/libgit2/src/tag.h +2 -1
- data/vendor/libgit2/src/trace.c +2 -2
- data/vendor/libgit2/src/trace.h +2 -2
- data/vendor/libgit2/src/trailer.c +46 -32
- data/vendor/libgit2/src/transaction.c +30 -29
- data/vendor/libgit2/src/transport.c +3 -3
- data/vendor/libgit2/src/transports/auth.c +14 -10
- data/vendor/libgit2/src/transports/auth.h +10 -3
- data/vendor/libgit2/src/transports/auth_negotiate.c +31 -16
- data/vendor/libgit2/src/transports/auth_negotiate.h +2 -2
- data/vendor/libgit2/src/transports/auth_ntlm.c +223 -0
- data/vendor/libgit2/src/transports/auth_ntlm.h +35 -0
- data/vendor/libgit2/src/transports/cred.c +24 -24
- data/vendor/libgit2/src/transports/git.c +25 -30
- data/vendor/libgit2/src/transports/http.c +871 -335
- data/vendor/libgit2/src/transports/http.h +2 -0
- data/vendor/libgit2/src/transports/local.c +28 -28
- data/vendor/libgit2/src/transports/smart.c +64 -46
- data/vendor/libgit2/src/transports/smart.h +5 -6
- data/vendor/libgit2/src/transports/smart_pkt.c +162 -151
- data/vendor/libgit2/src/transports/smart_protocol.c +64 -94
- data/vendor/libgit2/src/transports/ssh.c +76 -65
- data/vendor/libgit2/src/transports/winhttp.c +328 -319
- data/vendor/libgit2/src/tree-cache.c +21 -14
- data/vendor/libgit2/src/tree.c +119 -112
- data/vendor/libgit2/src/tree.h +1 -0
- data/vendor/libgit2/src/unix/map.c +3 -3
- data/vendor/libgit2/src/unix/posix.h +1 -11
- data/vendor/libgit2/src/userdiff.h +3 -1
- data/vendor/libgit2/src/util.c +154 -93
- data/vendor/libgit2/src/util.h +19 -23
- data/vendor/libgit2/src/vector.c +15 -10
- data/vendor/libgit2/src/wildmatch.c +320 -0
- data/vendor/libgit2/src/wildmatch.h +23 -0
- data/vendor/libgit2/src/win32/dir.c +3 -3
- data/vendor/libgit2/src/win32/findfile.c +1 -1
- data/vendor/libgit2/src/win32/map.c +9 -11
- data/vendor/libgit2/src/win32/msvc-compat.h +6 -0
- data/vendor/libgit2/src/win32/path_w32.c +113 -9
- data/vendor/libgit2/src/win32/path_w32.h +18 -29
- data/vendor/libgit2/src/win32/posix.h +1 -4
- data/vendor/libgit2/src/win32/posix_w32.c +69 -44
- data/vendor/libgit2/src/win32/precompiled.h +0 -2
- data/vendor/libgit2/src/win32/thread.c +5 -10
- data/vendor/libgit2/src/win32/w32_buffer.c +9 -5
- data/vendor/libgit2/src/win32/w32_common.h +39 -0
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +2 -95
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +0 -2
- data/vendor/libgit2/src/win32/w32_stack.c +6 -11
- data/vendor/libgit2/src/win32/w32_stack.h +3 -3
- data/vendor/libgit2/src/win32/w32_util.c +27 -64
- data/vendor/libgit2/src/win32/w32_util.h +5 -49
- data/vendor/libgit2/src/worktree.c +44 -30
- data/vendor/libgit2/src/xdiff/xdiffi.c +5 -5
- data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
- data/vendor/libgit2/src/xdiff/xmerge.c +27 -15
- data/vendor/libgit2/src/xdiff/xpatience.c +3 -0
- data/vendor/libgit2/src/zstream.c +4 -4
- metadata +115 -38
- data/vendor/libgit2/deps/regex/CMakeLists.txt +0 -2
- data/vendor/libgit2/deps/regex/config.h +0 -7
- data/vendor/libgit2/deps/regex/regcomp.c +0 -3857
- data/vendor/libgit2/deps/regex/regex.c +0 -92
- data/vendor/libgit2/deps/regex/regex.h +0 -582
- data/vendor/libgit2/deps/regex/regex_internal.c +0 -1744
- data/vendor/libgit2/deps/regex/regex_internal.h +0 -819
- data/vendor/libgit2/deps/regex/regexec.c +0 -4369
- data/vendor/libgit2/include/git2/inttypes.h +0 -309
- data/vendor/libgit2/include/git2/sys/time.h +0 -31
- data/vendor/libgit2/libgit2.pc.in +0 -13
- data/vendor/libgit2/src/config_file.h +0 -73
- data/vendor/libgit2/src/fnmatch.c +0 -248
- data/vendor/libgit2/src/fnmatch.h +0 -48
- data/vendor/libgit2/src/hash/hash_collisiondetect.h +0 -47
- data/vendor/libgit2/src/hash/hash_openssl.h +0 -59
- data/vendor/libgit2/src/streams/curl.c +0 -385
- data/vendor/libgit2/src/streams/curl.h +0 -17
- /data/vendor/libgit2/deps/http-parser/{LICENSE-MIT → COPYING} +0 -0
- /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/sha1.h +0 -0
- /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.c +0 -0
- /data/vendor/libgit2/src/hash/{sha1dc → sha1/sha1dc}/ubc_check.h +0 -0
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
#include "checkout.h"
|
|
9
9
|
|
|
10
|
-
#include <assert.h>
|
|
11
|
-
|
|
12
10
|
#include "git2/repository.h"
|
|
13
11
|
#include "git2/refs.h"
|
|
14
12
|
#include "git2/tree.h"
|
|
@@ -146,7 +144,7 @@ static int checkout_notify(
|
|
|
146
144
|
int error = data->opts.notify_cb(
|
|
147
145
|
why, path, baseline, target, workdir, data->opts.notify_payload);
|
|
148
146
|
|
|
149
|
-
return
|
|
147
|
+
return git_error_set_after_callback_function(
|
|
150
148
|
error, "git_checkout notification");
|
|
151
149
|
}
|
|
152
150
|
}
|
|
@@ -193,7 +191,7 @@ static bool checkout_is_workdir_modified(
|
|
|
193
191
|
bool rval = false;
|
|
194
192
|
|
|
195
193
|
if (git_submodule_lookup(&sm, data->repo, wditem->path) < 0) {
|
|
196
|
-
|
|
194
|
+
git_error_clear();
|
|
197
195
|
return true;
|
|
198
196
|
}
|
|
199
197
|
|
|
@@ -354,7 +352,7 @@ static bool wd_item_is_removable(
|
|
|
354
352
|
static int checkout_queue_remove(checkout_data *data, const char *path)
|
|
355
353
|
{
|
|
356
354
|
char *copy = git_pool_strdup(&data->pool, path);
|
|
357
|
-
|
|
355
|
+
GIT_ERROR_CHECK_ALLOC(copy);
|
|
358
356
|
return git_vector_insert(&data->removes, copy);
|
|
359
357
|
}
|
|
360
358
|
|
|
@@ -492,7 +490,7 @@ static int checkout_action_with_wd(
|
|
|
492
490
|
switch (delta->status) {
|
|
493
491
|
case GIT_DELTA_UNMODIFIED: /* case 14/15 or 33 */
|
|
494
492
|
if (checkout_is_workdir_modified(data, &delta->old_file, &delta->new_file, wd)) {
|
|
495
|
-
|
|
493
|
+
GIT_ERROR_CHECK_ERROR(
|
|
496
494
|
checkout_notify(data, GIT_CHECKOUT_NOTIFY_DIRTY, delta, wd) );
|
|
497
495
|
*action = CHECKOUT_ACTION_IF(FORCE, UPDATE_BLOB, NONE);
|
|
498
496
|
}
|
|
@@ -561,7 +559,7 @@ static int checkout_action_with_wd_blocker(
|
|
|
561
559
|
switch (delta->status) {
|
|
562
560
|
case GIT_DELTA_UNMODIFIED:
|
|
563
561
|
/* should show delta as dirty / deleted */
|
|
564
|
-
|
|
562
|
+
GIT_ERROR_CHECK_ERROR(
|
|
565
563
|
checkout_notify(data, GIT_CHECKOUT_NOTIFY_DIRTY, delta, wd) );
|
|
566
564
|
*action = CHECKOUT_ACTION_IF(FORCE, REMOVE_AND_UPDATE, NONE);
|
|
567
565
|
break;
|
|
@@ -594,9 +592,9 @@ static int checkout_action_with_wd_dir(
|
|
|
594
592
|
|
|
595
593
|
switch (delta->status) {
|
|
596
594
|
case GIT_DELTA_UNMODIFIED: /* case 19 or 24 (or 34 but not really) */
|
|
597
|
-
|
|
595
|
+
GIT_ERROR_CHECK_ERROR(
|
|
598
596
|
checkout_notify(data, GIT_CHECKOUT_NOTIFY_DIRTY, delta, NULL));
|
|
599
|
-
|
|
597
|
+
GIT_ERROR_CHECK_ERROR(
|
|
600
598
|
checkout_notify(data, GIT_CHECKOUT_NOTIFY_UNTRACKED, NULL, wd));
|
|
601
599
|
*action = CHECKOUT_ACTION_IF(FORCE, REMOVE_AND_UPDATE, NONE);
|
|
602
600
|
break;
|
|
@@ -611,7 +609,7 @@ static int checkout_action_with_wd_dir(
|
|
|
611
609
|
break;
|
|
612
610
|
case GIT_DELTA_DELETED: /* case 11 (and 27 for dir) */
|
|
613
611
|
if (delta->old_file.mode != GIT_FILEMODE_TREE)
|
|
614
|
-
|
|
612
|
+
GIT_ERROR_CHECK_ERROR(
|
|
615
613
|
checkout_notify(data, GIT_CHECKOUT_NOTIFY_UNTRACKED, NULL, wd));
|
|
616
614
|
break;
|
|
617
615
|
case GIT_DELTA_TYPECHANGE: /* case 24 or 31 */
|
|
@@ -902,7 +900,7 @@ static int checkout_conflict_append_update(
|
|
|
902
900
|
int error;
|
|
903
901
|
|
|
904
902
|
conflict = git__calloc(1, sizeof(checkout_conflictdata));
|
|
905
|
-
|
|
903
|
+
GIT_ERROR_CHECK_ALLOC(conflict);
|
|
906
904
|
|
|
907
905
|
conflict->ancestor = ancestor;
|
|
908
906
|
conflict->ours = ours;
|
|
@@ -1044,20 +1042,20 @@ static int checkout_conflicts_load_byname_entry(
|
|
|
1044
1042
|
*theirs_out = NULL;
|
|
1045
1043
|
|
|
1046
1044
|
if (!name_entry->ancestor) {
|
|
1047
|
-
|
|
1045
|
+
git_error_set(GIT_ERROR_INDEX, "a NAME entry exists without an ancestor");
|
|
1048
1046
|
error = -1;
|
|
1049
1047
|
goto done;
|
|
1050
1048
|
}
|
|
1051
1049
|
|
|
1052
1050
|
if (!name_entry->ours && !name_entry->theirs) {
|
|
1053
|
-
|
|
1051
|
+
git_error_set(GIT_ERROR_INDEX, "a NAME entry exists without an ours or theirs");
|
|
1054
1052
|
error = -1;
|
|
1055
1053
|
goto done;
|
|
1056
1054
|
}
|
|
1057
1055
|
|
|
1058
1056
|
if ((ancestor = checkout_conflicts_search_ancestor(data,
|
|
1059
1057
|
name_entry->ancestor)) == NULL) {
|
|
1060
|
-
|
|
1058
|
+
git_error_set(GIT_ERROR_INDEX,
|
|
1061
1059
|
"a NAME entry referenced ancestor entry '%s' which does not exist in the main index",
|
|
1062
1060
|
name_entry->ancestor);
|
|
1063
1061
|
error = -1;
|
|
@@ -1069,7 +1067,7 @@ static int checkout_conflicts_load_byname_entry(
|
|
|
1069
1067
|
ours = ancestor;
|
|
1070
1068
|
else if ((ours = checkout_conflicts_search_branch(data, name_entry->ours)) == NULL ||
|
|
1071
1069
|
ours->ours == NULL) {
|
|
1072
|
-
|
|
1070
|
+
git_error_set(GIT_ERROR_INDEX,
|
|
1073
1071
|
"a NAME entry referenced our entry '%s' which does not exist in the main index",
|
|
1074
1072
|
name_entry->ours);
|
|
1075
1073
|
error = -1;
|
|
@@ -1084,7 +1082,7 @@ static int checkout_conflicts_load_byname_entry(
|
|
|
1084
1082
|
theirs = ours;
|
|
1085
1083
|
else if ((theirs = checkout_conflicts_search_branch(data, name_entry->theirs)) == NULL ||
|
|
1086
1084
|
theirs->theirs == NULL) {
|
|
1087
|
-
|
|
1085
|
+
git_error_set(GIT_ERROR_INDEX,
|
|
1088
1086
|
"a NAME entry referenced their entry '%s' which does not exist in the main index",
|
|
1089
1087
|
name_entry->theirs);
|
|
1090
1088
|
error = -1;
|
|
@@ -1183,7 +1181,7 @@ static int checkout_conflicts_mark_directoryfile(
|
|
|
1183
1181
|
|
|
1184
1182
|
if ((error = git_index_find(&j, index, path)) < 0) {
|
|
1185
1183
|
if (error == GIT_ENOTFOUND)
|
|
1186
|
-
|
|
1184
|
+
git_error_set(GIT_ERROR_INDEX,
|
|
1187
1185
|
"index inconsistency, could not find entry for expected conflict '%s'", path);
|
|
1188
1186
|
|
|
1189
1187
|
goto done;
|
|
@@ -1191,7 +1189,7 @@ static int checkout_conflicts_mark_directoryfile(
|
|
|
1191
1189
|
|
|
1192
1190
|
for (; j < len; j++) {
|
|
1193
1191
|
if ((entry = git_index_get_byindex(index, j)) == NULL) {
|
|
1194
|
-
|
|
1192
|
+
git_error_set(GIT_ERROR_INDEX,
|
|
1195
1193
|
"index inconsistency, truncated index while loading expected conflict '%s'", path);
|
|
1196
1194
|
error = -1;
|
|
1197
1195
|
goto done;
|
|
@@ -1252,7 +1250,7 @@ static int checkout_conflict_append_remove(
|
|
|
1252
1250
|
else
|
|
1253
1251
|
abort();
|
|
1254
1252
|
|
|
1255
|
-
|
|
1253
|
+
GIT_ERROR_CHECK_ALLOC(name);
|
|
1256
1254
|
|
|
1257
1255
|
return git_vector_insert(&data->remove_conflicts, (char *)name);
|
|
1258
1256
|
}
|
|
@@ -1277,14 +1275,14 @@ static int checkout_verify_paths(
|
|
|
1277
1275
|
|
|
1278
1276
|
if (action & CHECKOUT_ACTION__REMOVE) {
|
|
1279
1277
|
if (!git_path_isvalid(repo, delta->old_file.path, delta->old_file.mode, flags)) {
|
|
1280
|
-
|
|
1278
|
+
git_error_set(GIT_ERROR_CHECKOUT, "cannot remove invalid path '%s'", delta->old_file.path);
|
|
1281
1279
|
return -1;
|
|
1282
1280
|
}
|
|
1283
1281
|
}
|
|
1284
1282
|
|
|
1285
1283
|
if (action & ~CHECKOUT_ACTION__REMOVE) {
|
|
1286
1284
|
if (!git_path_isvalid(repo, delta->new_file.path, delta->new_file.mode, flags)) {
|
|
1287
|
-
|
|
1285
|
+
git_error_set(GIT_ERROR_CHECKOUT, "cannot checkout to invalid path '%s'", delta->new_file.path);
|
|
1288
1286
|
return -1;
|
|
1289
1287
|
}
|
|
1290
1288
|
}
|
|
@@ -1354,7 +1352,7 @@ static int checkout_get_actions(
|
|
|
1354
1352
|
if (counts[CHECKOUT_ACTION__CONFLICT] > 0 &&
|
|
1355
1353
|
(data->strategy & GIT_CHECKOUT_ALLOW_CONFLICTS) == 0)
|
|
1356
1354
|
{
|
|
1357
|
-
|
|
1355
|
+
git_error_set(GIT_ERROR_CHECKOUT, "%"PRIuZ" %s checkout",
|
|
1358
1356
|
counts[CHECKOUT_ACTION__CONFLICT],
|
|
1359
1357
|
counts[CHECKOUT_ACTION__CONFLICT] == 1 ?
|
|
1360
1358
|
"conflict prevents" : "conflicts prevent");
|
|
@@ -1391,7 +1389,7 @@ static bool should_remove_existing(checkout_data *data)
|
|
|
1391
1389
|
{
|
|
1392
1390
|
int ignorecase;
|
|
1393
1391
|
|
|
1394
|
-
if (
|
|
1392
|
+
if (git_repository__configmap_lookup(&ignorecase, data->repo, GIT_CONFIGMAP_IGNORECASE) < 0) {
|
|
1395
1393
|
ignorecase = 0;
|
|
1396
1394
|
}
|
|
1397
1395
|
|
|
@@ -1453,10 +1451,10 @@ static int mkpath2file(
|
|
|
1453
1451
|
*/
|
|
1454
1452
|
error = git_futils_rmdir_r(path, NULL, GIT_RMDIR_REMOVE_FILES);
|
|
1455
1453
|
} else if (errno != ENOENT) {
|
|
1456
|
-
|
|
1454
|
+
git_error_set(GIT_ERROR_OS, "failed to stat '%s'", path);
|
|
1457
1455
|
return GIT_EEXISTS;
|
|
1458
1456
|
} else {
|
|
1459
|
-
|
|
1457
|
+
git_error_clear();
|
|
1460
1458
|
}
|
|
1461
1459
|
}
|
|
1462
1460
|
|
|
@@ -1477,7 +1475,7 @@ static int checkout_stream_write(
|
|
|
1477
1475
|
int ret;
|
|
1478
1476
|
|
|
1479
1477
|
if ((ret = p_write(stream->fd, buffer, len)) < 0)
|
|
1480
|
-
|
|
1478
|
+
git_error_set(GIT_ERROR_OS, "could not write to '%s'", stream->path);
|
|
1481
1479
|
|
|
1482
1480
|
return ret;
|
|
1483
1481
|
}
|
|
@@ -1526,7 +1524,7 @@ static int blob_content_to_file(
|
|
|
1526
1524
|
mode = GIT_FILEMODE_BLOB;
|
|
1527
1525
|
|
|
1528
1526
|
if ((fd = p_open(path, flags, mode)) < 0) {
|
|
1529
|
-
|
|
1527
|
+
git_error_set(GIT_ERROR_OS, "could not open '%s' for writing", path);
|
|
1530
1528
|
return fd;
|
|
1531
1529
|
}
|
|
1532
1530
|
|
|
@@ -1563,7 +1561,7 @@ static int blob_content_to_file(
|
|
|
1563
1561
|
data->perfdata.stat_calls++;
|
|
1564
1562
|
|
|
1565
1563
|
if ((error = p_stat(path, st)) < 0) {
|
|
1566
|
-
|
|
1564
|
+
git_error_set(GIT_ERROR_OS, "failed to stat '%s'", path);
|
|
1567
1565
|
return error;
|
|
1568
1566
|
}
|
|
1569
1567
|
|
|
@@ -1590,7 +1588,7 @@ static int blob_content_to_link(
|
|
|
1590
1588
|
|
|
1591
1589
|
if (data->can_symlink) {
|
|
1592
1590
|
if ((error = p_symlink(git_buf_cstr(&linktarget), path)) < 0)
|
|
1593
|
-
|
|
1591
|
+
git_error_set(GIT_ERROR_OS, "could not create symlink %s", path);
|
|
1594
1592
|
} else {
|
|
1595
1593
|
error = git_futils_fake_symlink(git_buf_cstr(&linktarget), path);
|
|
1596
1594
|
}
|
|
@@ -1599,7 +1597,7 @@ static int blob_content_to_link(
|
|
|
1599
1597
|
data->perfdata.stat_calls++;
|
|
1600
1598
|
|
|
1601
1599
|
if ((error = p_lstat(path, st)) < 0)
|
|
1602
|
-
|
|
1600
|
+
git_error_set(GIT_ERROR_CHECKOUT, "could not stat symlink %s", path);
|
|
1603
1601
|
|
|
1604
1602
|
st->st_mode = GIT_FILEMODE_LINK;
|
|
1605
1603
|
}
|
|
@@ -1643,8 +1641,8 @@ static int checkout_submodule_update_index(
|
|
|
1643
1641
|
|
|
1644
1642
|
data->perfdata.stat_calls++;
|
|
1645
1643
|
if (p_stat(fullpath->ptr, &st) < 0) {
|
|
1646
|
-
|
|
1647
|
-
|
|
1644
|
+
git_error_set(
|
|
1645
|
+
GIT_ERROR_CHECKOUT, "could not stat submodule %s\n", file->path);
|
|
1648
1646
|
return GIT_ENOTFOUND;
|
|
1649
1647
|
}
|
|
1650
1648
|
|
|
@@ -1675,7 +1673,7 @@ static int checkout_submodule(
|
|
|
1675
1673
|
* have a .gitmodules - core Git just makes an empty directory
|
|
1676
1674
|
*/
|
|
1677
1675
|
if (error == GIT_ENOTFOUND) {
|
|
1678
|
-
|
|
1676
|
+
git_error_clear();
|
|
1679
1677
|
return checkout_submodule_update_index(data, file);
|
|
1680
1678
|
}
|
|
1681
1679
|
|
|
@@ -1717,7 +1715,7 @@ static int checkout_safe_for_update_only(
|
|
|
1717
1715
|
return 0;
|
|
1718
1716
|
|
|
1719
1717
|
/* otherwise, stat error and no update */
|
|
1720
|
-
|
|
1718
|
+
git_error_set(GIT_ERROR_OS, "failed to stat '%s'", path);
|
|
1721
1719
|
return -1;
|
|
1722
1720
|
}
|
|
1723
1721
|
|
|
@@ -1756,7 +1754,7 @@ static int checkout_write_content(
|
|
|
1756
1754
|
if ((data->strategy & GIT_CHECKOUT_ALLOW_CONFLICTS) != 0 &&
|
|
1757
1755
|
(error == GIT_ENOTFOUND || error == GIT_EEXISTS))
|
|
1758
1756
|
{
|
|
1759
|
-
|
|
1757
|
+
git_error_clear();
|
|
1760
1758
|
error = 0;
|
|
1761
1759
|
}
|
|
1762
1760
|
|
|
@@ -1863,7 +1861,7 @@ static int checkout_deferred_remove(git_repository *repo, const char *path)
|
|
|
1863
1861
|
|
|
1864
1862
|
if (error == GIT_ENOTFOUND) {
|
|
1865
1863
|
error = 0;
|
|
1866
|
-
|
|
1864
|
+
git_error_clear();
|
|
1867
1865
|
}
|
|
1868
1866
|
|
|
1869
1867
|
return error;
|
|
@@ -1893,11 +1891,18 @@ static int checkout_create_the_new(
|
|
|
1893
1891
|
return error;
|
|
1894
1892
|
}
|
|
1895
1893
|
|
|
1896
|
-
if (actions[i] & CHECKOUT_ACTION__UPDATE_BLOB) {
|
|
1897
|
-
error = checkout_blob(data, &delta->new_file)
|
|
1898
|
-
if (error < 0)
|
|
1894
|
+
if (actions[i] & CHECKOUT_ACTION__UPDATE_BLOB && !S_ISLNK(delta->new_file.mode)) {
|
|
1895
|
+
if ((error = checkout_blob(data, &delta->new_file)) < 0)
|
|
1899
1896
|
return error;
|
|
1897
|
+
data->completed_steps++;
|
|
1898
|
+
report_progress(data, delta->new_file.path);
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1900
1901
|
|
|
1902
|
+
git_vector_foreach(&data->diff->deltas, i, delta) {
|
|
1903
|
+
if (actions[i] & CHECKOUT_ACTION__UPDATE_BLOB && S_ISLNK(delta->new_file.mode)) {
|
|
1904
|
+
if ((error = checkout_blob(data, &delta->new_file)) < 0)
|
|
1905
|
+
return error;
|
|
1901
1906
|
data->completed_steps++;
|
|
1902
1907
|
report_progress(data, delta->new_file.path);
|
|
1903
1908
|
}
|
|
@@ -1944,7 +1949,7 @@ static int checkout_lookup_head_tree(git_tree **out, git_repository *repo)
|
|
|
1944
1949
|
git_object *head;
|
|
1945
1950
|
|
|
1946
1951
|
if (!(error = git_repository_head(&ref, repo)) &&
|
|
1947
|
-
!(error = git_reference_peel(&head, ref,
|
|
1952
|
+
!(error = git_reference_peel(&head, ref, GIT_OBJECT_TREE)))
|
|
1948
1953
|
*out = (git_tree *)head;
|
|
1949
1954
|
|
|
1950
1955
|
git_reference_free(ref);
|
|
@@ -1989,7 +1994,7 @@ static int checkout_path_suffixed(git_buf *path, const char *suffix)
|
|
|
1989
1994
|
if (i == INT_MAX) {
|
|
1990
1995
|
git_buf_truncate(path, path_len);
|
|
1991
1996
|
|
|
1992
|
-
|
|
1997
|
+
git_error_set(GIT_ERROR_CHECKOUT, "could not write '%s': working directory file exists", path->ptr);
|
|
1993
1998
|
return GIT_EEXISTS;
|
|
1994
1999
|
}
|
|
1995
2000
|
|
|
@@ -2123,7 +2128,7 @@ static int checkout_write_merge(
|
|
|
2123
2128
|
goto done;
|
|
2124
2129
|
|
|
2125
2130
|
if (result.path == NULL || result.mode == 0) {
|
|
2126
|
-
|
|
2131
|
+
git_error_set(GIT_ERROR_CHECKOUT, "could not merge contents of file");
|
|
2127
2132
|
error = GIT_ECONFLICT;
|
|
2128
2133
|
goto done;
|
|
2129
2134
|
}
|
|
@@ -2179,7 +2184,7 @@ static int checkout_conflict_add(
|
|
|
2179
2184
|
int error = git_index_remove(data->index, conflict->path, 0);
|
|
2180
2185
|
|
|
2181
2186
|
if (error == GIT_ENOTFOUND)
|
|
2182
|
-
|
|
2187
|
+
git_error_clear();
|
|
2183
2188
|
else if (error < 0)
|
|
2184
2189
|
return error;
|
|
2185
2190
|
|
|
@@ -2370,7 +2375,7 @@ static int checkout_data_init(
|
|
|
2370
2375
|
memset(data, 0, sizeof(*data));
|
|
2371
2376
|
|
|
2372
2377
|
if (!repo) {
|
|
2373
|
-
|
|
2378
|
+
git_error_set(GIT_ERROR_CHECKOUT, "cannot checkout nothing");
|
|
2374
2379
|
return -1;
|
|
2375
2380
|
}
|
|
2376
2381
|
|
|
@@ -2381,7 +2386,7 @@ static int checkout_data_init(
|
|
|
2381
2386
|
data->repo = repo;
|
|
2382
2387
|
data->target = target;
|
|
2383
2388
|
|
|
2384
|
-
|
|
2389
|
+
GIT_ERROR_CHECK_VERSION(
|
|
2385
2390
|
proposed, GIT_CHECKOUT_OPTIONS_VERSION, "git_checkout_options");
|
|
2386
2391
|
|
|
2387
2392
|
if (!proposed)
|
|
@@ -2424,7 +2429,7 @@ static int checkout_data_init(
|
|
|
2424
2429
|
*/
|
|
2425
2430
|
if (git_index_has_conflicts(data->index)) {
|
|
2426
2431
|
error = GIT_ECONFLICT;
|
|
2427
|
-
|
|
2432
|
+
git_error_set(GIT_ERROR_CHECKOUT,
|
|
2428
2433
|
"unresolved conflicts exist in the index");
|
|
2429
2434
|
goto cleanup;
|
|
2430
2435
|
}
|
|
@@ -2463,12 +2468,12 @@ static int checkout_data_init(
|
|
|
2463
2468
|
|
|
2464
2469
|
data->pfx = git_pathspec_prefix(&data->opts.paths);
|
|
2465
2470
|
|
|
2466
|
-
if ((error =
|
|
2467
|
-
&data->can_symlink, repo,
|
|
2471
|
+
if ((error = git_repository__configmap_lookup(
|
|
2472
|
+
&data->can_symlink, repo, GIT_CONFIGMAP_SYMLINKS)) < 0)
|
|
2468
2473
|
goto cleanup;
|
|
2469
2474
|
|
|
2470
|
-
if ((error =
|
|
2471
|
-
&data->respect_filemode, repo,
|
|
2475
|
+
if ((error = git_repository__configmap_lookup(
|
|
2476
|
+
&data->respect_filemode, repo, GIT_CONFIGMAP_FILEMODE)) < 0)
|
|
2472
2477
|
goto cleanup;
|
|
2473
2478
|
|
|
2474
2479
|
if (!data->opts.baseline && !data->opts.baseline_index) {
|
|
@@ -2483,7 +2488,7 @@ static int checkout_data_init(
|
|
|
2483
2488
|
|
|
2484
2489
|
if (error == GIT_EUNBORNBRANCH) {
|
|
2485
2490
|
error = 0;
|
|
2486
|
-
|
|
2491
|
+
git_error_clear();
|
|
2487
2492
|
}
|
|
2488
2493
|
|
|
2489
2494
|
if (error < 0)
|
|
@@ -2506,7 +2511,7 @@ static int checkout_data_init(
|
|
|
2506
2511
|
else if (strcmp(conflict_style->value, "diff3") == 0)
|
|
2507
2512
|
data->opts.checkout_strategy |= GIT_CHECKOUT_CONFLICT_STYLE_DIFF3;
|
|
2508
2513
|
else {
|
|
2509
|
-
|
|
2514
|
+
git_error_set(GIT_ERROR_CHECKOUT, "unknown style '%s' given for 'merge.conflictstyle'",
|
|
2510
2515
|
conflict_style->value);
|
|
2511
2516
|
error = -1;
|
|
2512
2517
|
git_config_entry_free(conflict_style);
|
|
@@ -2518,11 +2523,11 @@ static int checkout_data_init(
|
|
|
2518
2523
|
git_pool_init(&data->pool, 1);
|
|
2519
2524
|
|
|
2520
2525
|
if ((error = git_vector_init(&data->removes, 0, git__strcmp_cb)) < 0 ||
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
+
(error = git_vector_init(&data->remove_conflicts, 0, NULL)) < 0 ||
|
|
2527
|
+
(error = git_vector_init(&data->update_conflicts, 0, NULL)) < 0 ||
|
|
2528
|
+
(error = git_buf_puts(&data->target_path, data->opts.target_directory)) < 0 ||
|
|
2529
|
+
(error = git_path_to_dir(&data->target_path)) < 0 ||
|
|
2530
|
+
(error = git_strmap_new(&data->mkdir_map)) < 0)
|
|
2526
2531
|
goto cleanup;
|
|
2527
2532
|
|
|
2528
2533
|
data->target_len = git_buf_len(&data->target_path);
|
|
@@ -2688,7 +2693,7 @@ int git_checkout_index(
|
|
|
2688
2693
|
git_iterator *index_i;
|
|
2689
2694
|
|
|
2690
2695
|
if (!index && !repo) {
|
|
2691
|
-
|
|
2696
|
+
git_error_set(GIT_ERROR_CHECKOUT,
|
|
2692
2697
|
"must provide either repository or index to checkout");
|
|
2693
2698
|
return -1;
|
|
2694
2699
|
}
|
|
@@ -2696,7 +2701,7 @@ int git_checkout_index(
|
|
|
2696
2701
|
if (index && repo &&
|
|
2697
2702
|
git_index_owner(index) &&
|
|
2698
2703
|
git_index_owner(index) != repo) {
|
|
2699
|
-
|
|
2704
|
+
git_error_set(GIT_ERROR_CHECKOUT,
|
|
2700
2705
|
"index to checkout does not match repository");
|
|
2701
2706
|
return -1;
|
|
2702
2707
|
} else if(index && repo && !git_index_owner(index)) {
|
|
@@ -2735,12 +2740,12 @@ int git_checkout_tree(
|
|
|
2735
2740
|
git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT;
|
|
2736
2741
|
|
|
2737
2742
|
if (!treeish && !repo) {
|
|
2738
|
-
|
|
2743
|
+
git_error_set(GIT_ERROR_CHECKOUT,
|
|
2739
2744
|
"must provide either repository or tree to checkout");
|
|
2740
2745
|
return -1;
|
|
2741
2746
|
}
|
|
2742
2747
|
if (treeish && repo && git_object_owner(treeish) != repo) {
|
|
2743
|
-
|
|
2748
|
+
git_error_set(GIT_ERROR_CHECKOUT,
|
|
2744
2749
|
"object to checkout does not match repository");
|
|
2745
2750
|
return -1;
|
|
2746
2751
|
}
|
|
@@ -2749,17 +2754,17 @@ int git_checkout_tree(
|
|
|
2749
2754
|
repo = git_object_owner(treeish);
|
|
2750
2755
|
|
|
2751
2756
|
if (treeish) {
|
|
2752
|
-
if (git_object_peel((git_object **)&tree, treeish,
|
|
2753
|
-
|
|
2754
|
-
|
|
2757
|
+
if (git_object_peel((git_object **)&tree, treeish, GIT_OBJECT_TREE) < 0) {
|
|
2758
|
+
git_error_set(
|
|
2759
|
+
GIT_ERROR_CHECKOUT, "provided object cannot be peeled to a tree");
|
|
2755
2760
|
return -1;
|
|
2756
2761
|
}
|
|
2757
2762
|
}
|
|
2758
2763
|
else {
|
|
2759
2764
|
if ((error = checkout_lookup_head_tree(&tree, repo)) < 0) {
|
|
2760
2765
|
if (error != GIT_EUNBORNBRANCH)
|
|
2761
|
-
|
|
2762
|
-
|
|
2766
|
+
git_error_set(
|
|
2767
|
+
GIT_ERROR_CHECKOUT,
|
|
2763
2768
|
"HEAD could not be peeled to a tree and no treeish given");
|
|
2764
2769
|
return error;
|
|
2765
2770
|
}
|
|
@@ -2791,9 +2796,14 @@ int git_checkout_head(
|
|
|
2791
2796
|
return git_checkout_tree(repo, NULL, opts);
|
|
2792
2797
|
}
|
|
2793
2798
|
|
|
2794
|
-
int
|
|
2799
|
+
int git_checkout_options_init(git_checkout_options *opts, unsigned int version)
|
|
2795
2800
|
{
|
|
2796
2801
|
GIT_INIT_STRUCTURE_FROM_TEMPLATE(
|
|
2797
2802
|
opts, version, git_checkout_options, GIT_CHECKOUT_OPTIONS_INIT);
|
|
2798
2803
|
return 0;
|
|
2799
2804
|
}
|
|
2805
|
+
|
|
2806
|
+
int git_checkout_init_options(git_checkout_options *opts, unsigned int version)
|
|
2807
|
+
{
|
|
2808
|
+
return git_checkout_options_init(opts, version);
|
|
2809
|
+
}
|
|
@@ -30,7 +30,7 @@ static int write_cherrypick_head(
|
|
|
30
30
|
int error = 0;
|
|
31
31
|
|
|
32
32
|
if ((error = git_buf_joinpath(&file_path, repo->gitdir, GIT_CHERRYPICK_HEAD_FILE)) >= 0 &&
|
|
33
|
-
(error = git_filebuf_open(&file, file_path.ptr,
|
|
33
|
+
(error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_CREATE_LEADING_DIRS, GIT_CHERRYPICK_FILE_MODE)) >= 0 &&
|
|
34
34
|
(error = git_filebuf_printf(&file, "%s\n", commit_oidstr)) >= 0)
|
|
35
35
|
error = git_filebuf_commit(&file);
|
|
36
36
|
|
|
@@ -51,7 +51,7 @@ static int write_merge_msg(
|
|
|
51
51
|
int error = 0;
|
|
52
52
|
|
|
53
53
|
if ((error = git_buf_joinpath(&file_path, repo->gitdir, GIT_MERGE_MSG_FILE)) < 0 ||
|
|
54
|
-
(error = git_filebuf_open(&file, file_path.ptr,
|
|
54
|
+
(error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_CREATE_LEADING_DIRS, GIT_CHERRYPICK_FILE_MODE)) < 0 ||
|
|
55
55
|
(error = git_filebuf_printf(&file, "%s", commit_msg)) < 0)
|
|
56
56
|
goto cleanup;
|
|
57
57
|
|
|
@@ -108,7 +108,7 @@ static int cherrypick_seterr(git_commit *commit, const char *fmt)
|
|
|
108
108
|
{
|
|
109
109
|
char commit_oidstr[GIT_OID_HEXSZ + 1];
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
git_error_set(GIT_ERROR_CHERRYPICK, fmt,
|
|
112
112
|
git_oid_tostr(commit_oidstr, GIT_OID_HEXSZ + 1, git_commit_id(commit)));
|
|
113
113
|
|
|
114
114
|
return -1;
|
|
@@ -179,7 +179,7 @@ int git_cherrypick(
|
|
|
179
179
|
|
|
180
180
|
assert(repo && commit);
|
|
181
181
|
|
|
182
|
-
|
|
182
|
+
GIT_ERROR_CHECK_VERSION(given_opts, GIT_CHERRYPICK_OPTIONS_VERSION, "git_cherrypick_options");
|
|
183
183
|
|
|
184
184
|
if ((error = git_repository__ensure_not_bare(repo, "cherry-pick")) < 0)
|
|
185
185
|
return error;
|
|
@@ -198,7 +198,7 @@ int git_cherrypick(
|
|
|
198
198
|
(error = git_indexwriter_init_for_operation(&indexwriter, repo, &opts.checkout_opts.checkout_strategy)) < 0 ||
|
|
199
199
|
(error = write_cherrypick_head(repo, commit_oidstr)) < 0 ||
|
|
200
200
|
(error = git_repository_head(&our_ref, repo)) < 0 ||
|
|
201
|
-
(error = git_reference_peel((git_object **)&our_commit, our_ref,
|
|
201
|
+
(error = git_reference_peel((git_object **)&our_commit, our_ref, GIT_OBJECT_COMMIT)) < 0 ||
|
|
202
202
|
(error = git_cherrypick_commit(&index, repo, commit, our_commit, opts.mainline, &opts.merge_opts)) < 0 ||
|
|
203
203
|
(error = git_merge__check_result(repo, index)) < 0 ||
|
|
204
204
|
(error = git_merge__append_conflicts_to_merge_msg(repo, index)) < 0 ||
|
|
@@ -221,10 +221,16 @@ done:
|
|
|
221
221
|
return error;
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
int
|
|
224
|
+
int git_cherrypick_options_init(
|
|
225
225
|
git_cherrypick_options *opts, unsigned int version)
|
|
226
226
|
{
|
|
227
227
|
GIT_INIT_STRUCTURE_FROM_TEMPLATE(
|
|
228
228
|
opts, version, git_cherrypick_options, GIT_CHERRYPICK_OPTIONS_INIT);
|
|
229
229
|
return 0;
|
|
230
230
|
}
|
|
231
|
+
|
|
232
|
+
int git_cherrypick_init_options(
|
|
233
|
+
git_cherrypick_options *opts, unsigned int version)
|
|
234
|
+
{
|
|
235
|
+
return git_cherrypick_options_init(opts, version);
|
|
236
|
+
}
|
data/vendor/libgit2/src/clone.c
CHANGED
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
#include "clone.h"
|
|
9
9
|
|
|
10
|
-
#include <assert.h>
|
|
11
|
-
|
|
12
10
|
#include "git2/clone.h"
|
|
13
11
|
#include "git2/remote.h"
|
|
14
12
|
#include "git2/revparse.h"
|
|
@@ -19,7 +17,7 @@
|
|
|
19
17
|
#include "git2/tree.h"
|
|
20
18
|
|
|
21
19
|
#include "remote.h"
|
|
22
|
-
#include "
|
|
20
|
+
#include "futils.h"
|
|
23
21
|
#include "refs.h"
|
|
24
22
|
#include "path.h"
|
|
25
23
|
#include "repository.h"
|
|
@@ -176,7 +174,7 @@ static int update_head_to_remote(
|
|
|
176
174
|
refspec = git_remote__matching_refspec(remote, git_buf_cstr(&branch));
|
|
177
175
|
|
|
178
176
|
if (refspec == NULL) {
|
|
179
|
-
|
|
177
|
+
git_error_set(GIT_ERROR_NET, "the remote's default branch does not fit the refspec configuration");
|
|
180
178
|
error = GIT_EINVALIDSPEC;
|
|
181
179
|
goto cleanup;
|
|
182
180
|
}
|
|
@@ -332,7 +330,7 @@ static int clone_into(git_repository *repo, git_remote *_remote, const git_fetch
|
|
|
332
330
|
assert(repo && _remote);
|
|
333
331
|
|
|
334
332
|
if (!git_repository_is_empty(repo)) {
|
|
335
|
-
|
|
333
|
+
git_error_set(GIT_ERROR_INVALID, "the repository is not empty");
|
|
336
334
|
return -1;
|
|
337
335
|
}
|
|
338
336
|
|
|
@@ -382,11 +380,12 @@ done:
|
|
|
382
380
|
return is_local;
|
|
383
381
|
}
|
|
384
382
|
|
|
385
|
-
int
|
|
383
|
+
static int git__clone(
|
|
386
384
|
git_repository **out,
|
|
387
385
|
const char *url,
|
|
388
386
|
const char *local_path,
|
|
389
|
-
const git_clone_options *_options
|
|
387
|
+
const git_clone_options *_options,
|
|
388
|
+
int use_existing)
|
|
390
389
|
{
|
|
391
390
|
int error = 0;
|
|
392
391
|
git_repository *repo = NULL;
|
|
@@ -400,11 +399,11 @@ int git_clone(
|
|
|
400
399
|
if (_options)
|
|
401
400
|
memcpy(&options, _options, sizeof(git_clone_options));
|
|
402
401
|
|
|
403
|
-
|
|
402
|
+
GIT_ERROR_CHECK_VERSION(&options, GIT_CLONE_OPTIONS_VERSION, "git_clone_options");
|
|
404
403
|
|
|
405
404
|
/* Only clone to a new directory or an empty directory */
|
|
406
|
-
if (git_path_exists(local_path) && !git_path_is_empty_dir(local_path)) {
|
|
407
|
-
|
|
405
|
+
if (git_path_exists(local_path) && !use_existing && !git_path_is_empty_dir(local_path)) {
|
|
406
|
+
git_error_set(GIT_ERROR_INVALID,
|
|
408
407
|
"'%s' exists and is not an empty directory", local_path);
|
|
409
408
|
return GIT_EEXISTS;
|
|
410
409
|
}
|
|
@@ -441,27 +440,50 @@ int git_clone(
|
|
|
441
440
|
|
|
442
441
|
if (error != 0) {
|
|
443
442
|
git_error_state last_error = {0};
|
|
444
|
-
|
|
443
|
+
git_error_state_capture(&last_error, error);
|
|
445
444
|
|
|
446
445
|
git_repository_free(repo);
|
|
447
446
|
repo = NULL;
|
|
448
447
|
|
|
449
448
|
(void)git_futils_rmdir_r(local_path, NULL, rmdir_flags);
|
|
450
449
|
|
|
451
|
-
|
|
450
|
+
git_error_state_restore(&last_error);
|
|
452
451
|
}
|
|
453
452
|
|
|
454
453
|
*out = repo;
|
|
455
454
|
return error;
|
|
456
455
|
}
|
|
457
456
|
|
|
458
|
-
int
|
|
457
|
+
int git_clone(
|
|
458
|
+
git_repository **out,
|
|
459
|
+
const char *url,
|
|
460
|
+
const char *local_path,
|
|
461
|
+
const git_clone_options *_options)
|
|
462
|
+
{
|
|
463
|
+
return git__clone(out, url, local_path, _options, 0);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
int git_clone__submodule(
|
|
467
|
+
git_repository **out,
|
|
468
|
+
const char *url,
|
|
469
|
+
const char *local_path,
|
|
470
|
+
const git_clone_options *_options)
|
|
471
|
+
{
|
|
472
|
+
return git__clone(out, url, local_path, _options, 1);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
int git_clone_options_init(git_clone_options *opts, unsigned int version)
|
|
459
476
|
{
|
|
460
477
|
GIT_INIT_STRUCTURE_FROM_TEMPLATE(
|
|
461
478
|
opts, version, git_clone_options, GIT_CLONE_OPTIONS_INIT);
|
|
462
479
|
return 0;
|
|
463
480
|
}
|
|
464
481
|
|
|
482
|
+
int git_clone_init_options(git_clone_options *opts, unsigned int version)
|
|
483
|
+
{
|
|
484
|
+
return git_clone_options_init(opts, version);
|
|
485
|
+
}
|
|
486
|
+
|
|
465
487
|
static bool can_link(const char *src, const char *dst, int link)
|
|
466
488
|
{
|
|
467
489
|
#ifdef GIT_WIN32
|
|
@@ -496,7 +518,7 @@ static int clone_local_into(git_repository *repo, git_remote *remote, const git_
|
|
|
496
518
|
assert(repo && remote);
|
|
497
519
|
|
|
498
520
|
if (!git_repository_is_empty(repo)) {
|
|
499
|
-
|
|
521
|
+
git_error_set(GIT_ERROR_INVALID, "the repository is not empty");
|
|
500
522
|
return -1;
|
|
501
523
|
}
|
|
502
524
|
|
data/vendor/libgit2/src/clone.h
CHANGED
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
|
|
12
12
|
#include "git2/clone.h"
|
|
13
13
|
|
|
14
|
+
extern int git_clone__submodule(git_repository **out,
|
|
15
|
+
const char *url, const char *local_path,
|
|
16
|
+
const git_clone_options *_options);
|
|
17
|
+
|
|
14
18
|
extern int git_clone__should_clone_local(const char *url, git_clone_local_t local);
|
|
15
19
|
|
|
16
20
|
#endif
|