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
data/vendor/libgit2/src/remote.c
CHANGED
|
@@ -35,7 +35,7 @@ static int add_refspec_to(git_vector *vector, const char *string, bool is_fetch)
|
|
|
35
35
|
git_refspec *spec;
|
|
36
36
|
|
|
37
37
|
spec = git__calloc(1, sizeof(git_refspec));
|
|
38
|
-
|
|
38
|
+
GIT_ERROR_CHECK_ALLOC(spec);
|
|
39
39
|
|
|
40
40
|
if (git_refspec__parse(spec, string, is_fetch) < 0) {
|
|
41
41
|
git__free(spec);
|
|
@@ -85,8 +85,8 @@ static int ensure_remote_name_is_valid(const char *name)
|
|
|
85
85
|
int error = 0;
|
|
86
86
|
|
|
87
87
|
if (!git_remote_is_valid_name(name)) {
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
git_error_set(
|
|
89
|
+
GIT_ERROR_CONFIG,
|
|
90
90
|
"'%s' is not a valid remote name.", name ? name : "(null)");
|
|
91
91
|
error = GIT_EINVALIDSPEC;
|
|
92
92
|
}
|
|
@@ -111,7 +111,7 @@ static int write_add_refspec(git_repository *repo, const char *name, const char
|
|
|
111
111
|
return error;
|
|
112
112
|
|
|
113
113
|
if ((error = git_refspec__parse(&spec, refspec, fetch)) < 0) {
|
|
114
|
-
if (
|
|
114
|
+
if (git_error_last()->klass != GIT_ERROR_NOMEMORY)
|
|
115
115
|
error = GIT_EINVALIDSPEC;
|
|
116
116
|
|
|
117
117
|
return error;
|
|
@@ -136,39 +136,10 @@ cleanup:
|
|
|
136
136
|
return 0;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
#if 0
|
|
140
|
-
/* We could export this as a helper */
|
|
141
|
-
static int get_check_cert(int *out, git_repository *repo)
|
|
142
|
-
{
|
|
143
|
-
git_config *cfg;
|
|
144
|
-
const char *val;
|
|
145
|
-
int error = 0;
|
|
146
|
-
|
|
147
|
-
assert(out && repo);
|
|
148
|
-
|
|
149
|
-
/* By default, we *DO* want to verify the certificate. */
|
|
150
|
-
*out = 1;
|
|
151
|
-
|
|
152
|
-
/* Go through the possible sources for SSL verification settings, from
|
|
153
|
-
* most specific to least specific. */
|
|
154
|
-
|
|
155
|
-
/* GIT_SSL_NO_VERIFY environment variable */
|
|
156
|
-
if ((val = p_getenv("GIT_SSL_NO_VERIFY")) != NULL)
|
|
157
|
-
return git_config_parse_bool(out, val);
|
|
158
|
-
|
|
159
|
-
/* http.sslVerify config setting */
|
|
160
|
-
if ((error = git_repository_config__weakptr(&cfg, repo)) < 0)
|
|
161
|
-
return error;
|
|
162
|
-
|
|
163
|
-
*out = git_config__get_bool_force(cfg, "http.sslverify", 1);
|
|
164
|
-
return 0;
|
|
165
|
-
}
|
|
166
|
-
#endif
|
|
167
|
-
|
|
168
139
|
static int canonicalize_url(git_buf *out, const char *in)
|
|
169
140
|
{
|
|
170
141
|
if (in == NULL || strlen(in) == 0) {
|
|
171
|
-
|
|
142
|
+
git_error_set(GIT_ERROR_INVALID, "cannot set empty URL");
|
|
172
143
|
return GIT_EINVALIDSPEC;
|
|
173
144
|
}
|
|
174
145
|
|
|
@@ -189,58 +160,124 @@ static int canonicalize_url(git_buf *out, const char *in)
|
|
|
189
160
|
return git_buf_puts(out, in);
|
|
190
161
|
}
|
|
191
162
|
|
|
192
|
-
static int
|
|
163
|
+
static int default_fetchspec_for_name(git_buf *buf, const char *name)
|
|
193
164
|
{
|
|
165
|
+
if (git_buf_printf(buf, "+refs/heads/*:refs/remotes/%s/*", name) < 0)
|
|
166
|
+
return -1;
|
|
167
|
+
|
|
168
|
+
return 0;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
static int ensure_remote_doesnot_exist(git_repository *repo, const char *name)
|
|
172
|
+
{
|
|
173
|
+
int error;
|
|
194
174
|
git_remote *remote;
|
|
175
|
+
|
|
176
|
+
error = git_remote_lookup(&remote, repo, name);
|
|
177
|
+
|
|
178
|
+
if (error == GIT_ENOTFOUND)
|
|
179
|
+
return 0;
|
|
180
|
+
|
|
181
|
+
if (error < 0)
|
|
182
|
+
return error;
|
|
183
|
+
|
|
184
|
+
git_remote_free(remote);
|
|
185
|
+
|
|
186
|
+
git_error_set(GIT_ERROR_CONFIG, "remote '%s' already exists", name);
|
|
187
|
+
|
|
188
|
+
return GIT_EEXISTS;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
int git_remote_create_options_init(git_remote_create_options *opts, unsigned int version)
|
|
192
|
+
{
|
|
193
|
+
GIT_INIT_STRUCTURE_FROM_TEMPLATE(
|
|
194
|
+
opts, version, git_remote_create_options, GIT_REMOTE_CREATE_OPTIONS_INIT);
|
|
195
|
+
return 0;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
int git_remote_create_init_options(git_remote_create_options *opts, unsigned int version)
|
|
199
|
+
{
|
|
200
|
+
return git_remote_create_options_init(opts, version);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
int git_remote_create_with_opts(git_remote **out, const char *url, const git_remote_create_options *opts)
|
|
204
|
+
{
|
|
205
|
+
git_remote *remote = NULL;
|
|
195
206
|
git_config *config_ro = NULL, *config_rw;
|
|
196
207
|
git_buf canonical_url = GIT_BUF_INIT;
|
|
197
208
|
git_buf var = GIT_BUF_INIT;
|
|
209
|
+
git_buf specbuf = GIT_BUF_INIT;
|
|
210
|
+
const git_remote_create_options dummy_opts = GIT_REMOTE_CREATE_OPTIONS_INIT;
|
|
198
211
|
int error = -1;
|
|
199
212
|
|
|
200
|
-
/* repo, name, and fetch are optional */
|
|
201
213
|
assert(out && url);
|
|
202
214
|
|
|
203
|
-
if (
|
|
204
|
-
|
|
215
|
+
if (!opts) {
|
|
216
|
+
opts = &dummy_opts;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
GIT_ERROR_CHECK_VERSION(opts, GIT_REMOTE_CREATE_OPTIONS_VERSION, "git_remote_create_options");
|
|
220
|
+
|
|
221
|
+
if (opts->name != NULL) {
|
|
222
|
+
if ((error = ensure_remote_name_is_valid(opts->name)) < 0)
|
|
223
|
+
return error;
|
|
224
|
+
|
|
225
|
+
if (opts->repository &&
|
|
226
|
+
(error = ensure_remote_doesnot_exist(opts->repository, opts->name)) < 0)
|
|
227
|
+
return error;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (opts->repository) {
|
|
231
|
+
if ((error = git_repository_config_snapshot(&config_ro, opts->repository)) < 0)
|
|
232
|
+
goto on_error;
|
|
233
|
+
}
|
|
205
234
|
|
|
206
235
|
remote = git__calloc(1, sizeof(git_remote));
|
|
207
|
-
|
|
236
|
+
GIT_ERROR_CHECK_ALLOC(remote);
|
|
208
237
|
|
|
209
|
-
remote->repo =
|
|
238
|
+
remote->repo = opts->repository;
|
|
210
239
|
|
|
211
|
-
if ((error = git_vector_init(&remote->refs,
|
|
240
|
+
if ((error = git_vector_init(&remote->refs, 8, NULL)) < 0 ||
|
|
212
241
|
(error = canonicalize_url(&canonical_url, url)) < 0)
|
|
213
242
|
goto on_error;
|
|
214
243
|
|
|
215
|
-
if (
|
|
244
|
+
if (opts->repository && !(opts->flags & GIT_REMOTE_CREATE_SKIP_INSTEADOF)) {
|
|
216
245
|
remote->url = apply_insteadof(config_ro, canonical_url.ptr, GIT_DIRECTION_FETCH);
|
|
217
246
|
} else {
|
|
218
247
|
remote->url = git__strdup(canonical_url.ptr);
|
|
219
248
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
if (name != NULL) {
|
|
223
|
-
remote->name = git__strdup(name);
|
|
224
|
-
GITERR_CHECK_ALLOC(remote->name);
|
|
249
|
+
GIT_ERROR_CHECK_ALLOC(remote->url);
|
|
225
250
|
|
|
226
|
-
|
|
227
|
-
|
|
251
|
+
if (opts->name != NULL) {
|
|
252
|
+
remote->name = git__strdup(opts->name);
|
|
253
|
+
GIT_ERROR_CHECK_ALLOC(remote->name);
|
|
228
254
|
|
|
229
|
-
if (
|
|
230
|
-
|
|
231
|
-
|
|
255
|
+
if (opts->repository &&
|
|
256
|
+
((error = git_buf_printf(&var, CONFIG_URL_FMT, opts->name)) < 0 ||
|
|
257
|
+
(error = git_repository_config__weakptr(&config_rw, opts->repository)) < 0 ||
|
|
258
|
+
(error = git_config_set_string(config_rw, var.ptr, canonical_url.ptr)) < 0))
|
|
232
259
|
goto on_error;
|
|
233
260
|
}
|
|
234
261
|
|
|
235
|
-
if (
|
|
236
|
-
|
|
237
|
-
|
|
262
|
+
if (opts->fetchspec != NULL ||
|
|
263
|
+
(opts->name && !(opts->flags & GIT_REMOTE_CREATE_SKIP_DEFAULT_FETCHSPEC))) {
|
|
264
|
+
const char *fetch = NULL;
|
|
265
|
+
if (opts->fetchspec) {
|
|
266
|
+
fetch = opts->fetchspec;
|
|
267
|
+
} else {
|
|
268
|
+
if ((error = default_fetchspec_for_name(&specbuf, opts->name)) < 0)
|
|
269
|
+
goto on_error;
|
|
238
270
|
|
|
239
|
-
|
|
240
|
-
|
|
271
|
+
fetch = git_buf_cstr(&specbuf);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if ((error = add_refspec(remote, fetch, true)) < 0)
|
|
241
275
|
goto on_error;
|
|
242
276
|
|
|
243
|
-
|
|
277
|
+
/* only write for named remotes with a repository */
|
|
278
|
+
if (opts->repository && opts->name &&
|
|
279
|
+
((error = write_add_refspec(opts->repository, opts->name, fetch, true)) < 0 ||
|
|
280
|
+
(error = lookup_remote_prune_config(remote, config_ro, opts->name)) < 0))
|
|
244
281
|
goto on_error;
|
|
245
282
|
|
|
246
283
|
/* Move the data over to where the matching functions can find them */
|
|
@@ -249,7 +286,7 @@ static int create_internal(git_remote **out, git_repository *repo, const char *n
|
|
|
249
286
|
}
|
|
250
287
|
|
|
251
288
|
/* A remote without a name doesn't download tags */
|
|
252
|
-
if (!name)
|
|
289
|
+
if (!opts->name)
|
|
253
290
|
remote->download_tags = GIT_REMOTE_DOWNLOAD_TAGS_NONE;
|
|
254
291
|
else
|
|
255
292
|
remote->download_tags = GIT_REMOTE_DOWNLOAD_TAGS_AUTO;
|
|
@@ -265,43 +302,32 @@ on_error:
|
|
|
265
302
|
git_remote_free(remote);
|
|
266
303
|
|
|
267
304
|
git_config_free(config_ro);
|
|
305
|
+
git_buf_dispose(&specbuf);
|
|
268
306
|
git_buf_dispose(&canonical_url);
|
|
269
307
|
git_buf_dispose(&var);
|
|
270
308
|
return error;
|
|
271
309
|
}
|
|
272
310
|
|
|
273
|
-
|
|
311
|
+
int git_remote_create(git_remote **out, git_repository *repo, const char *name, const char *url)
|
|
274
312
|
{
|
|
313
|
+
git_buf buf = GIT_BUF_INIT;
|
|
275
314
|
int error;
|
|
276
|
-
|
|
315
|
+
git_remote_create_options opts = GIT_REMOTE_CREATE_OPTIONS_INIT;
|
|
277
316
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
if (error == GIT_ENOTFOUND)
|
|
281
|
-
return 0;
|
|
282
|
-
|
|
283
|
-
if (error < 0)
|
|
317
|
+
/* Those 2 tests are duplicated here because of backward-compatibility */
|
|
318
|
+
if ((error = ensure_remote_name_is_valid(name)) < 0)
|
|
284
319
|
return error;
|
|
285
320
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
giterr_set(
|
|
289
|
-
GITERR_CONFIG,
|
|
290
|
-
"remote '%s' already exists", name);
|
|
321
|
+
if (canonicalize_url(&buf, url) < 0)
|
|
322
|
+
return GIT_ERROR;
|
|
291
323
|
|
|
292
|
-
|
|
293
|
-
}
|
|
324
|
+
git_buf_clear(&buf);
|
|
294
325
|
|
|
326
|
+
opts.repository = repo;
|
|
327
|
+
opts.name = name;
|
|
295
328
|
|
|
296
|
-
|
|
297
|
-
{
|
|
298
|
-
git_buf buf = GIT_BUF_INIT;
|
|
299
|
-
int error;
|
|
300
|
-
|
|
301
|
-
if (git_buf_printf(&buf, "+refs/heads/*:refs/remotes/%s/*", name) < 0)
|
|
302
|
-
return -1;
|
|
329
|
+
error = git_remote_create_with_opts(out, url, &opts);
|
|
303
330
|
|
|
304
|
-
error = git_remote_create_with_fetchspec(out, repo, name, url, git_buf_cstr(&buf));
|
|
305
331
|
git_buf_dispose(&buf);
|
|
306
332
|
|
|
307
333
|
return error;
|
|
@@ -309,35 +335,32 @@ int git_remote_create(git_remote **out, git_repository *repo, const char *name,
|
|
|
309
335
|
|
|
310
336
|
int git_remote_create_with_fetchspec(git_remote **out, git_repository *repo, const char *name, const char *url, const char *fetch)
|
|
311
337
|
{
|
|
312
|
-
git_remote *remote = NULL;
|
|
313
338
|
int error;
|
|
339
|
+
git_remote_create_options opts = GIT_REMOTE_CREATE_OPTIONS_INIT;
|
|
314
340
|
|
|
315
341
|
if ((error = ensure_remote_name_is_valid(name)) < 0)
|
|
316
342
|
return error;
|
|
317
343
|
|
|
318
|
-
|
|
319
|
-
|
|
344
|
+
opts.repository = repo;
|
|
345
|
+
opts.name = name;
|
|
346
|
+
opts.fetchspec = fetch;
|
|
347
|
+
opts.flags = GIT_REMOTE_CREATE_SKIP_DEFAULT_FETCHSPEC;
|
|
320
348
|
|
|
321
|
-
|
|
322
|
-
goto on_error;
|
|
323
|
-
|
|
324
|
-
*out = remote;
|
|
325
|
-
|
|
326
|
-
return 0;
|
|
327
|
-
|
|
328
|
-
on_error:
|
|
329
|
-
git_remote_free(remote);
|
|
330
|
-
return -1;
|
|
349
|
+
return git_remote_create_with_opts(out, url, &opts);
|
|
331
350
|
}
|
|
332
351
|
|
|
333
352
|
int git_remote_create_anonymous(git_remote **out, git_repository *repo, const char *url)
|
|
334
353
|
{
|
|
335
|
-
|
|
354
|
+
git_remote_create_options opts = GIT_REMOTE_CREATE_OPTIONS_INIT;
|
|
355
|
+
|
|
356
|
+
opts.repository = repo;
|
|
357
|
+
|
|
358
|
+
return git_remote_create_with_opts(out, url, &opts);
|
|
336
359
|
}
|
|
337
360
|
|
|
338
361
|
int git_remote_create_detached(git_remote **out, const char *url)
|
|
339
362
|
{
|
|
340
|
-
return
|
|
363
|
+
return git_remote_create_with_opts(out, url, NULL);
|
|
341
364
|
}
|
|
342
365
|
|
|
343
366
|
int git_remote_dup(git_remote **dest, git_remote *source)
|
|
@@ -346,21 +369,21 @@ int git_remote_dup(git_remote **dest, git_remote *source)
|
|
|
346
369
|
int error = 0;
|
|
347
370
|
git_refspec *spec;
|
|
348
371
|
git_remote *remote = git__calloc(1, sizeof(git_remote));
|
|
349
|
-
|
|
372
|
+
GIT_ERROR_CHECK_ALLOC(remote);
|
|
350
373
|
|
|
351
374
|
if (source->name != NULL) {
|
|
352
375
|
remote->name = git__strdup(source->name);
|
|
353
|
-
|
|
376
|
+
GIT_ERROR_CHECK_ALLOC(remote->name);
|
|
354
377
|
}
|
|
355
378
|
|
|
356
379
|
if (source->url != NULL) {
|
|
357
380
|
remote->url = git__strdup(source->url);
|
|
358
|
-
|
|
381
|
+
GIT_ERROR_CHECK_ALLOC(remote->url);
|
|
359
382
|
}
|
|
360
383
|
|
|
361
384
|
if (source->pushurl != NULL) {
|
|
362
385
|
remote->pushurl = git__strdup(source->pushurl);
|
|
363
|
-
|
|
386
|
+
GIT_ERROR_CHECK_ALLOC(remote->pushurl);
|
|
364
387
|
}
|
|
365
388
|
|
|
366
389
|
remote->repo = source->repo;
|
|
@@ -419,7 +442,7 @@ static int get_optional_config(
|
|
|
419
442
|
*found = !error;
|
|
420
443
|
|
|
421
444
|
if (error == GIT_ENOTFOUND) {
|
|
422
|
-
|
|
445
|
+
git_error_clear();
|
|
423
446
|
error = 0;
|
|
424
447
|
}
|
|
425
448
|
|
|
@@ -428,7 +451,7 @@ static int get_optional_config(
|
|
|
428
451
|
|
|
429
452
|
int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
|
|
430
453
|
{
|
|
431
|
-
git_remote *remote;
|
|
454
|
+
git_remote *remote = NULL;
|
|
432
455
|
git_buf buf = GIT_BUF_INIT;
|
|
433
456
|
const char *val;
|
|
434
457
|
int error = 0;
|
|
@@ -445,10 +468,10 @@ int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
|
|
|
445
468
|
return error;
|
|
446
469
|
|
|
447
470
|
remote = git__calloc(1, sizeof(git_remote));
|
|
448
|
-
|
|
471
|
+
GIT_ERROR_CHECK_ALLOC(remote);
|
|
449
472
|
|
|
450
473
|
remote->name = git__strdup(name);
|
|
451
|
-
|
|
474
|
+
GIT_ERROR_CHECK_ALLOC(remote->name);
|
|
452
475
|
|
|
453
476
|
if (git_vector_init(&remote->refs, 32, NULL) < 0 ||
|
|
454
477
|
git_vector_init(&remote->refspecs, 2, NULL) < 0 ||
|
|
@@ -471,7 +494,7 @@ int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
|
|
|
471
494
|
|
|
472
495
|
if (found && strlen(val) > 0) {
|
|
473
496
|
remote->url = apply_insteadof(config, val, GIT_DIRECTION_FETCH);
|
|
474
|
-
|
|
497
|
+
GIT_ERROR_CHECK_ALLOC(remote->url);
|
|
475
498
|
}
|
|
476
499
|
|
|
477
500
|
val = NULL;
|
|
@@ -485,13 +508,13 @@ int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
|
|
|
485
508
|
|
|
486
509
|
if (!optional_setting_found) {
|
|
487
510
|
error = GIT_ENOTFOUND;
|
|
488
|
-
|
|
511
|
+
git_error_set(GIT_ERROR_CONFIG, "remote '%s' does not exist", name);
|
|
489
512
|
goto cleanup;
|
|
490
513
|
}
|
|
491
514
|
|
|
492
515
|
if (found && strlen(val) > 0) {
|
|
493
516
|
remote->pushurl = apply_insteadof(config, val, GIT_DIRECTION_PUSH);
|
|
494
|
-
|
|
517
|
+
GIT_ERROR_CHECK_ALLOC(remote->pushurl);
|
|
495
518
|
}
|
|
496
519
|
|
|
497
520
|
data.remote = remote;
|
|
@@ -510,7 +533,7 @@ int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
|
|
|
510
533
|
if ((error = get_optional_config(NULL, config, &buf, refspec_cb, &data)) < 0)
|
|
511
534
|
goto cleanup;
|
|
512
535
|
|
|
513
|
-
if (download_tags_value(remote, config) < 0)
|
|
536
|
+
if ((error = download_tags_value(remote, config)) < 0)
|
|
514
537
|
goto cleanup;
|
|
515
538
|
|
|
516
539
|
if ((error = lookup_remote_prune_config(remote, config, name)) < 0)
|
|
@@ -541,11 +564,11 @@ static int lookup_remote_prune_config(git_remote *remote, git_config *config, co
|
|
|
541
564
|
|
|
542
565
|
if ((error = git_config_get_bool(&remote->prune_refs, config, git_buf_cstr(&buf))) < 0) {
|
|
543
566
|
if (error == GIT_ENOTFOUND) {
|
|
544
|
-
|
|
567
|
+
git_error_clear();
|
|
545
568
|
|
|
546
569
|
if ((error = git_config_get_bool(&remote->prune_refs, config, "fetch.prune")) < 0) {
|
|
547
570
|
if (error == GIT_ENOTFOUND) {
|
|
548
|
-
|
|
571
|
+
git_error_clear();
|
|
549
572
|
error = 0;
|
|
550
573
|
}
|
|
551
574
|
}
|
|
@@ -623,21 +646,44 @@ int git_remote_set_pushurl(git_repository *repo, const char *remote, const char*
|
|
|
623
646
|
return set_url(repo, remote, CONFIG_PUSHURL_FMT, url);
|
|
624
647
|
}
|
|
625
648
|
|
|
626
|
-
|
|
649
|
+
static int resolve_url(git_buf *resolved_url, const char *url, int direction, const git_remote_callbacks *callbacks)
|
|
627
650
|
{
|
|
628
|
-
|
|
651
|
+
int status;
|
|
652
|
+
|
|
653
|
+
if (callbacks && callbacks->resolve_url) {
|
|
654
|
+
git_buf_clear(resolved_url);
|
|
655
|
+
status = callbacks->resolve_url(resolved_url, url, direction, callbacks->payload);
|
|
656
|
+
if (status != GIT_PASSTHROUGH) {
|
|
657
|
+
git_error_set_after_callback_function(status, "git_resolve_url_cb");
|
|
658
|
+
git_buf_sanitize(resolved_url);
|
|
659
|
+
return status;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
return git_buf_sets(resolved_url, url);
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
int git_remote__urlfordirection(git_buf *url_out, struct git_remote *remote, int direction, const git_remote_callbacks *callbacks)
|
|
667
|
+
{
|
|
668
|
+
const char *url = NULL;
|
|
629
669
|
|
|
670
|
+
assert(remote);
|
|
630
671
|
assert(direction == GIT_DIRECTION_FETCH || direction == GIT_DIRECTION_PUSH);
|
|
631
672
|
|
|
632
673
|
if (direction == GIT_DIRECTION_FETCH) {
|
|
633
|
-
|
|
674
|
+
url = remote->url;
|
|
675
|
+
} else if (direction == GIT_DIRECTION_PUSH) {
|
|
676
|
+
url = remote->pushurl ? remote->pushurl : remote->url;
|
|
634
677
|
}
|
|
635
678
|
|
|
636
|
-
if (
|
|
637
|
-
|
|
679
|
+
if (!url) {
|
|
680
|
+
git_error_set(GIT_ERROR_INVALID,
|
|
681
|
+
"malformed remote '%s' - missing %s URL",
|
|
682
|
+
remote->name ? remote->name : "(anonymous)",
|
|
683
|
+
direction == GIT_DIRECTION_FETCH ? "fetch" : "push");
|
|
684
|
+
return GIT_EINVALID;
|
|
638
685
|
}
|
|
639
|
-
|
|
640
|
-
return NULL;
|
|
686
|
+
return resolve_url(url_out, url, direction, callbacks);
|
|
641
687
|
}
|
|
642
688
|
|
|
643
689
|
int set_transport_callbacks(git_transport *t, const git_remote_callbacks *cbs)
|
|
@@ -657,10 +703,10 @@ static int set_transport_custom_headers(git_transport *t, const git_strarray *cu
|
|
|
657
703
|
return t->set_custom_headers(t, custom_headers);
|
|
658
704
|
}
|
|
659
705
|
|
|
660
|
-
int
|
|
706
|
+
int git_remote__connect(git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks, const git_remote_connection_opts *conn)
|
|
661
707
|
{
|
|
662
708
|
git_transport *t;
|
|
663
|
-
|
|
709
|
+
git_buf url = GIT_BUF_INIT;
|
|
664
710
|
int flags = GIT_TRANSPORTFLAGS_NONE;
|
|
665
711
|
int error;
|
|
666
712
|
void *payload = NULL;
|
|
@@ -670,50 +716,49 @@ int git_remote_connect(git_remote *remote, git_direction direction, const git_re
|
|
|
670
716
|
assert(remote);
|
|
671
717
|
|
|
672
718
|
if (callbacks) {
|
|
673
|
-
|
|
719
|
+
GIT_ERROR_CHECK_VERSION(callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks");
|
|
674
720
|
credentials = callbacks->credentials;
|
|
675
721
|
transport = callbacks->transport;
|
|
676
722
|
payload = callbacks->payload;
|
|
677
723
|
}
|
|
678
724
|
|
|
679
|
-
if (proxy)
|
|
680
|
-
|
|
725
|
+
if (conn->proxy)
|
|
726
|
+
GIT_ERROR_CHECK_VERSION(conn->proxy, GIT_PROXY_OPTIONS_VERSION, "git_proxy_options");
|
|
681
727
|
|
|
682
728
|
t = remote->transport;
|
|
683
729
|
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
giterr_set(GITERR_INVALID,
|
|
687
|
-
"Malformed remote '%s' - missing %s URL",
|
|
688
|
-
remote->name ? remote->name : "(anonymous)",
|
|
689
|
-
direction == GIT_DIRECTION_FETCH ? "fetch" : "push");
|
|
690
|
-
return -1;
|
|
691
|
-
}
|
|
730
|
+
if ((error = git_remote__urlfordirection(&url, remote, direction, callbacks)) < 0)
|
|
731
|
+
goto on_error;
|
|
692
732
|
|
|
693
733
|
/* If we don't have a transport object yet, and the caller specified a
|
|
694
734
|
* custom transport factory, use that */
|
|
695
735
|
if (!t && transport &&
|
|
696
736
|
(error = transport(&t, remote, payload)) < 0)
|
|
697
|
-
|
|
737
|
+
goto on_error;
|
|
698
738
|
|
|
699
739
|
/* If we still don't have a transport, then use the global
|
|
700
740
|
* transport registrations which map URI schemes to transport factories */
|
|
701
|
-
if (!t && (error = git_transport_new(&t, remote, url)) < 0)
|
|
702
|
-
|
|
741
|
+
if (!t && (error = git_transport_new(&t, remote, url.ptr)) < 0)
|
|
742
|
+
goto on_error;
|
|
703
743
|
|
|
704
|
-
if ((error = set_transport_custom_headers(t, custom_headers)) != 0)
|
|
744
|
+
if ((error = set_transport_custom_headers(t, conn->custom_headers)) != 0)
|
|
705
745
|
goto on_error;
|
|
706
746
|
|
|
707
747
|
if ((error = set_transport_callbacks(t, callbacks)) < 0 ||
|
|
708
|
-
(error = t->connect(t, url, credentials, payload, proxy, direction, flags)) != 0)
|
|
748
|
+
(error = t->connect(t, url.ptr, credentials, payload, conn->proxy, direction, flags)) != 0)
|
|
709
749
|
goto on_error;
|
|
710
750
|
|
|
711
751
|
remote->transport = t;
|
|
712
752
|
|
|
753
|
+
git_buf_dispose(&url);
|
|
754
|
+
|
|
713
755
|
return 0;
|
|
714
756
|
|
|
715
757
|
on_error:
|
|
716
|
-
|
|
758
|
+
if (t)
|
|
759
|
+
t->free(t);
|
|
760
|
+
|
|
761
|
+
git_buf_dispose(&url);
|
|
717
762
|
|
|
718
763
|
if (t == remote->transport)
|
|
719
764
|
remote->transport = NULL;
|
|
@@ -721,12 +766,22 @@ on_error:
|
|
|
721
766
|
return error;
|
|
722
767
|
}
|
|
723
768
|
|
|
769
|
+
int git_remote_connect(git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks, const git_proxy_options *proxy, const git_strarray *custom_headers)
|
|
770
|
+
{
|
|
771
|
+
git_remote_connection_opts conn;
|
|
772
|
+
|
|
773
|
+
conn.proxy = proxy;
|
|
774
|
+
conn.custom_headers = custom_headers;
|
|
775
|
+
|
|
776
|
+
return git_remote__connect(remote, direction, callbacks, &conn);
|
|
777
|
+
}
|
|
778
|
+
|
|
724
779
|
int git_remote_ls(const git_remote_head ***out, size_t *size, git_remote *remote)
|
|
725
780
|
{
|
|
726
781
|
assert(remote);
|
|
727
782
|
|
|
728
783
|
if (!remote->transport) {
|
|
729
|
-
|
|
784
|
+
git_error_set(GIT_ERROR_NET, "this remote has never connected");
|
|
730
785
|
return -1;
|
|
731
786
|
}
|
|
732
787
|
|
|
@@ -790,7 +845,7 @@ int git_remote__get_http_proxy(git_remote *remote, bool use_ssl, char **proxy_ur
|
|
|
790
845
|
|
|
791
846
|
if (error < 0) {
|
|
792
847
|
if (error == GIT_ENOTFOUND) {
|
|
793
|
-
|
|
848
|
+
git_error_clear();
|
|
794
849
|
error = 0;
|
|
795
850
|
}
|
|
796
851
|
|
|
@@ -800,7 +855,7 @@ int git_remote__get_http_proxy(git_remote *remote, bool use_ssl, char **proxy_ur
|
|
|
800
855
|
*proxy_url = git_buf_detach(&val);
|
|
801
856
|
|
|
802
857
|
found:
|
|
803
|
-
|
|
858
|
+
GIT_ERROR_CHECK_ALLOC(*proxy_url);
|
|
804
859
|
git_config_entry_free(ce);
|
|
805
860
|
|
|
806
861
|
return 0;
|
|
@@ -872,15 +927,15 @@ int git_remote_download(git_remote *remote, const git_strarray *refspecs, const
|
|
|
872
927
|
assert(remote);
|
|
873
928
|
|
|
874
929
|
if (!remote->repo) {
|
|
875
|
-
|
|
930
|
+
git_error_set(GIT_ERROR_INVALID, "cannot download detached remote");
|
|
876
931
|
return -1;
|
|
877
932
|
}
|
|
878
933
|
|
|
879
934
|
if (opts) {
|
|
880
|
-
|
|
935
|
+
GIT_ERROR_CHECK_VERSION(&opts->callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks");
|
|
881
936
|
cbs = &opts->callbacks;
|
|
882
937
|
custom_headers = &opts->custom_headers;
|
|
883
|
-
|
|
938
|
+
GIT_ERROR_CHECK_VERSION(&opts->proxy_opts, GIT_PROXY_OPTIONS_VERSION, "git_proxy_options");
|
|
884
939
|
proxy = &opts->proxy_opts;
|
|
885
940
|
}
|
|
886
941
|
|
|
@@ -949,21 +1004,20 @@ int git_remote_fetch(
|
|
|
949
1004
|
bool prune = false;
|
|
950
1005
|
git_buf reflog_msg_buf = GIT_BUF_INIT;
|
|
951
1006
|
const git_remote_callbacks *cbs = NULL;
|
|
952
|
-
|
|
953
|
-
const git_proxy_options *proxy = NULL;
|
|
1007
|
+
git_remote_connection_opts conn = GIT_REMOTE_CONNECTION_OPTIONS_INIT;
|
|
954
1008
|
|
|
955
1009
|
if (opts) {
|
|
956
|
-
|
|
1010
|
+
GIT_ERROR_CHECK_VERSION(&opts->callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks");
|
|
957
1011
|
cbs = &opts->callbacks;
|
|
958
|
-
custom_headers = &opts->custom_headers;
|
|
1012
|
+
conn.custom_headers = &opts->custom_headers;
|
|
959
1013
|
update_fetchhead = opts->update_fetchhead;
|
|
960
1014
|
tagopt = opts->download_tags;
|
|
961
|
-
|
|
962
|
-
proxy = &opts->proxy_opts;
|
|
1015
|
+
GIT_ERROR_CHECK_VERSION(&opts->proxy_opts, GIT_PROXY_OPTIONS_VERSION, "git_proxy_options");
|
|
1016
|
+
conn.proxy = &opts->proxy_opts;
|
|
963
1017
|
}
|
|
964
1018
|
|
|
965
1019
|
/* Connect and download everything */
|
|
966
|
-
if ((error =
|
|
1020
|
+
if ((error = git_remote__connect(remote, GIT_DIRECTION_FETCH, cbs, &conn)) != 0)
|
|
967
1021
|
return error;
|
|
968
1022
|
|
|
969
1023
|
error = git_remote_download(remote, refspecs, opts);
|
|
@@ -1041,7 +1095,7 @@ static int ref_to_update(int *update, git_buf *remote_name, git_remote *remote,
|
|
|
1041
1095
|
(error = git_refspec_rtransform(remote_name, spec, upstream_name.ptr)) < 0) {
|
|
1042
1096
|
/* Not an error if there is no upstream */
|
|
1043
1097
|
if (error == GIT_ENOTFOUND) {
|
|
1044
|
-
|
|
1098
|
+
git_error_clear();
|
|
1045
1099
|
error = 0;
|
|
1046
1100
|
}
|
|
1047
1101
|
|
|
@@ -1070,7 +1124,7 @@ static int remote_head_for_ref(git_remote_head **out, git_remote *remote, git_re
|
|
|
1070
1124
|
error = git_reference_resolve(&resolved_ref, ref);
|
|
1071
1125
|
|
|
1072
1126
|
/* If we're in an unborn branch, let's pretend nothing happened */
|
|
1073
|
-
if (error == GIT_ENOTFOUND && git_reference_type(ref) ==
|
|
1127
|
+
if (error == GIT_ENOTFOUND && git_reference_type(ref) == GIT_REFERENCE_SYMBOLIC) {
|
|
1074
1128
|
ref_name = git_reference_symbolic_target(ref);
|
|
1075
1129
|
error = 0;
|
|
1076
1130
|
} else {
|
|
@@ -1176,7 +1230,7 @@ static int prune_candidates(git_vector *candidates, git_remote *remote)
|
|
|
1176
1230
|
continue;
|
|
1177
1231
|
|
|
1178
1232
|
refname_dup = git__strdup(refname);
|
|
1179
|
-
|
|
1233
|
+
GIT_ERROR_CHECK_ALLOC(refname_dup);
|
|
1180
1234
|
|
|
1181
1235
|
if ((error = git_vector_insert(candidates, refname_dup)) < 0)
|
|
1182
1236
|
goto out;
|
|
@@ -1206,7 +1260,7 @@ int git_remote_prune(git_remote *remote, const git_remote_callbacks *callbacks)
|
|
|
1206
1260
|
git_oid zero_id = {{ 0 }};
|
|
1207
1261
|
|
|
1208
1262
|
if (callbacks)
|
|
1209
|
-
|
|
1263
|
+
GIT_ERROR_CHECK_VERSION(callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks");
|
|
1210
1264
|
|
|
1211
1265
|
if ((error = ls_to_vector(&remote_refs, remote)) < 0)
|
|
1212
1266
|
goto cleanup;
|
|
@@ -1234,7 +1288,7 @@ int git_remote_prune(git_remote *remote, const git_remote_callbacks *callbacks)
|
|
|
1234
1288
|
goto cleanup;
|
|
1235
1289
|
|
|
1236
1290
|
key.name = (char *) git_buf_cstr(&buf);
|
|
1237
|
-
error =
|
|
1291
|
+
error = git_vector_bsearch(&pos, &remote_refs, &key);
|
|
1238
1292
|
git_buf_dispose(&buf);
|
|
1239
1293
|
|
|
1240
1294
|
if (error < 0 && error != GIT_ENOTFOUND)
|
|
@@ -1273,7 +1327,7 @@ int git_remote_prune(git_remote *remote, const git_remote_callbacks *callbacks)
|
|
|
1273
1327
|
if (error < 0)
|
|
1274
1328
|
goto cleanup;
|
|
1275
1329
|
|
|
1276
|
-
if (git_reference_type(ref) ==
|
|
1330
|
+
if (git_reference_type(ref) == GIT_REFERENCE_SYMBOLIC) {
|
|
1277
1331
|
git_reference_free(ref);
|
|
1278
1332
|
continue;
|
|
1279
1333
|
}
|
|
@@ -1394,7 +1448,7 @@ static int update_tips_for_spec(
|
|
|
1394
1448
|
continue;
|
|
1395
1449
|
|
|
1396
1450
|
/* In autotag mode, don't overwrite any locally-existing tags */
|
|
1397
|
-
error = git_reference_create(&ref, remote->repo, refname.ptr, &head->oid, !autotag,
|
|
1451
|
+
error = git_reference_create(&ref, remote->repo, refname.ptr, &head->oid, !autotag,
|
|
1398
1452
|
log_message);
|
|
1399
1453
|
|
|
1400
1454
|
if (error == GIT_EEXISTS)
|
|
@@ -1681,7 +1735,7 @@ static int remote_list_cb(const git_config_entry *entry, void *payload)
|
|
|
1681
1735
|
remote_name = git__strndup(name, namelen - 4); /* strip ".url" */
|
|
1682
1736
|
else
|
|
1683
1737
|
remote_name = git__strndup(name, namelen - 8); /* strip ".pushurl" */
|
|
1684
|
-
|
|
1738
|
+
GIT_ERROR_CHECK_ALLOC(remote_name);
|
|
1685
1739
|
|
|
1686
1740
|
return git_vector_insert(list, remote_name);
|
|
1687
1741
|
}
|
|
@@ -1714,7 +1768,7 @@ int git_remote_list(git_strarray *remotes_list, git_repository *repo)
|
|
|
1714
1768
|
return 0;
|
|
1715
1769
|
}
|
|
1716
1770
|
|
|
1717
|
-
const
|
|
1771
|
+
const git_indexer_progress *git_remote_stats(git_remote *remote)
|
|
1718
1772
|
{
|
|
1719
1773
|
assert(remote);
|
|
1720
1774
|
return &remote->stats;
|
|
@@ -1755,7 +1809,7 @@ int git_remote_set_autotag(git_repository *repo, const char *remote, git_remote_
|
|
|
1755
1809
|
error = 0;
|
|
1756
1810
|
break;
|
|
1757
1811
|
default:
|
|
1758
|
-
|
|
1812
|
+
git_error_set(GIT_ERROR_INVALID, "invalid value for the tagopt setting");
|
|
1759
1813
|
error = -1;
|
|
1760
1814
|
}
|
|
1761
1815
|
|
|
@@ -1863,7 +1917,7 @@ static int rename_one_remote_reference(
|
|
|
1863
1917
|
git_buf_cstr(&log_message))) < 0)
|
|
1864
1918
|
goto cleanup;
|
|
1865
1919
|
|
|
1866
|
-
if (git_reference_type(ref) !=
|
|
1920
|
+
if (git_reference_type(ref) != GIT_REFERENCE_SYMBOLIC)
|
|
1867
1921
|
goto cleanup;
|
|
1868
1922
|
|
|
1869
1923
|
/* Handle refs like origin/HEAD -> origin/master */
|
|
@@ -1937,8 +1991,7 @@ static int rename_fetch_refspecs(git_vector *problems, git_remote *remote, const
|
|
|
1937
1991
|
if ((error = git_vector_init(problems, 1, NULL)) < 0)
|
|
1938
1992
|
return error;
|
|
1939
1993
|
|
|
1940
|
-
if ((error =
|
|
1941
|
-
&base, "+refs/heads/*:refs/remotes/%s/*", remote->name)) < 0)
|
|
1994
|
+
if ((error = default_fetchspec_for_name(&base, remote->name)) < 0)
|
|
1942
1995
|
return error;
|
|
1943
1996
|
|
|
1944
1997
|
git_vector_foreach(&remote->refspecs, i, spec) {
|
|
@@ -1950,7 +2003,7 @@ static int rename_fetch_refspecs(git_vector *problems, git_remote *remote, const
|
|
|
1950
2003
|
char *dup;
|
|
1951
2004
|
|
|
1952
2005
|
dup = git__strdup(spec->string);
|
|
1953
|
-
|
|
2006
|
+
GIT_ERROR_CHECK_ALLOC(dup);
|
|
1954
2007
|
|
|
1955
2008
|
if ((error = git_vector_insert(problems, dup)) < 0)
|
|
1956
2009
|
break;
|
|
@@ -1963,8 +2016,7 @@ static int rename_fetch_refspecs(git_vector *problems, git_remote *remote, const
|
|
|
1963
2016
|
git_buf_clear(&val);
|
|
1964
2017
|
git_buf_clear(&var);
|
|
1965
2018
|
|
|
1966
|
-
if (
|
|
1967
|
-
&val, "+refs/heads/*:refs/remotes/%s/*", new_name) < 0 ||
|
|
2019
|
+
if (default_fetchspec_for_name(&val, new_name) < 0 ||
|
|
1968
2020
|
git_buf_printf(&var, "remote.%s.fetch", new_name) < 0)
|
|
1969
2021
|
{
|
|
1970
2022
|
error = -1;
|
|
@@ -2047,7 +2099,7 @@ int git_remote_is_valid_name(
|
|
|
2047
2099
|
git_buf_dispose(&buf);
|
|
2048
2100
|
git_refspec__dispose(&refspec);
|
|
2049
2101
|
|
|
2050
|
-
|
|
2102
|
+
git_error_clear();
|
|
2051
2103
|
return error == 0;
|
|
2052
2104
|
}
|
|
2053
2105
|
|
|
@@ -2202,7 +2254,7 @@ static int remove_branch_config_related_entries(
|
|
|
2202
2254
|
if ((error = git_config_delete_entry(config, git_buf_cstr(&buf))) < 0) {
|
|
2203
2255
|
if (error != GIT_ENOTFOUND)
|
|
2204
2256
|
break;
|
|
2205
|
-
|
|
2257
|
+
git_error_clear();
|
|
2206
2258
|
}
|
|
2207
2259
|
|
|
2208
2260
|
git_buf_clear(&buf);
|
|
@@ -2212,7 +2264,7 @@ static int remove_branch_config_related_entries(
|
|
|
2212
2264
|
if ((error = git_config_delete_entry(config, git_buf_cstr(&buf))) < 0) {
|
|
2213
2265
|
if (error != GIT_ENOTFOUND)
|
|
2214
2266
|
break;
|
|
2215
|
-
|
|
2267
|
+
git_error_clear();
|
|
2216
2268
|
}
|
|
2217
2269
|
}
|
|
2218
2270
|
|
|
@@ -2373,24 +2425,23 @@ int git_remote_upload(git_remote *remote, const git_strarray *refspecs, const gi
|
|
|
2373
2425
|
git_push *push;
|
|
2374
2426
|
git_refspec *spec;
|
|
2375
2427
|
const git_remote_callbacks *cbs = NULL;
|
|
2376
|
-
|
|
2377
|
-
const git_proxy_options *proxy = NULL;
|
|
2428
|
+
git_remote_connection_opts conn = GIT_REMOTE_CONNECTION_OPTIONS_INIT;
|
|
2378
2429
|
|
|
2379
2430
|
assert(remote);
|
|
2380
2431
|
|
|
2381
2432
|
if (!remote->repo) {
|
|
2382
|
-
|
|
2433
|
+
git_error_set(GIT_ERROR_INVALID, "cannot download detached remote");
|
|
2383
2434
|
return -1;
|
|
2384
2435
|
}
|
|
2385
2436
|
|
|
2386
2437
|
if (opts) {
|
|
2387
2438
|
cbs = &opts->callbacks;
|
|
2388
|
-
custom_headers = &opts->custom_headers;
|
|
2389
|
-
proxy = &opts->proxy_opts;
|
|
2439
|
+
conn.custom_headers = &opts->custom_headers;
|
|
2440
|
+
conn.proxy = &opts->proxy_opts;
|
|
2390
2441
|
}
|
|
2391
2442
|
|
|
2392
2443
|
if (!git_remote_connected(remote) &&
|
|
2393
|
-
(error =
|
|
2444
|
+
(error = git_remote__connect(remote, GIT_DIRECTION_PUSH, cbs, &conn)) < 0)
|
|
2394
2445
|
goto cleanup;
|
|
2395
2446
|
|
|
2396
2447
|
free_refspecs(&remote->active_refspecs);
|
|
@@ -2445,15 +2496,15 @@ int git_remote_push(git_remote *remote, const git_strarray *refspecs, const git_
|
|
|
2445
2496
|
assert(remote);
|
|
2446
2497
|
|
|
2447
2498
|
if (!remote->repo) {
|
|
2448
|
-
|
|
2499
|
+
git_error_set(GIT_ERROR_INVALID, "cannot download detached remote");
|
|
2449
2500
|
return -1;
|
|
2450
2501
|
}
|
|
2451
2502
|
|
|
2452
2503
|
if (opts) {
|
|
2453
|
-
|
|
2504
|
+
GIT_ERROR_CHECK_VERSION(&opts->callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks");
|
|
2454
2505
|
cbs = &opts->callbacks;
|
|
2455
2506
|
custom_headers = &opts->custom_headers;
|
|
2456
|
-
|
|
2507
|
+
GIT_ERROR_CHECK_VERSION(&opts->proxy_opts, GIT_PROXY_OPTIONS_VERSION, "git_proxy_options");
|
|
2457
2508
|
proxy = &opts->proxy_opts;
|
|
2458
2509
|
}
|
|
2459
2510
|
|