rugged 1.7.2 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/AUTHORS +1 -0
- data/vendor/libgit2/CMakeLists.txt +23 -10
- data/vendor/libgit2/COPYING +195 -1
- data/vendor/libgit2/cmake/{FindIconv.cmake → FindIntlIconv.cmake} +6 -0
- data/vendor/libgit2/cmake/FindLLHTTP.cmake +39 -0
- data/vendor/libgit2/cmake/SelectGSSAPI.cmake +1 -1
- data/vendor/libgit2/cmake/SelectHTTPParser.cmake +23 -8
- data/vendor/libgit2/cmake/SelectHTTPSBackend.cmake +17 -8
- data/vendor/libgit2/cmake/SelectHashes.cmake +28 -11
- data/vendor/libgit2/cmake/SelectRegex.cmake +6 -1
- data/vendor/libgit2/cmake/SelectSSH.cmake +22 -17
- data/vendor/libgit2/cmake/SelectZlib.cmake +4 -0
- data/vendor/libgit2/deps/llhttp/CMakeLists.txt +8 -0
- data/vendor/libgit2/deps/llhttp/LICENSE-MIT +22 -0
- data/vendor/libgit2/deps/llhttp/api.c +510 -0
- data/vendor/libgit2/deps/llhttp/http.c +170 -0
- data/vendor/libgit2/deps/llhttp/llhttp.c +10168 -0
- data/vendor/libgit2/deps/llhttp/llhttp.h +897 -0
- data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +1 -1
- data/vendor/libgit2/deps/ntlmclient/crypt_builtin_md4.c +311 -0
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +2 -1
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +0 -20
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +4 -4
- data/vendor/libgit2/deps/ntlmclient/ntlm.c +21 -21
- data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +5 -4
- data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +2 -1
- data/vendor/libgit2/deps/ntlmclient/utf8.h +1176 -721
- data/vendor/libgit2/deps/ntlmclient/util.h +11 -0
- data/vendor/libgit2/deps/pcre/CMakeLists.txt +1 -0
- data/vendor/libgit2/deps/xdiff/xmerge.c +2 -2
- data/vendor/libgit2/deps/zlib/CMakeLists.txt +6 -1
- data/vendor/libgit2/deps/zlib/LICENSE +22 -0
- data/vendor/libgit2/deps/zlib/adler32.c +5 -27
- data/vendor/libgit2/deps/zlib/crc32.c +94 -167
- data/vendor/libgit2/deps/zlib/deflate.c +358 -435
- data/vendor/libgit2/deps/zlib/deflate.h +41 -10
- data/vendor/libgit2/deps/zlib/gzguts.h +13 -18
- data/vendor/libgit2/deps/zlib/infback.c +17 -30
- data/vendor/libgit2/deps/zlib/inffast.c +1 -4
- data/vendor/libgit2/deps/zlib/inffast.h +1 -1
- data/vendor/libgit2/deps/zlib/inflate.c +36 -102
- data/vendor/libgit2/deps/zlib/inftrees.c +6 -11
- data/vendor/libgit2/deps/zlib/inftrees.h +6 -6
- data/vendor/libgit2/deps/zlib/trees.c +287 -352
- data/vendor/libgit2/deps/zlib/zconf.h +23 -14
- data/vendor/libgit2/deps/zlib/zlib.h +202 -202
- data/vendor/libgit2/deps/zlib/zutil.c +18 -44
- data/vendor/libgit2/deps/zlib/zutil.h +13 -33
- data/vendor/libgit2/include/git2/annotated_commit.h +12 -5
- data/vendor/libgit2/include/git2/apply.h +27 -6
- data/vendor/libgit2/include/git2/attr.h +17 -4
- data/vendor/libgit2/include/git2/blame.h +133 -28
- data/vendor/libgit2/include/git2/blob.h +71 -28
- data/vendor/libgit2/include/git2/branch.h +22 -15
- data/vendor/libgit2/include/git2/buffer.h +6 -4
- data/vendor/libgit2/include/git2/cert.h +2 -1
- data/vendor/libgit2/include/git2/checkout.h +83 -32
- data/vendor/libgit2/include/git2/cherrypick.h +10 -3
- data/vendor/libgit2/include/git2/clone.h +25 -9
- data/vendor/libgit2/include/git2/commit.h +132 -3
- data/vendor/libgit2/include/git2/common.h +120 -63
- data/vendor/libgit2/include/git2/config.h +93 -23
- data/vendor/libgit2/include/git2/credential.h +30 -2
- data/vendor/libgit2/include/git2/credential_helpers.h +1 -0
- data/vendor/libgit2/include/git2/deprecated.h +133 -3
- data/vendor/libgit2/include/git2/describe.h +13 -1
- data/vendor/libgit2/include/git2/diff.h +38 -8
- data/vendor/libgit2/include/git2/email.h +9 -29
- data/vendor/libgit2/include/git2/errors.h +46 -73
- data/vendor/libgit2/include/git2/filter.h +14 -7
- data/vendor/libgit2/include/git2/global.h +8 -1
- data/vendor/libgit2/include/git2/graph.h +3 -2
- data/vendor/libgit2/include/git2/ignore.h +10 -0
- data/vendor/libgit2/include/git2/index.h +99 -14
- data/vendor/libgit2/include/git2/indexer.h +21 -4
- data/vendor/libgit2/include/git2/mailmap.h +7 -1
- data/vendor/libgit2/include/git2/merge.h +46 -1
- data/vendor/libgit2/include/git2/message.h +2 -2
- data/vendor/libgit2/include/git2/net.h +3 -1
- data/vendor/libgit2/include/git2/notes.h +9 -6
- data/vendor/libgit2/include/git2/object.h +9 -8
- data/vendor/libgit2/include/git2/odb.h +91 -49
- data/vendor/libgit2/include/git2/odb_backend.h +80 -52
- data/vendor/libgit2/include/git2/oid.h +23 -24
- data/vendor/libgit2/include/git2/oidarray.h +7 -1
- data/vendor/libgit2/include/git2/pack.h +13 -1
- data/vendor/libgit2/include/git2/patch.h +2 -3
- data/vendor/libgit2/include/git2/pathspec.h +9 -0
- data/vendor/libgit2/include/git2/proxy.h +10 -0
- data/vendor/libgit2/include/git2/rebase.h +9 -6
- data/vendor/libgit2/include/git2/refdb.h +2 -2
- data/vendor/libgit2/include/git2/reflog.h +3 -2
- data/vendor/libgit2/include/git2/refs.h +9 -6
- data/vendor/libgit2/include/git2/refspec.h +14 -4
- data/vendor/libgit2/include/git2/remote.h +94 -18
- data/vendor/libgit2/include/git2/repository.h +57 -21
- data/vendor/libgit2/include/git2/reset.h +16 -3
- data/vendor/libgit2/include/git2/revert.h +9 -4
- data/vendor/libgit2/include/git2/revparse.h +3 -3
- data/vendor/libgit2/include/git2/revwalk.h +3 -2
- data/vendor/libgit2/include/git2/signature.h +46 -1
- data/vendor/libgit2/include/git2/stash.h +17 -3
- data/vendor/libgit2/include/git2/status.h +10 -6
- data/vendor/libgit2/include/git2/stdint.h +87 -85
- data/vendor/libgit2/include/git2/strarray.h +2 -3
- data/vendor/libgit2/include/git2/submodule.h +20 -9
- data/vendor/libgit2/include/git2/sys/alloc.h +12 -0
- data/vendor/libgit2/include/git2/sys/commit.h +77 -3
- data/vendor/libgit2/include/git2/sys/commit_graph.h +103 -62
- data/vendor/libgit2/include/git2/sys/config.h +80 -4
- data/vendor/libgit2/include/git2/sys/credential.h +4 -3
- data/vendor/libgit2/include/git2/sys/diff.h +21 -1
- data/vendor/libgit2/include/git2/sys/email.h +7 -0
- data/vendor/libgit2/include/git2/sys/errors.h +76 -0
- data/vendor/libgit2/include/git2/sys/filter.h +66 -3
- data/vendor/libgit2/include/git2/sys/hashsig.h +11 -0
- data/vendor/libgit2/include/git2/sys/index.h +3 -2
- data/vendor/libgit2/include/git2/sys/mempack.h +32 -2
- data/vendor/libgit2/include/git2/sys/merge.h +55 -7
- data/vendor/libgit2/include/git2/sys/midx.h +43 -4
- data/vendor/libgit2/include/git2/sys/odb_backend.h +7 -3
- data/vendor/libgit2/include/git2/sys/openssl.h +8 -1
- data/vendor/libgit2/include/git2/sys/path.h +12 -1
- data/vendor/libgit2/include/git2/sys/refdb_backend.h +40 -36
- data/vendor/libgit2/include/git2/sys/refs.h +3 -2
- data/vendor/libgit2/include/git2/sys/remote.h +8 -1
- data/vendor/libgit2/include/git2/sys/repository.h +63 -3
- data/vendor/libgit2/include/git2/sys/stream.h +11 -2
- data/vendor/libgit2/include/git2/sys/transport.h +24 -3
- data/vendor/libgit2/include/git2/tag.h +3 -1
- data/vendor/libgit2/include/git2/trace.h +9 -3
- data/vendor/libgit2/include/git2/transaction.h +3 -2
- data/vendor/libgit2/include/git2/transport.h +11 -3
- data/vendor/libgit2/include/git2/tree.h +16 -5
- data/vendor/libgit2/include/git2/types.h +19 -3
- data/vendor/libgit2/include/git2/version.h +44 -8
- data/vendor/libgit2/include/git2/worktree.h +16 -6
- data/vendor/libgit2/src/CMakeLists.txt +6 -4
- data/vendor/libgit2/src/cli/CMakeLists.txt +2 -2
- data/vendor/libgit2/src/cli/cmd.c +1 -1
- data/vendor/libgit2/src/cli/cmd.h +4 -0
- data/vendor/libgit2/src/cli/cmd_blame.c +287 -0
- data/vendor/libgit2/src/cli/cmd_cat_file.c +6 -8
- data/vendor/libgit2/src/cli/cmd_clone.c +5 -7
- data/vendor/libgit2/src/cli/cmd_config.c +241 -0
- data/vendor/libgit2/src/cli/cmd_hash_object.c +6 -8
- data/vendor/libgit2/src/cli/cmd_help.c +6 -7
- data/vendor/libgit2/src/cli/cmd_index_pack.c +114 -0
- data/vendor/libgit2/src/cli/cmd_init.c +102 -0
- data/vendor/libgit2/src/cli/common.c +168 -0
- data/vendor/libgit2/src/cli/common.h +63 -0
- data/vendor/libgit2/src/cli/error.h +1 -1
- data/vendor/libgit2/src/cli/main.c +52 -24
- data/vendor/libgit2/src/cli/opt.c +29 -3
- data/vendor/libgit2/src/cli/opt.h +21 -3
- data/vendor/libgit2/src/cli/opt_usage.c +102 -33
- data/vendor/libgit2/src/cli/opt_usage.h +6 -1
- data/vendor/libgit2/src/cli/progress.c +51 -2
- data/vendor/libgit2/src/cli/progress.h +12 -0
- data/vendor/libgit2/src/cli/unix/sighandler.c +2 -1
- data/vendor/libgit2/src/cli/win32/precompiled.h +1 -1
- data/vendor/libgit2/src/cli/win32/sighandler.c +1 -1
- data/vendor/libgit2/src/libgit2/CMakeLists.txt +26 -8
- data/vendor/libgit2/src/libgit2/apply.c +10 -13
- data/vendor/libgit2/src/libgit2/attr.c +30 -13
- data/vendor/libgit2/src/libgit2/attr_file.c +7 -2
- data/vendor/libgit2/src/libgit2/attr_file.h +2 -0
- data/vendor/libgit2/src/libgit2/attrcache.c +69 -33
- data/vendor/libgit2/src/libgit2/attrcache.h +5 -9
- data/vendor/libgit2/src/libgit2/blame.c +130 -44
- data/vendor/libgit2/src/libgit2/blame.h +1 -0
- data/vendor/libgit2/src/libgit2/cache.c +22 -17
- data/vendor/libgit2/src/libgit2/cache.h +7 -9
- data/vendor/libgit2/src/libgit2/checkout.c +34 -24
- data/vendor/libgit2/src/libgit2/checkout.h +0 -2
- data/vendor/libgit2/src/libgit2/cherrypick.c +1 -2
- data/vendor/libgit2/src/libgit2/clone.c +186 -166
- data/vendor/libgit2/src/libgit2/clone.h +4 -1
- data/vendor/libgit2/src/libgit2/commit.c +92 -0
- data/vendor/libgit2/src/libgit2/commit_graph.c +67 -56
- data/vendor/libgit2/src/libgit2/commit_graph.h +1 -2
- data/vendor/libgit2/src/libgit2/config.c +389 -298
- data/vendor/libgit2/src/libgit2/config.cmake.in +3 -0
- data/vendor/libgit2/src/libgit2/config.h +9 -4
- data/vendor/libgit2/src/libgit2/config_backend.h +8 -10
- data/vendor/libgit2/src/libgit2/config_cache.c +4 -5
- data/vendor/libgit2/src/libgit2/config_file.c +99 -88
- data/vendor/libgit2/src/libgit2/config_list.c +285 -0
- data/vendor/libgit2/src/libgit2/config_list.h +32 -0
- data/vendor/libgit2/src/libgit2/config_mem.c +194 -40
- data/vendor/libgit2/src/libgit2/config_parse.c +10 -9
- data/vendor/libgit2/src/libgit2/config_snapshot.c +24 -31
- data/vendor/libgit2/src/libgit2/describe.c +24 -24
- data/vendor/libgit2/src/libgit2/diff.c +1 -1
- data/vendor/libgit2/src/libgit2/diff_driver.c +12 -19
- data/vendor/libgit2/src/libgit2/diff_driver.h +2 -2
- data/vendor/libgit2/src/libgit2/diff_generate.c +3 -3
- data/vendor/libgit2/src/libgit2/diff_parse.c +2 -2
- data/vendor/libgit2/src/libgit2/diff_print.c +65 -9
- data/vendor/libgit2/src/libgit2/diff_tform.c +36 -8
- data/vendor/libgit2/src/libgit2/email.c +1 -0
- data/vendor/libgit2/src/libgit2/fetch.c +5 -3
- data/vendor/libgit2/src/libgit2/filter.c +5 -5
- data/vendor/libgit2/src/libgit2/git2.rc +3 -3
- data/vendor/libgit2/src/libgit2/grafts.c +18 -20
- data/vendor/libgit2/src/libgit2/grafts.h +0 -1
- data/vendor/libgit2/src/libgit2/graph.c +1 -1
- data/vendor/libgit2/src/libgit2/hashmap_oid.h +30 -0
- data/vendor/libgit2/src/libgit2/ignore.c +9 -5
- data/vendor/libgit2/src/libgit2/index.c +68 -90
- data/vendor/libgit2/src/libgit2/index.h +2 -2
- data/vendor/libgit2/src/libgit2/index_map.c +95 -0
- data/vendor/libgit2/src/libgit2/index_map.h +28 -0
- data/vendor/libgit2/src/libgit2/indexer.c +34 -38
- data/vendor/libgit2/src/libgit2/iterator.c +14 -8
- data/vendor/libgit2/src/libgit2/libgit2.c +153 -368
- data/vendor/libgit2/src/libgit2/mailmap.c +1 -1
- data/vendor/libgit2/src/libgit2/merge.c +42 -37
- data/vendor/libgit2/src/libgit2/merge_driver.c +2 -2
- data/vendor/libgit2/src/libgit2/midx.c +28 -15
- data/vendor/libgit2/src/libgit2/mwindow.c +38 -45
- data/vendor/libgit2/src/libgit2/mwindow.h +4 -0
- data/vendor/libgit2/src/libgit2/object.c +6 -5
- data/vendor/libgit2/src/libgit2/odb.c +5 -4
- data/vendor/libgit2/src/libgit2/odb_mempack.c +49 -17
- data/vendor/libgit2/src/libgit2/odb_pack.c +13 -5
- data/vendor/libgit2/src/libgit2/oid.c +32 -5
- data/vendor/libgit2/src/libgit2/oid.h +11 -0
- data/vendor/libgit2/src/libgit2/pack-objects.c +58 -31
- data/vendor/libgit2/src/libgit2/pack-objects.h +12 -4
- data/vendor/libgit2/src/libgit2/pack.c +30 -24
- data/vendor/libgit2/src/libgit2/pack.h +15 -10
- data/vendor/libgit2/src/libgit2/patch_parse.c +2 -2
- data/vendor/libgit2/src/libgit2/path.c +1 -1
- data/vendor/libgit2/src/libgit2/pathspec.c +1 -1
- data/vendor/libgit2/src/libgit2/push.c +79 -28
- data/vendor/libgit2/src/libgit2/push.h +1 -0
- data/vendor/libgit2/src/libgit2/refdb_fs.c +128 -61
- data/vendor/libgit2/src/libgit2/reflog.c +1 -2
- data/vendor/libgit2/src/libgit2/reflog.h +2 -0
- data/vendor/libgit2/src/libgit2/refs.c +26 -7
- data/vendor/libgit2/src/libgit2/refs.h +6 -1
- data/vendor/libgit2/src/libgit2/refspec.c +28 -1
- data/vendor/libgit2/src/libgit2/refspec.h +8 -0
- data/vendor/libgit2/src/libgit2/remote.c +121 -61
- data/vendor/libgit2/src/libgit2/repository.c +231 -51
- data/vendor/libgit2/src/libgit2/repository.h +10 -6
- data/vendor/libgit2/src/libgit2/revert.c +1 -2
- data/vendor/libgit2/src/libgit2/revparse.c +2 -2
- data/vendor/libgit2/src/libgit2/revwalk.c +13 -10
- data/vendor/libgit2/src/libgit2/revwalk.h +3 -3
- data/vendor/libgit2/src/libgit2/settings.c +468 -0
- data/vendor/libgit2/src/libgit2/settings.h +6 -2
- data/vendor/libgit2/src/libgit2/signature.c +132 -15
- data/vendor/libgit2/src/libgit2/signature.h +0 -1
- data/vendor/libgit2/src/libgit2/status.c +1 -1
- data/vendor/libgit2/src/libgit2/streams/mbedtls.c +54 -60
- data/vendor/libgit2/src/libgit2/streams/openssl.c +32 -7
- data/vendor/libgit2/src/libgit2/streams/openssl.h +2 -0
- data/vendor/libgit2/src/libgit2/streams/openssl_dynamic.c +4 -0
- data/vendor/libgit2/src/libgit2/streams/openssl_dynamic.h +3 -0
- data/vendor/libgit2/src/libgit2/streams/stransport.c +39 -7
- data/vendor/libgit2/src/libgit2/submodule.c +106 -63
- data/vendor/libgit2/src/libgit2/submodule.h +6 -7
- data/vendor/libgit2/src/libgit2/tag.c +1 -1
- data/vendor/libgit2/src/libgit2/trailer.c +6 -6
- data/vendor/libgit2/src/libgit2/transaction.c +26 -20
- data/vendor/libgit2/src/libgit2/transaction.h +4 -1
- data/vendor/libgit2/src/libgit2/transport.c +4 -1
- data/vendor/libgit2/src/libgit2/transports/credential.c +1 -1
- data/vendor/libgit2/src/libgit2/transports/http.c +1 -2
- data/vendor/libgit2/src/libgit2/transports/http.h +0 -10
- data/vendor/libgit2/src/libgit2/transports/httpclient.c +112 -72
- data/vendor/libgit2/src/libgit2/transports/httpparser.c +128 -0
- data/vendor/libgit2/src/libgit2/transports/httpparser.h +99 -0
- data/vendor/libgit2/src/libgit2/transports/local.c +8 -7
- data/vendor/libgit2/src/libgit2/transports/smart.c +20 -8
- data/vendor/libgit2/src/libgit2/transports/smart.h +4 -2
- data/vendor/libgit2/src/libgit2/transports/smart_pkt.c +2 -2
- data/vendor/libgit2/src/libgit2/transports/smart_protocol.c +55 -10
- data/vendor/libgit2/src/libgit2/transports/ssh.c +41 -1103
- data/vendor/libgit2/src/libgit2/transports/ssh_exec.c +347 -0
- data/vendor/libgit2/src/libgit2/transports/ssh_exec.h +26 -0
- data/vendor/libgit2/src/libgit2/transports/ssh_libssh2.c +1126 -0
- data/vendor/libgit2/src/libgit2/transports/ssh_libssh2.h +28 -0
- data/vendor/libgit2/src/libgit2/transports/winhttp.c +35 -7
- data/vendor/libgit2/src/libgit2/tree.c +34 -26
- data/vendor/libgit2/src/libgit2/tree.h +3 -2
- data/vendor/libgit2/src/libgit2/worktree.c +14 -17
- data/vendor/libgit2/src/util/CMakeLists.txt +4 -6
- data/vendor/libgit2/src/util/alloc.c +4 -1
- data/vendor/libgit2/src/util/allocators/debugalloc.c +73 -0
- data/vendor/libgit2/src/{cli/cli.h → util/allocators/debugalloc.h} +6 -9
- data/vendor/libgit2/src/util/allocators/stdalloc.c +0 -10
- data/vendor/libgit2/src/util/array.h +18 -17
- data/vendor/libgit2/src/util/cc-compat.h +2 -0
- data/vendor/libgit2/src/util/ctype_compat.h +70 -0
- data/vendor/libgit2/src/util/date.c +22 -14
- data/vendor/libgit2/src/util/date.h +12 -0
- data/vendor/libgit2/src/util/errors.c +401 -0
- data/vendor/libgit2/src/{libgit2 → util}/errors.h +21 -17
- data/vendor/libgit2/src/util/fs_path.c +15 -4
- data/vendor/libgit2/src/util/fs_path.h +23 -0
- data/vendor/libgit2/src/util/futils.c +6 -5
- data/vendor/libgit2/src/util/futils.h +13 -4
- data/vendor/libgit2/src/util/git2_features.h.in +12 -1
- data/vendor/libgit2/src/util/git2_util.h +6 -0
- data/vendor/libgit2/src/util/hash/openssl.c +152 -0
- data/vendor/libgit2/src/util/hash/openssl.h +17 -1
- data/vendor/libgit2/src/util/hash/sha.h +4 -1
- data/vendor/libgit2/src/util/hashmap.h +424 -0
- data/vendor/libgit2/src/util/hashmap_str.h +43 -0
- data/vendor/libgit2/src/util/integer.h +3 -1
- data/vendor/libgit2/src/util/net.c +13 -7
- data/vendor/libgit2/src/util/net.h +2 -0
- data/vendor/libgit2/src/util/pool.c +1 -1
- data/vendor/libgit2/src/util/pool.h +5 -0
- data/vendor/libgit2/src/util/pqueue.h +1 -1
- data/vendor/libgit2/src/util/process.h +222 -0
- data/vendor/libgit2/src/util/rand.c +1 -7
- data/vendor/libgit2/src/util/regexp.c +1 -1
- data/vendor/libgit2/src/util/sortedcache.c +14 -13
- data/vendor/libgit2/src/util/sortedcache.h +3 -3
- data/vendor/libgit2/src/util/str.c +2 -2
- data/vendor/libgit2/src/util/strlist.c +108 -0
- data/vendor/libgit2/src/util/strlist.h +36 -0
- data/vendor/libgit2/src/util/unix/posix.h +0 -2
- data/vendor/libgit2/src/util/unix/process.c +629 -0
- data/vendor/libgit2/src/util/unix/realpath.c +23 -5
- data/vendor/libgit2/src/util/util.c +2 -2
- data/vendor/libgit2/src/util/util.h +4 -38
- data/vendor/libgit2/src/util/vector.c +3 -3
- data/vendor/libgit2/src/util/vector.h +2 -2
- data/vendor/libgit2/src/util/win32/posix_w32.c +29 -6
- data/vendor/libgit2/src/util/win32/process.c +506 -0
- metadata +45 -28
- data/vendor/libgit2/deps/http-parser/CMakeLists.txt +0 -6
- data/vendor/libgit2/deps/http-parser/COPYING +0 -23
- data/vendor/libgit2/deps/http-parser/http_parser.c +0 -2182
- data/vendor/libgit2/deps/http-parser/http_parser.h +0 -305
- data/vendor/libgit2/deps/zlib/COPYING +0 -27
- data/vendor/libgit2/include/git2/sys/reflog.h +0 -21
- data/vendor/libgit2/src/libgit2/config_entries.c +0 -237
- data/vendor/libgit2/src/libgit2/config_entries.h +0 -24
- data/vendor/libgit2/src/libgit2/errors.c +0 -293
- data/vendor/libgit2/src/libgit2/idxmap.c +0 -157
- data/vendor/libgit2/src/libgit2/idxmap.h +0 -177
- data/vendor/libgit2/src/libgit2/libgit2.h +0 -15
- data/vendor/libgit2/src/libgit2/offmap.c +0 -101
- data/vendor/libgit2/src/libgit2/offmap.h +0 -133
- data/vendor/libgit2/src/libgit2/oidmap.c +0 -107
- data/vendor/libgit2/src/libgit2/oidmap.h +0 -128
- data/vendor/libgit2/src/libgit2/threadstate.c +0 -97
- data/vendor/libgit2/src/libgit2/threadstate.h +0 -22
- data/vendor/libgit2/src/libgit2/transports/ssh.h +0 -14
- data/vendor/libgit2/src/util/khash.h +0 -615
- data/vendor/libgit2/src/util/strmap.c +0 -100
- data/vendor/libgit2/src/util/strmap.h +0 -131
- /data/vendor/libgit2/cmake/{FindHTTPParser.cmake → FindHTTP_Parser.cmake} +0 -0
@@ -808,7 +808,7 @@ int git_reference_list(
|
|
808
808
|
|
809
809
|
if (git_reference_foreach_name(
|
810
810
|
repo, &cb__reflist_add, (void *)&ref_list) < 0) {
|
811
|
-
|
811
|
+
git_vector_dispose(&ref_list);
|
812
812
|
return -1;
|
813
813
|
}
|
814
814
|
|
@@ -835,17 +835,20 @@ static int is_valid_ref_char(char ch)
|
|
835
835
|
}
|
836
836
|
}
|
837
837
|
|
838
|
-
static int ensure_segment_validity(const char *name, char may_contain_glob)
|
838
|
+
static int ensure_segment_validity(const char *name, char may_contain_glob, bool allow_caret_prefix)
|
839
839
|
{
|
840
840
|
const char *current = name;
|
841
|
+
const char *start = current;
|
841
842
|
char prev = '\0';
|
842
843
|
const int lock_len = (int)strlen(GIT_FILELOCK_EXTENSION);
|
843
844
|
int segment_len;
|
844
845
|
|
845
846
|
if (*current == '.')
|
846
847
|
return -1; /* Refname starts with "." */
|
848
|
+
if (allow_caret_prefix && *current == '^')
|
849
|
+
start++;
|
847
850
|
|
848
|
-
for (current =
|
851
|
+
for (current = start; ; current++) {
|
849
852
|
if (*current == '\0' || *current == '/')
|
850
853
|
break;
|
851
854
|
|
@@ -877,7 +880,7 @@ static int ensure_segment_validity(const char *name, char may_contain_glob)
|
|
877
880
|
return segment_len;
|
878
881
|
}
|
879
882
|
|
880
|
-
static bool
|
883
|
+
static bool is_valid_normalized_name(const char *name, size_t len)
|
881
884
|
{
|
882
885
|
size_t i;
|
883
886
|
char c;
|
@@ -888,6 +891,9 @@ static bool is_all_caps_and_underscore(const char *name, size_t len)
|
|
888
891
|
for (i = 0; i < len; i++)
|
889
892
|
{
|
890
893
|
c = name[i];
|
894
|
+
if (i == 0 && c == '^')
|
895
|
+
continue; /* The first character is allowed to be "^" for negative refspecs */
|
896
|
+
|
891
897
|
if ((c < 'A' || c > 'Z') && c != '_')
|
892
898
|
return false;
|
893
899
|
}
|
@@ -908,6 +914,7 @@ int git_reference__normalize_name(
|
|
908
914
|
int segment_len, segments_count = 0, error = GIT_EINVALIDSPEC;
|
909
915
|
unsigned int process_flags;
|
910
916
|
bool normalize = (buf != NULL);
|
917
|
+
bool allow_caret_prefix = true;
|
911
918
|
bool validate = (flags & GIT_REFERENCE_FORMAT__VALIDATION_DISABLE) == 0;
|
912
919
|
|
913
920
|
#ifdef GIT_USE_ICONV
|
@@ -945,7 +952,7 @@ int git_reference__normalize_name(
|
|
945
952
|
while (true) {
|
946
953
|
char may_contain_glob = process_flags & GIT_REFERENCE_FORMAT_REFSPEC_PATTERN;
|
947
954
|
|
948
|
-
segment_len = ensure_segment_validity(current, may_contain_glob);
|
955
|
+
segment_len = ensure_segment_validity(current, may_contain_glob, allow_caret_prefix);
|
949
956
|
if (segment_len < 0)
|
950
957
|
goto cleanup;
|
951
958
|
|
@@ -981,6 +988,12 @@ int git_reference__normalize_name(
|
|
981
988
|
break;
|
982
989
|
|
983
990
|
current += segment_len + 1;
|
991
|
+
|
992
|
+
/*
|
993
|
+
* A caret prefix is only allowed in the first segment to signify a
|
994
|
+
* negative refspec.
|
995
|
+
*/
|
996
|
+
allow_caret_prefix = false;
|
984
997
|
}
|
985
998
|
|
986
999
|
/* A refname can not be empty */
|
@@ -1000,12 +1013,12 @@ int git_reference__normalize_name(
|
|
1000
1013
|
|
1001
1014
|
if ((segments_count == 1 ) &&
|
1002
1015
|
!(flags & GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND) &&
|
1003
|
-
!(
|
1016
|
+
!(is_valid_normalized_name(name, (size_t)segment_len) ||
|
1004
1017
|
((flags & GIT_REFERENCE_FORMAT_REFSPEC_PATTERN) && !strcmp("*", name))))
|
1005
1018
|
goto cleanup;
|
1006
1019
|
|
1007
1020
|
if ((segments_count > 1)
|
1008
|
-
&& (
|
1021
|
+
&& (is_valid_normalized_name(name, strchr(name, '/') - name)))
|
1009
1022
|
goto cleanup;
|
1010
1023
|
|
1011
1024
|
error = 0;
|
@@ -1080,6 +1093,12 @@ int git_reference_cmp(
|
|
1080
1093
|
return git_oid__cmp(&ref1->target.oid, &ref2->target.oid);
|
1081
1094
|
}
|
1082
1095
|
|
1096
|
+
int git_reference__cmp_cb(const void *a, const void *b)
|
1097
|
+
{
|
1098
|
+
return git_reference_cmp(
|
1099
|
+
(const git_reference *)a, (const git_reference *)b);
|
1100
|
+
}
|
1101
|
+
|
1083
1102
|
/*
|
1084
1103
|
* Starting with the reference given by `ref_name`, follows symbolic
|
1085
1104
|
* references until a direct reference is found and updated the OID
|
@@ -12,7 +12,6 @@
|
|
12
12
|
#include "git2/oid.h"
|
13
13
|
#include "git2/refs.h"
|
14
14
|
#include "git2/refdb.h"
|
15
|
-
#include "strmap.h"
|
16
15
|
#include "str.h"
|
17
16
|
#include "oid.h"
|
18
17
|
|
@@ -92,6 +91,12 @@ int git_reference__is_tag(const char *ref_name);
|
|
92
91
|
int git_reference__is_note(const char *ref_name);
|
93
92
|
const char *git_reference__shorthand(const char *name);
|
94
93
|
|
94
|
+
/*
|
95
|
+
* A `git_reference_cmp` wrapper suitable for passing to generic
|
96
|
+
* comparators, like `vector_cmp` / `tsort` / etc.
|
97
|
+
*/
|
98
|
+
int git_reference__cmp_cb(const void *a, const void *b);
|
99
|
+
|
95
100
|
/**
|
96
101
|
* Lookup a reference by name and try to resolve to an OID.
|
97
102
|
*
|
@@ -22,6 +22,7 @@ int git_refspec__parse(git_refspec *refspec, const char *input, bool is_fetch)
|
|
22
22
|
const char *lhs, *rhs;
|
23
23
|
int valid = 0;
|
24
24
|
unsigned int flags;
|
25
|
+
bool is_neg_refspec = false;
|
25
26
|
|
26
27
|
GIT_ASSERT_ARG(refspec);
|
27
28
|
GIT_ASSERT_ARG(input);
|
@@ -34,6 +35,9 @@ int git_refspec__parse(git_refspec *refspec, const char *input, bool is_fetch)
|
|
34
35
|
refspec->force = 1;
|
35
36
|
lhs++;
|
36
37
|
}
|
38
|
+
if (*lhs == '^') {
|
39
|
+
is_neg_refspec = true;
|
40
|
+
}
|
37
41
|
|
38
42
|
rhs = strrchr(lhs, ':');
|
39
43
|
|
@@ -62,7 +66,14 @@ int git_refspec__parse(git_refspec *refspec, const char *input, bool is_fetch)
|
|
62
66
|
|
63
67
|
llen = (rhs ? (size_t)(rhs - lhs - 1) : strlen(lhs));
|
64
68
|
if (1 <= llen && memchr(lhs, '*', llen)) {
|
65
|
-
|
69
|
+
/*
|
70
|
+
* If the lefthand side contains a glob, then one of the following must be
|
71
|
+
* true, otherwise the spec is invalid
|
72
|
+
* 1) the rhs exists and also contains a glob
|
73
|
+
* 2) it is a negative refspec (i.e. no rhs)
|
74
|
+
* 3) the rhs doesn't exist and we're fetching
|
75
|
+
*/
|
76
|
+
if ((rhs && !is_glob) || (rhs && is_neg_refspec) || (!rhs && is_fetch && !is_neg_refspec))
|
66
77
|
goto invalid;
|
67
78
|
is_glob = 1;
|
68
79
|
} else if (rhs && is_glob)
|
@@ -225,6 +236,14 @@ int git_refspec_force(const git_refspec *refspec)
|
|
225
236
|
return refspec->force;
|
226
237
|
}
|
227
238
|
|
239
|
+
int git_refspec_src_matches_negative(const git_refspec *refspec, const char *refname)
|
240
|
+
{
|
241
|
+
if (refspec == NULL || refspec->src == NULL || !git_refspec_is_negative(refspec))
|
242
|
+
return false;
|
243
|
+
|
244
|
+
return (wildmatch(refspec->src + 1, refname, 0) == 0);
|
245
|
+
}
|
246
|
+
|
228
247
|
int git_refspec_src_matches(const git_refspec *refspec, const char *refname)
|
229
248
|
{
|
230
249
|
if (refspec == NULL || refspec->src == NULL)
|
@@ -340,6 +359,14 @@ int git_refspec_is_wildcard(const git_refspec *spec)
|
|
340
359
|
return (spec->src[strlen(spec->src) - 1] == '*');
|
341
360
|
}
|
342
361
|
|
362
|
+
int git_refspec_is_negative(const git_refspec *spec)
|
363
|
+
{
|
364
|
+
GIT_ASSERT_ARG(spec);
|
365
|
+
GIT_ASSERT_ARG(spec->src);
|
366
|
+
|
367
|
+
return (spec->src[0] == '^' && spec->dst == NULL);
|
368
|
+
}
|
369
|
+
|
343
370
|
git_direction git_refspec_direction(const git_refspec *spec)
|
344
371
|
{
|
345
372
|
GIT_ASSERT_ARG(spec);
|
@@ -45,6 +45,14 @@ int git_refspec__serialize(git_str *out, const git_refspec *refspec);
|
|
45
45
|
*/
|
46
46
|
int git_refspec_is_wildcard(const git_refspec *spec);
|
47
47
|
|
48
|
+
/**
|
49
|
+
* Determines if a refspec is a negative refspec.
|
50
|
+
*
|
51
|
+
* @param spec the refspec
|
52
|
+
* @return 1 if the refspec is a negative, 0 otherwise
|
53
|
+
*/
|
54
|
+
int git_refspec_is_negative(const git_refspec *spec);
|
55
|
+
|
48
56
|
/**
|
49
57
|
* DWIM `spec` with `refs` existing on the remote, append the dwim'ed
|
50
58
|
* result in `out`.
|
@@ -1293,9 +1293,9 @@ static int git_remote__download(
|
|
1293
1293
|
free_refspecs(&remote->active_refspecs);
|
1294
1294
|
error = dwim_refspecs(&remote->active_refspecs, to_active, &refs);
|
1295
1295
|
|
1296
|
-
|
1296
|
+
git_vector_dispose(&refs);
|
1297
1297
|
free_refspecs(&specs);
|
1298
|
-
|
1298
|
+
git_vector_dispose(&specs);
|
1299
1299
|
|
1300
1300
|
if (error < 0)
|
1301
1301
|
goto on_error;
|
@@ -1311,9 +1311,9 @@ static int git_remote__download(
|
|
1311
1311
|
error = git_fetch_download_pack(remote);
|
1312
1312
|
|
1313
1313
|
on_error:
|
1314
|
-
|
1314
|
+
git_vector_dispose(&refs);
|
1315
1315
|
free_refspecs(&specs);
|
1316
|
-
|
1316
|
+
git_vector_dispose(&specs);
|
1317
1317
|
return error;
|
1318
1318
|
}
|
1319
1319
|
|
@@ -1339,7 +1339,11 @@ int git_remote_download(
|
|
1339
1339
|
if ((error = connect_or_reset_options(remote, GIT_DIRECTION_FETCH, &connect_opts)) < 0)
|
1340
1340
|
return error;
|
1341
1341
|
|
1342
|
-
|
1342
|
+
error = git_remote__download(remote, refspecs, opts);
|
1343
|
+
|
1344
|
+
git_remote_connect_options_dispose(&connect_opts);
|
1345
|
+
|
1346
|
+
return error;
|
1343
1347
|
}
|
1344
1348
|
|
1345
1349
|
int git_remote_fetch(
|
@@ -1348,13 +1352,14 @@ int git_remote_fetch(
|
|
1348
1352
|
const git_fetch_options *opts,
|
1349
1353
|
const char *reflog_message)
|
1350
1354
|
{
|
1351
|
-
int error, update_fetchhead = 1;
|
1352
1355
|
git_remote_autotag_option_t tagopt = remote->download_tags;
|
1353
1356
|
bool prune = false;
|
1354
1357
|
git_str reflog_msg_buf = GIT_STR_INIT;
|
1355
1358
|
git_remote_connect_options connect_opts = GIT_REMOTE_CONNECT_OPTIONS_INIT;
|
1356
1359
|
unsigned int capabilities;
|
1357
1360
|
git_oid_t oid_type;
|
1361
|
+
unsigned int update_flags = GIT_REMOTE_UPDATE_FETCHHEAD;
|
1362
|
+
int error;
|
1358
1363
|
|
1359
1364
|
GIT_ASSERT_ARG(remote);
|
1360
1365
|
|
@@ -1371,7 +1376,7 @@ int git_remote_fetch(
|
|
1371
1376
|
return error;
|
1372
1377
|
|
1373
1378
|
if (opts) {
|
1374
|
-
|
1379
|
+
update_flags = opts->update_fetchhead;
|
1375
1380
|
tagopt = opts->download_tags;
|
1376
1381
|
}
|
1377
1382
|
|
@@ -1398,8 +1403,14 @@ int git_remote_fetch(
|
|
1398
1403
|
}
|
1399
1404
|
|
1400
1405
|
/* Create "remote/foo" branches for all remote branches */
|
1401
|
-
error = git_remote_update_tips(remote,
|
1406
|
+
error = git_remote_update_tips(remote,
|
1407
|
+
&connect_opts.callbacks,
|
1408
|
+
update_flags,
|
1409
|
+
tagopt,
|
1410
|
+
git_str_cstr(&reflog_msg_buf));
|
1411
|
+
|
1402
1412
|
git_str_dispose(&reflog_msg_buf);
|
1413
|
+
|
1403
1414
|
if (error < 0)
|
1404
1415
|
goto done;
|
1405
1416
|
|
@@ -1578,7 +1589,7 @@ cleanup:
|
|
1578
1589
|
for (i = 0; i < fetchhead_refs.length; ++i)
|
1579
1590
|
git_fetchhead_ref_free(fetchhead_refs.contents[i]);
|
1580
1591
|
|
1581
|
-
|
1592
|
+
git_vector_dispose(&fetchhead_refs);
|
1582
1593
|
git_reference_free(head_ref);
|
1583
1594
|
|
1584
1595
|
return error;
|
@@ -1713,19 +1724,28 @@ int git_remote_prune(git_remote *remote, const git_remote_callbacks *callbacks)
|
|
1713
1724
|
git_oid_cpy(&id, git_reference_target(ref));
|
1714
1725
|
error = git_reference_delete(ref);
|
1715
1726
|
git_reference_free(ref);
|
1727
|
+
|
1716
1728
|
if (error < 0)
|
1717
1729
|
goto cleanup;
|
1718
1730
|
|
1719
|
-
if (callbacks && callbacks->
|
1720
|
-
error = callbacks->
|
1731
|
+
if (callbacks && callbacks->update_refs)
|
1732
|
+
error = callbacks->update_refs(refname, &id,
|
1733
|
+
&zero_id, NULL, callbacks->payload);
|
1734
|
+
#ifndef GIT_DEPRECATE_HARD
|
1735
|
+
else if (callbacks && callbacks->update_tips)
|
1736
|
+
error = callbacks->update_tips(refname, &id,
|
1737
|
+
&zero_id, callbacks->payload);
|
1738
|
+
#endif
|
1721
1739
|
|
1722
|
-
if (error < 0)
|
1740
|
+
if (error < 0) {
|
1741
|
+
git_error_set_after_callback_function(error, "git_remote_fetch");
|
1723
1742
|
goto cleanup;
|
1743
|
+
}
|
1724
1744
|
}
|
1725
1745
|
|
1726
1746
|
cleanup:
|
1727
|
-
|
1728
|
-
|
1747
|
+
git_vector_dispose(&remote_refs);
|
1748
|
+
git_vector_dispose_deep(&candidates);
|
1729
1749
|
return error;
|
1730
1750
|
}
|
1731
1751
|
|
@@ -1733,6 +1753,7 @@ static int update_ref(
|
|
1733
1753
|
const git_remote *remote,
|
1734
1754
|
const char *ref_name,
|
1735
1755
|
git_oid *id,
|
1756
|
+
git_refspec *spec,
|
1736
1757
|
const char *msg,
|
1737
1758
|
const git_remote_callbacks *callbacks)
|
1738
1759
|
{
|
@@ -1761,9 +1782,19 @@ static int update_ref(
|
|
1761
1782
|
if (error < 0)
|
1762
1783
|
return error;
|
1763
1784
|
|
1764
|
-
if (callbacks && callbacks->
|
1765
|
-
|
1785
|
+
if (callbacks && callbacks->update_refs)
|
1786
|
+
error = callbacks->update_refs(ref_name, &old_id,
|
1787
|
+
id, spec, callbacks->payload);
|
1788
|
+
#ifndef GIT_DEPRECATE_HARD
|
1789
|
+
else if (callbacks && callbacks->update_tips)
|
1790
|
+
error = callbacks->update_tips(ref_name, &old_id,
|
1791
|
+
id, callbacks->payload);
|
1792
|
+
#endif
|
1793
|
+
|
1794
|
+
if (error < 0) {
|
1795
|
+
git_error_set_after_callback_function(error, "git_remote_fetch");
|
1766
1796
|
return error;
|
1797
|
+
}
|
1767
1798
|
|
1768
1799
|
return 0;
|
1769
1800
|
}
|
@@ -1774,6 +1805,7 @@ static int update_one_tip(
|
|
1774
1805
|
git_refspec *spec,
|
1775
1806
|
git_remote_head *head,
|
1776
1807
|
git_refspec *tagspec,
|
1808
|
+
unsigned int update_flags,
|
1777
1809
|
git_remote_autotag_option_t tagopt,
|
1778
1810
|
const char *log_message,
|
1779
1811
|
const git_remote_callbacks *callbacks)
|
@@ -1781,7 +1813,7 @@ static int update_one_tip(
|
|
1781
1813
|
git_odb *odb;
|
1782
1814
|
git_str refname = GIT_STR_INIT;
|
1783
1815
|
git_reference *ref = NULL;
|
1784
|
-
bool autotag = false;
|
1816
|
+
bool autotag = false, updated = false;
|
1785
1817
|
git_oid old;
|
1786
1818
|
int valid;
|
1787
1819
|
int error;
|
@@ -1855,22 +1887,33 @@ static int update_one_tip(
|
|
1855
1887
|
goto done;
|
1856
1888
|
}
|
1857
1889
|
|
1858
|
-
if (!
|
1859
|
-
|
1890
|
+
if ((updated = !git_oid_equal(&old, &head->oid))) {
|
1891
|
+
/* In autotag mode, don't overwrite any locally-existing tags */
|
1892
|
+
error = git_reference_create(&ref, remote->repo, refname.ptr, &head->oid, !autotag,
|
1893
|
+
log_message);
|
1860
1894
|
|
1861
|
-
|
1862
|
-
|
1863
|
-
|
1895
|
+
if (error < 0) {
|
1896
|
+
if (error == GIT_EEXISTS)
|
1897
|
+
error = 0;
|
1864
1898
|
|
1865
|
-
|
1866
|
-
|
1867
|
-
|
1899
|
+
goto done;
|
1900
|
+
}
|
1901
|
+
}
|
1868
1902
|
|
1903
|
+
if (!callbacks ||
|
1904
|
+
(!updated && (update_flags & GIT_REMOTE_UPDATE_REPORT_UNCHANGED) == 0))
|
1869
1905
|
goto done;
|
1870
|
-
}
|
1871
1906
|
|
1872
|
-
if (callbacks && callbacks->
|
1873
|
-
|
1907
|
+
if (callbacks && callbacks->update_refs)
|
1908
|
+
error = callbacks->update_refs(refname.ptr, &old,
|
1909
|
+
&head->oid, spec, callbacks->payload);
|
1910
|
+
#ifndef GIT_DEPRECATE_HARD
|
1911
|
+
else if (callbacks && callbacks->update_tips)
|
1912
|
+
error = callbacks->update_tips(refname.ptr, &old,
|
1913
|
+
&head->oid, callbacks->payload);
|
1914
|
+
#endif
|
1915
|
+
|
1916
|
+
if (error < 0)
|
1874
1917
|
git_error_set_after_callback_function(error, "git_remote_fetch");
|
1875
1918
|
|
1876
1919
|
done:
|
@@ -1882,7 +1925,7 @@ done:
|
|
1882
1925
|
static int update_tips_for_spec(
|
1883
1926
|
git_remote *remote,
|
1884
1927
|
const git_remote_callbacks *callbacks,
|
1885
|
-
int
|
1928
|
+
unsigned int update_flags,
|
1886
1929
|
git_remote_autotag_option_t tagopt,
|
1887
1930
|
git_refspec *spec,
|
1888
1931
|
git_vector *refs,
|
@@ -1905,7 +1948,10 @@ static int update_tips_for_spec(
|
|
1905
1948
|
|
1906
1949
|
/* Update tips based on the remote heads */
|
1907
1950
|
git_vector_foreach(refs, i, head) {
|
1908
|
-
if (update_one_tip(&update_heads,
|
1951
|
+
if (update_one_tip(&update_heads,
|
1952
|
+
remote, spec, head, &tagspec,
|
1953
|
+
update_flags, tagopt, log_message,
|
1954
|
+
callbacks) < 0)
|
1909
1955
|
goto on_error;
|
1910
1956
|
}
|
1911
1957
|
|
@@ -1917,7 +1963,7 @@ static int update_tips_for_spec(
|
|
1917
1963
|
goto on_error;
|
1918
1964
|
|
1919
1965
|
if (spec->dst &&
|
1920
|
-
(error = update_ref(remote, spec->dst, &id, log_message, callbacks)) < 0)
|
1966
|
+
(error = update_ref(remote, spec->dst, &id, spec, log_message, callbacks)) < 0)
|
1921
1967
|
goto on_error;
|
1922
1968
|
|
1923
1969
|
git_oid_cpy(&oid_head.oid, &id);
|
@@ -1927,17 +1973,17 @@ static int update_tips_for_spec(
|
|
1927
1973
|
goto on_error;
|
1928
1974
|
}
|
1929
1975
|
|
1930
|
-
if (
|
1976
|
+
if ((update_flags & GIT_REMOTE_UPDATE_FETCHHEAD) &&
|
1931
1977
|
(error = git_remote_write_fetchhead(remote, spec, &update_heads)) < 0)
|
1932
1978
|
goto on_error;
|
1933
1979
|
|
1934
1980
|
git_refspec__dispose(&tagspec);
|
1935
|
-
|
1981
|
+
git_vector_dispose(&update_heads);
|
1936
1982
|
return 0;
|
1937
1983
|
|
1938
1984
|
on_error:
|
1939
1985
|
git_refspec__dispose(&tagspec);
|
1940
|
-
|
1986
|
+
git_vector_dispose(&update_heads);
|
1941
1987
|
return -1;
|
1942
1988
|
|
1943
1989
|
}
|
@@ -2029,7 +2075,7 @@ static int opportunistic_updates(
|
|
2029
2075
|
|
2030
2076
|
git_str_clear(&refname);
|
2031
2077
|
if ((error = git_refspec__transform(&refname, spec, head->name)) < 0 ||
|
2032
|
-
(error = update_ref(remote, refname.ptr, &head->oid, msg, callbacks)) < 0)
|
2078
|
+
(error = update_ref(remote, refname.ptr, &head->oid, spec, msg, callbacks)) < 0)
|
2033
2079
|
goto cleanup;
|
2034
2080
|
}
|
2035
2081
|
|
@@ -2058,11 +2104,11 @@ static int truncate_fetch_head(const char *gitdir)
|
|
2058
2104
|
}
|
2059
2105
|
|
2060
2106
|
int git_remote_update_tips(
|
2061
|
-
|
2062
|
-
|
2063
|
-
|
2064
|
-
|
2065
|
-
|
2107
|
+
git_remote *remote,
|
2108
|
+
const git_remote_callbacks *callbacks,
|
2109
|
+
unsigned int update_flags,
|
2110
|
+
git_remote_autotag_option_t download_tags,
|
2111
|
+
const char *reflog_message)
|
2066
2112
|
{
|
2067
2113
|
git_refspec *spec, tagspec;
|
2068
2114
|
git_vector refs = GIT_VECTOR_INIT;
|
@@ -2091,7 +2137,7 @@ int git_remote_update_tips(
|
|
2091
2137
|
goto out;
|
2092
2138
|
|
2093
2139
|
if (tagopt == GIT_REMOTE_DOWNLOAD_TAGS_ALL) {
|
2094
|
-
if ((error = update_tips_for_spec(remote, callbacks,
|
2140
|
+
if ((error = update_tips_for_spec(remote, callbacks, update_flags, tagopt, &tagspec, &refs, reflog_message)) < 0)
|
2095
2141
|
goto out;
|
2096
2142
|
}
|
2097
2143
|
|
@@ -2099,7 +2145,7 @@ int git_remote_update_tips(
|
|
2099
2145
|
if (spec->push)
|
2100
2146
|
continue;
|
2101
2147
|
|
2102
|
-
if ((error = update_tips_for_spec(remote, callbacks,
|
2148
|
+
if ((error = update_tips_for_spec(remote, callbacks, update_flags, tagopt, spec, &refs, reflog_message)) < 0)
|
2103
2149
|
goto out;
|
2104
2150
|
}
|
2105
2151
|
|
@@ -2108,7 +2154,7 @@ int git_remote_update_tips(
|
|
2108
2154
|
error = opportunistic_updates(remote, callbacks, &refs, reflog_message);
|
2109
2155
|
|
2110
2156
|
out:
|
2111
|
-
|
2157
|
+
git_vector_dispose(&refs);
|
2112
2158
|
git_refspec__dispose(&tagspec);
|
2113
2159
|
return error;
|
2114
2160
|
}
|
@@ -2167,19 +2213,19 @@ void git_remote_free(git_remote *remote)
|
|
2167
2213
|
remote->transport = NULL;
|
2168
2214
|
}
|
2169
2215
|
|
2170
|
-
|
2216
|
+
git_vector_dispose(&remote->refs);
|
2171
2217
|
|
2172
2218
|
free_refspecs(&remote->refspecs);
|
2173
|
-
|
2219
|
+
git_vector_dispose(&remote->refspecs);
|
2174
2220
|
|
2175
2221
|
free_refspecs(&remote->active_refspecs);
|
2176
|
-
|
2222
|
+
git_vector_dispose(&remote->active_refspecs);
|
2177
2223
|
|
2178
2224
|
free_refspecs(&remote->passive_refspecs);
|
2179
|
-
|
2225
|
+
git_vector_dispose(&remote->passive_refspecs);
|
2180
2226
|
|
2181
2227
|
free_heads(&remote->local_heads);
|
2182
|
-
|
2228
|
+
git_vector_dispose(&remote->local_heads);
|
2183
2229
|
|
2184
2230
|
git_push_free(remote->push);
|
2185
2231
|
git__free(remote->url);
|
@@ -2222,7 +2268,7 @@ int git_remote_list(git_strarray *remotes_list, git_repository *repo)
|
|
2222
2268
|
cfg, "^remote\\..*\\.(push)?url$", remote_list_cb, &list);
|
2223
2269
|
|
2224
2270
|
if (error < 0) {
|
2225
|
-
|
2271
|
+
git_vector_dispose_deep(&list);
|
2226
2272
|
return error;
|
2227
2273
|
}
|
2228
2274
|
|
@@ -2503,7 +2549,7 @@ static int rename_fetch_refspecs(git_vector *problems, git_remote *remote, const
|
|
2503
2549
|
git_vector_foreach(problems, i, str)
|
2504
2550
|
git__free(str);
|
2505
2551
|
|
2506
|
-
|
2552
|
+
git_vector_dispose(problems);
|
2507
2553
|
}
|
2508
2554
|
|
2509
2555
|
return error;
|
@@ -2543,7 +2589,7 @@ int git_remote_rename(git_strarray *out, git_repository *repo, const char *name,
|
|
2543
2589
|
|
2544
2590
|
cleanup:
|
2545
2591
|
if (error < 0)
|
2546
|
-
|
2592
|
+
git_vector_dispose(&problem_refspecs);
|
2547
2593
|
|
2548
2594
|
git_remote_free(remote);
|
2549
2595
|
return error;
|
@@ -2582,17 +2628,21 @@ done:
|
|
2582
2628
|
git_refspec *git_remote__matching_refspec(git_remote *remote, const char *refname)
|
2583
2629
|
{
|
2584
2630
|
git_refspec *spec;
|
2631
|
+
git_refspec *match = NULL;
|
2585
2632
|
size_t i;
|
2586
2633
|
|
2587
2634
|
git_vector_foreach(&remote->active_refspecs, i, spec) {
|
2588
2635
|
if (spec->push)
|
2589
2636
|
continue;
|
2590
2637
|
|
2591
|
-
if (
|
2592
|
-
return
|
2638
|
+
if (git_refspec_src_matches_negative(spec, refname))
|
2639
|
+
return NULL;
|
2640
|
+
|
2641
|
+
if (git_refspec_src_matches(spec, refname) && match == NULL)
|
2642
|
+
match = spec;
|
2593
2643
|
}
|
2594
2644
|
|
2595
|
-
return
|
2645
|
+
return match;
|
2596
2646
|
}
|
2597
2647
|
|
2598
2648
|
git_refspec *git_remote__matching_dst_refspec(git_remote *remote, const char *refname)
|
@@ -2650,7 +2700,7 @@ static int copy_refspecs(git_strarray *array, const git_remote *remote, unsigned
|
|
2650
2700
|
return 0;
|
2651
2701
|
|
2652
2702
|
on_error:
|
2653
|
-
|
2703
|
+
git_vector_dispose_deep(&refspecs);
|
2654
2704
|
|
2655
2705
|
return -1;
|
2656
2706
|
}
|
@@ -2798,7 +2848,7 @@ cleanup:
|
|
2798
2848
|
git_vector_foreach(&refs, i, dup) {
|
2799
2849
|
git__free(dup);
|
2800
2850
|
}
|
2801
|
-
|
2851
|
+
git_vector_dispose(&refs);
|
2802
2852
|
return error;
|
2803
2853
|
}
|
2804
2854
|
|
@@ -2967,12 +3017,22 @@ int git_remote_upload(
|
|
2967
3017
|
}
|
2968
3018
|
}
|
2969
3019
|
|
2970
|
-
if (
|
2971
|
-
|
3020
|
+
if (opts && opts->remote_push_options.count > 0)
|
3021
|
+
for (i = 0; i < opts->remote_push_options.count; ++i) {
|
3022
|
+
char *optstr = git__strdup(opts->remote_push_options.strings[i]);
|
3023
|
+
GIT_ERROR_CHECK_ALLOC(optstr);
|
2972
3024
|
|
2973
|
-
|
2974
|
-
|
2975
|
-
|
3025
|
+
if ((error = git_vector_insert(&push->remote_push_options, optstr)) < 0)
|
3026
|
+
goto cleanup;
|
3027
|
+
}
|
3028
|
+
|
3029
|
+
error = git_push_finish(push);
|
3030
|
+
|
3031
|
+
if (connect_opts.callbacks.push_update_reference) {
|
3032
|
+
const int cb_error = git_push_status_foreach(push, connect_opts.callbacks.push_update_reference, connect_opts.callbacks.payload);
|
3033
|
+
if (!error)
|
3034
|
+
error = cb_error;
|
3035
|
+
}
|
2976
3036
|
|
2977
3037
|
cleanup:
|
2978
3038
|
git_remote_connect_options_dispose(&connect_opts);
|