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
@@ -8,12 +8,12 @@
|
|
8
8
|
#include "config_backend.h"
|
9
9
|
|
10
10
|
#include "config.h"
|
11
|
-
#include "
|
11
|
+
#include "config_list.h"
|
12
12
|
|
13
13
|
typedef struct {
|
14
14
|
git_config_backend parent;
|
15
15
|
git_mutex values_mutex;
|
16
|
-
|
16
|
+
git_config_list *config_list;
|
17
17
|
git_config_backend *source;
|
18
18
|
} config_snapshot_backend;
|
19
19
|
|
@@ -28,31 +28,27 @@ static int config_snapshot_iterator(
|
|
28
28
|
struct git_config_backend *backend)
|
29
29
|
{
|
30
30
|
config_snapshot_backend *b = GIT_CONTAINER_OF(backend, config_snapshot_backend, parent);
|
31
|
-
|
31
|
+
git_config_list *config_list = NULL;
|
32
32
|
int error;
|
33
33
|
|
34
|
-
if ((error =
|
35
|
-
(error =
|
34
|
+
if ((error = git_config_list_dup(&config_list, b->config_list)) < 0 ||
|
35
|
+
(error = git_config_list_iterator_new(iter, config_list)) < 0)
|
36
36
|
goto out;
|
37
37
|
|
38
38
|
out:
|
39
|
-
/* Let iterator delete duplicated
|
40
|
-
|
39
|
+
/* Let iterator delete duplicated config_list when it's done */
|
40
|
+
git_config_list_free(config_list);
|
41
41
|
return error;
|
42
42
|
}
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
git_config_entries_free(entries);
|
49
|
-
}
|
50
|
-
|
51
|
-
static int config_snapshot_get(git_config_backend *cfg, const char *key, git_config_entry **out)
|
44
|
+
static int config_snapshot_get(
|
45
|
+
git_config_backend *cfg,
|
46
|
+
const char *key,
|
47
|
+
git_config_backend_entry **out)
|
52
48
|
{
|
53
49
|
config_snapshot_backend *b = GIT_CONTAINER_OF(cfg, config_snapshot_backend, parent);
|
54
|
-
|
55
|
-
|
50
|
+
git_config_list *config_list = NULL;
|
51
|
+
git_config_list_entry *entry;
|
56
52
|
int error = 0;
|
57
53
|
|
58
54
|
if (git_mutex_lock(&b->values_mutex) < 0) {
|
@@ -60,19 +56,16 @@ static int config_snapshot_get(git_config_backend *cfg, const char *key, git_con
|
|
60
56
|
return -1;
|
61
57
|
}
|
62
58
|
|
63
|
-
|
64
|
-
|
59
|
+
config_list = b->config_list;
|
60
|
+
git_config_list_incref(config_list);
|
65
61
|
git_mutex_unlock(&b->values_mutex);
|
66
62
|
|
67
|
-
if ((error = (
|
68
|
-
|
63
|
+
if ((error = (git_config_list_get(&entry, config_list, key))) < 0) {
|
64
|
+
git_config_list_free(config_list);
|
69
65
|
return error;
|
70
66
|
}
|
71
67
|
|
72
|
-
|
73
|
-
entry->payload = entries;
|
74
|
-
*out = entry;
|
75
|
-
|
68
|
+
*out = &entry->base;
|
76
69
|
return 0;
|
77
70
|
}
|
78
71
|
|
@@ -135,7 +128,7 @@ static void config_snapshot_free(git_config_backend *_backend)
|
|
135
128
|
if (backend == NULL)
|
136
129
|
return;
|
137
130
|
|
138
|
-
|
131
|
+
git_config_list_free(backend->config_list);
|
139
132
|
git_mutex_free(&backend->values_mutex);
|
140
133
|
git__free(backend);
|
141
134
|
}
|
@@ -143,7 +136,7 @@ static void config_snapshot_free(git_config_backend *_backend)
|
|
143
136
|
static int config_snapshot_open(git_config_backend *cfg, git_config_level_t level, const git_repository *repo)
|
144
137
|
{
|
145
138
|
config_snapshot_backend *b = GIT_CONTAINER_OF(cfg, config_snapshot_backend, parent);
|
146
|
-
|
139
|
+
git_config_list *config_list = NULL;
|
147
140
|
git_config_iterator *it = NULL;
|
148
141
|
git_config_entry *entry;
|
149
142
|
int error;
|
@@ -152,12 +145,12 @@ static int config_snapshot_open(git_config_backend *cfg, git_config_level_t leve
|
|
152
145
|
GIT_UNUSED(level);
|
153
146
|
GIT_UNUSED(repo);
|
154
147
|
|
155
|
-
if ((error =
|
148
|
+
if ((error = git_config_list_new(&config_list)) < 0 ||
|
156
149
|
(error = b->source->iterator(&it, b->source)) < 0)
|
157
150
|
goto out;
|
158
151
|
|
159
152
|
while ((error = git_config_next(&entry, it)) == 0)
|
160
|
-
if ((error =
|
153
|
+
if ((error = git_config_list_dup_entry(config_list, entry)) < 0)
|
161
154
|
goto out;
|
162
155
|
|
163
156
|
if (error < 0) {
|
@@ -166,12 +159,12 @@ static int config_snapshot_open(git_config_backend *cfg, git_config_level_t leve
|
|
166
159
|
error = 0;
|
167
160
|
}
|
168
161
|
|
169
|
-
b->
|
162
|
+
b->config_list = config_list;
|
170
163
|
|
171
164
|
out:
|
172
165
|
git_config_iterator_free(it);
|
173
166
|
if (error)
|
174
|
-
|
167
|
+
git_config_list_free(config_list);
|
175
168
|
return error;
|
176
169
|
}
|
177
170
|
|
@@ -14,7 +14,6 @@
|
|
14
14
|
#include "buf.h"
|
15
15
|
#include "commit.h"
|
16
16
|
#include "commit_list.h"
|
17
|
-
#include "oidmap.h"
|
18
17
|
#include "refs.h"
|
19
18
|
#include "repository.h"
|
20
19
|
#include "revwalk.h"
|
@@ -22,6 +21,7 @@
|
|
22
21
|
#include "tag.h"
|
23
22
|
#include "vector.h"
|
24
23
|
#include "wildmatch.h"
|
24
|
+
#include "hashmap_oid.h"
|
25
25
|
|
26
26
|
/* Ported from https://github.com/git/git/blob/89dde7882f71f846ccd0359756d27bebc31108de/builtin/describe.c */
|
27
27
|
|
@@ -32,20 +32,22 @@ struct commit_name {
|
|
32
32
|
git_oid sha1;
|
33
33
|
char *path;
|
34
34
|
|
35
|
-
/*
|
35
|
+
/* The original key for the hashmap */
|
36
36
|
git_oid peeled;
|
37
37
|
};
|
38
38
|
|
39
|
-
|
40
|
-
{
|
41
|
-
return git_oidmap_get(map, key);
|
42
|
-
}
|
39
|
+
GIT_HASHMAP_OID_SETUP(git_describe_oidmap, struct commit_name *);
|
43
40
|
|
44
41
|
static struct commit_name *find_commit_name(
|
45
|
-
|
42
|
+
git_describe_oidmap *names,
|
46
43
|
const git_oid *peeled)
|
47
44
|
{
|
48
|
-
|
45
|
+
struct commit_name *result;
|
46
|
+
|
47
|
+
if (git_describe_oidmap_get(&result, names, peeled) == 0)
|
48
|
+
return result;
|
49
|
+
|
50
|
+
return NULL;
|
49
51
|
}
|
50
52
|
|
51
53
|
static int replace_name(
|
@@ -92,7 +94,7 @@ static int replace_name(
|
|
92
94
|
|
93
95
|
static int add_to_known_names(
|
94
96
|
git_repository *repo,
|
95
|
-
|
97
|
+
git_describe_oidmap *names,
|
96
98
|
const char *path,
|
97
99
|
const git_oid *peeled,
|
98
100
|
unsigned int prio,
|
@@ -121,7 +123,7 @@ static int add_to_known_names(
|
|
121
123
|
e->path = git__strdup(path);
|
122
124
|
git_oid_cpy(&e->peeled, peeled);
|
123
125
|
|
124
|
-
if (!found &&
|
126
|
+
if (!found && git_describe_oidmap_put(names, &e->peeled, e) < 0)
|
125
127
|
return -1;
|
126
128
|
}
|
127
129
|
else
|
@@ -174,7 +176,7 @@ struct get_name_data
|
|
174
176
|
{
|
175
177
|
git_describe_options *opts;
|
176
178
|
git_repository *repo;
|
177
|
-
|
179
|
+
git_describe_oidmap names;
|
178
180
|
git_describe_result *result;
|
179
181
|
};
|
180
182
|
|
@@ -240,7 +242,7 @@ static int get_name(const char *refname, void *payload)
|
|
240
242
|
else
|
241
243
|
prio = 0;
|
242
244
|
|
243
|
-
add_to_known_names(data->repo, data->names,
|
245
|
+
add_to_known_names(data->repo, &data->names,
|
244
246
|
all ? refname + strlen(GIT_REFS_DIR) : refname + strlen(GIT_REFS_TAGS_DIR),
|
245
247
|
&peeled, prio, &sha1);
|
246
248
|
return 0;
|
@@ -451,7 +453,7 @@ static int describe(
|
|
451
453
|
|
452
454
|
git_oid_cpy(&data->result->commit_id, git_commit_id(commit));
|
453
455
|
|
454
|
-
n = find_commit_name(data->names, git_commit_id(commit));
|
456
|
+
n = find_commit_name(&data->names, git_commit_id(commit));
|
455
457
|
if (n && (tags || all || n->prio == 2)) {
|
456
458
|
/*
|
457
459
|
* Exact match to an existing ref.
|
@@ -492,7 +494,7 @@ static int describe(
|
|
492
494
|
git_commit_list_node *c = (git_commit_list_node *)git_pqueue_pop(&list);
|
493
495
|
seen_commits++;
|
494
496
|
|
495
|
-
n = find_commit_name(data->names, &c->oid);
|
497
|
+
n = find_commit_name(&data->names, &c->oid);
|
496
498
|
|
497
499
|
if (n) {
|
498
500
|
if (!tags && !all && n->prio < 2) {
|
@@ -627,7 +629,7 @@ cleanup:
|
|
627
629
|
git__free(match);
|
628
630
|
}
|
629
631
|
}
|
630
|
-
|
632
|
+
git_vector_dispose(&all_matches);
|
631
633
|
git_pqueue_free(&list);
|
632
634
|
git_revwalk_free(walk);
|
633
635
|
return error;
|
@@ -653,11 +655,12 @@ int git_describe_commit(
|
|
653
655
|
git_object *committish,
|
654
656
|
git_describe_options *opts)
|
655
657
|
{
|
656
|
-
struct get_name_data data;
|
658
|
+
struct get_name_data data = {0};
|
657
659
|
struct commit_name *name;
|
658
660
|
git_commit *commit;
|
659
|
-
int error = -1;
|
660
661
|
git_describe_options normalized;
|
662
|
+
git_hashmap_iter_t iter = GIT_HASHMAP_INIT;
|
663
|
+
int error = -1;
|
661
664
|
|
662
665
|
GIT_ASSERT_ARG(result);
|
663
666
|
GIT_ASSERT_ARG(committish);
|
@@ -677,9 +680,6 @@ int git_describe_commit(
|
|
677
680
|
"git_describe_options");
|
678
681
|
data.opts = &normalized;
|
679
682
|
|
680
|
-
if ((error = git_oidmap_new(&data.names)) < 0)
|
681
|
-
return error;
|
682
|
-
|
683
683
|
/** TODO: contains to be implemented */
|
684
684
|
|
685
685
|
if ((error = git_object_peel((git_object **)(&commit), committish, GIT_OBJECT_COMMIT)) < 0)
|
@@ -690,7 +690,7 @@ int git_describe_commit(
|
|
690
690
|
get_name, &data)) < 0)
|
691
691
|
goto cleanup;
|
692
692
|
|
693
|
-
if (
|
693
|
+
if (git_describe_oidmap_size(&data.names) == 0 && !normalized.show_commit_oid_as_fallback) {
|
694
694
|
git_error_set(GIT_ERROR_DESCRIBE, "cannot describe - "
|
695
695
|
"no reference found, cannot describe anything.");
|
696
696
|
error = -1;
|
@@ -703,13 +703,13 @@ int git_describe_commit(
|
|
703
703
|
cleanup:
|
704
704
|
git_commit_free(commit);
|
705
705
|
|
706
|
-
|
706
|
+
while (git_describe_oidmap_iterate(&iter, NULL, &name, &data.names) == 0) {
|
707
707
|
git_tag_free(name->tag);
|
708
708
|
git__free(name->path);
|
709
709
|
git__free(name);
|
710
|
-
}
|
710
|
+
}
|
711
711
|
|
712
|
-
|
712
|
+
git_describe_oidmap_dispose(&data.names);
|
713
713
|
|
714
714
|
if (error < 0)
|
715
715
|
git_describe_result_free(data.result);
|
@@ -11,11 +11,11 @@
|
|
11
11
|
|
12
12
|
#include "common.h"
|
13
13
|
#include "diff.h"
|
14
|
-
#include "strmap.h"
|
15
14
|
#include "map.h"
|
16
15
|
#include "config.h"
|
17
16
|
#include "regexp.h"
|
18
17
|
#include "repository.h"
|
18
|
+
#include "userdiff.h"
|
19
19
|
|
20
20
|
typedef enum {
|
21
21
|
DIFF_DRIVER_AUTO = 0,
|
@@ -43,10 +43,10 @@ struct git_diff_driver {
|
|
43
43
|
char name[GIT_FLEX_ARRAY];
|
44
44
|
};
|
45
45
|
|
46
|
-
|
46
|
+
GIT_HASHMAP_STR_SETUP(git_diff_driver_map, git_diff_driver *);
|
47
47
|
|
48
48
|
struct git_diff_driver_registry {
|
49
|
-
|
49
|
+
git_diff_driver_map map;
|
50
50
|
};
|
51
51
|
|
52
52
|
#define FORCE_DIFFABLE (GIT_DIFF_FORCE_TEXT | GIT_DIFF_FORCE_BINARY)
|
@@ -57,28 +57,21 @@ static git_diff_driver diff_driver_text = { DIFF_DRIVER_TEXT, GIT_DIFF_FORCE
|
|
57
57
|
|
58
58
|
git_diff_driver_registry *git_diff_driver_registry_new(void)
|
59
59
|
{
|
60
|
-
|
61
|
-
git__calloc(1, sizeof(git_diff_driver_registry));
|
62
|
-
if (!reg)
|
63
|
-
return NULL;
|
64
|
-
|
65
|
-
if (git_strmap_new(®->drivers) < 0) {
|
66
|
-
git_diff_driver_registry_free(reg);
|
67
|
-
return NULL;
|
68
|
-
}
|
69
|
-
|
70
|
-
return reg;
|
60
|
+
return git__calloc(1, sizeof(git_diff_driver_registry));
|
71
61
|
}
|
72
62
|
|
73
63
|
void git_diff_driver_registry_free(git_diff_driver_registry *reg)
|
74
64
|
{
|
75
65
|
git_diff_driver *drv;
|
66
|
+
git_hashmap_iter_t iter = 0;
|
76
67
|
|
77
68
|
if (!reg)
|
78
69
|
return;
|
79
70
|
|
80
|
-
|
81
|
-
|
71
|
+
while (git_diff_driver_map_iterate(&iter, NULL, &drv, ®->map) == 0)
|
72
|
+
git_diff_driver_free(drv);
|
73
|
+
|
74
|
+
git_diff_driver_map_dispose(®->map);
|
82
75
|
git__free(reg);
|
83
76
|
}
|
84
77
|
|
@@ -215,7 +208,7 @@ static int git_diff_driver_builtin(
|
|
215
208
|
(error = git_regexp_compile(&drv->word_pattern, ddef->words, ddef->flags)) < 0)
|
216
209
|
goto done;
|
217
210
|
|
218
|
-
if ((error =
|
211
|
+
if ((error = git_diff_driver_map_put(®->map, drv->name, drv)) < 0)
|
219
212
|
goto done;
|
220
213
|
|
221
214
|
done:
|
@@ -242,7 +235,7 @@ static int git_diff_driver_load(
|
|
242
235
|
if ((reg = git_repository_driver_registry(repo)) == NULL)
|
243
236
|
return -1;
|
244
237
|
|
245
|
-
if ((drv
|
238
|
+
if (git_diff_driver_map_get(&drv, ®->map, driver_name) == 0) {
|
246
239
|
*out = drv;
|
247
240
|
return 0;
|
248
241
|
}
|
@@ -331,7 +324,7 @@ static int git_diff_driver_load(
|
|
331
324
|
goto done;
|
332
325
|
|
333
326
|
/* store driver in registry */
|
334
|
-
if ((error =
|
327
|
+
if ((error = git_diff_driver_map_put(®->map, drv->name, drv)) < 0)
|
335
328
|
goto done;
|
336
329
|
|
337
330
|
*out = drv;
|
@@ -11,14 +11,14 @@
|
|
11
11
|
|
12
12
|
#include "attr_file.h"
|
13
13
|
#include "str.h"
|
14
|
+
#include "hashmap.h"
|
14
15
|
|
16
|
+
typedef struct git_diff_driver git_diff_driver;
|
15
17
|
typedef struct git_diff_driver_registry git_diff_driver_registry;
|
16
18
|
|
17
19
|
git_diff_driver_registry *git_diff_driver_registry_new(void);
|
18
20
|
void git_diff_driver_registry_free(git_diff_driver_registry *);
|
19
21
|
|
20
|
-
typedef struct git_diff_driver git_diff_driver;
|
21
|
-
|
22
22
|
int git_diff_driver_lookup(git_diff_driver **, git_repository *,
|
23
23
|
git_attr_session *attrsession, const char *);
|
24
24
|
void git_diff_driver_free(git_diff_driver *);
|
@@ -429,7 +429,7 @@ static void diff_generated_free(git_diff *d)
|
|
429
429
|
git_diff_generated *diff = (git_diff_generated *)d;
|
430
430
|
|
431
431
|
git_attr_session__free(&diff->base.attrsession);
|
432
|
-
|
432
|
+
git_vector_dispose_deep(&diff->base.deltas);
|
433
433
|
|
434
434
|
git_pathspec__vfree(&diff->pathspec);
|
435
435
|
git_pool_clear(&diff->base.pool);
|
@@ -729,7 +729,7 @@ typedef struct {
|
|
729
729
|
git_iterator *new_iter;
|
730
730
|
const git_index_entry *oitem;
|
731
731
|
const git_index_entry *nitem;
|
732
|
-
|
732
|
+
git_submodule_cache *submodule_cache;
|
733
733
|
bool submodule_cache_initialized;
|
734
734
|
} diff_in_progress;
|
735
735
|
|
@@ -745,7 +745,7 @@ static int maybe_modified_submodule(
|
|
745
745
|
git_submodule *sub;
|
746
746
|
unsigned int sm_status = 0;
|
747
747
|
git_submodule_ignore_t ign = diff->base.opts.ignore_submodules;
|
748
|
-
|
748
|
+
git_submodule_cache *submodule_cache = NULL;
|
749
749
|
|
750
750
|
*status = GIT_DELTA_UNMODIFIED;
|
751
751
|
|
@@ -20,9 +20,9 @@ static void diff_parsed_free(git_diff *d)
|
|
20
20
|
git_vector_foreach(&diff->patches, i, patch)
|
21
21
|
git_patch_free(patch);
|
22
22
|
|
23
|
-
|
23
|
+
git_vector_dispose(&diff->patches);
|
24
24
|
|
25
|
-
|
25
|
+
git_vector_dispose(&diff->base.deltas);
|
26
26
|
git_pool_clear(&diff->base.pool);
|
27
27
|
|
28
28
|
git__memzero(diff, sizeof(*diff));
|
@@ -15,6 +15,7 @@
|
|
15
15
|
#include "zstream.h"
|
16
16
|
#include "blob.h"
|
17
17
|
#include "delta.h"
|
18
|
+
#include "repository.h"
|
18
19
|
#include "git2/sys/diff.h"
|
19
20
|
|
20
21
|
typedef struct {
|
@@ -29,6 +30,7 @@ typedef struct {
|
|
29
30
|
const char *new_prefix;
|
30
31
|
uint32_t flags;
|
31
32
|
int id_strlen;
|
33
|
+
unsigned int sent_file_header;
|
32
34
|
git_oid_t oid_type;
|
33
35
|
|
34
36
|
int (*strcomp)(const char *, const char *);
|
@@ -52,14 +54,10 @@ static int diff_print_info_init__common(
|
|
52
54
|
if (!pi->id_strlen) {
|
53
55
|
if (!repo)
|
54
56
|
pi->id_strlen = GIT_ABBREV_DEFAULT;
|
55
|
-
else if (
|
57
|
+
else if (git_repository__abbrev_length(&pi->id_strlen, repo) < 0)
|
56
58
|
return -1;
|
57
59
|
}
|
58
60
|
|
59
|
-
if (pi->id_strlen > 0 &&
|
60
|
-
(size_t)pi->id_strlen > git_oid_hexsize(pi->oid_type))
|
61
|
-
pi->id_strlen = (int)git_oid_hexsize(pi->oid_type);
|
62
|
-
|
63
61
|
memset(&pi->line, 0, sizeof(pi->line));
|
64
62
|
pi->line.old_lineno = -1;
|
65
63
|
pi->line.new_lineno = -1;
|
@@ -579,6 +577,30 @@ static int diff_print_patch_file_binary(
|
|
579
577
|
return error;
|
580
578
|
}
|
581
579
|
|
580
|
+
GIT_INLINE(int) should_force_header(const git_diff_delta *delta)
|
581
|
+
{
|
582
|
+
if (delta->old_file.mode != delta->new_file.mode)
|
583
|
+
return 1;
|
584
|
+
|
585
|
+
if (delta->status == GIT_DELTA_RENAMED || delta->status == GIT_DELTA_COPIED)
|
586
|
+
return 1;
|
587
|
+
|
588
|
+
return 0;
|
589
|
+
}
|
590
|
+
|
591
|
+
GIT_INLINE(int) flush_file_header(const git_diff_delta *delta, diff_print_info *pi)
|
592
|
+
{
|
593
|
+
if (pi->sent_file_header)
|
594
|
+
return 0;
|
595
|
+
|
596
|
+
pi->line.origin = GIT_DIFF_LINE_FILE_HDR;
|
597
|
+
pi->line.content = git_str_cstr(pi->buf);
|
598
|
+
pi->line.content_len = git_str_len(pi->buf);
|
599
|
+
pi->sent_file_header = 1;
|
600
|
+
|
601
|
+
return pi->print_cb(delta, NULL, &pi->line, pi->payload);
|
602
|
+
}
|
603
|
+
|
582
604
|
static int diff_print_patch_file(
|
583
605
|
const git_diff_delta *delta, float progress, void *data)
|
584
606
|
{
|
@@ -609,15 +631,22 @@ static int diff_print_patch_file(
|
|
609
631
|
(pi->flags & GIT_DIFF_SHOW_UNTRACKED_CONTENT) == 0))
|
610
632
|
return 0;
|
611
633
|
|
634
|
+
pi->sent_file_header = 0;
|
635
|
+
|
612
636
|
if ((error = git_diff_delta__format_file_header(pi->buf, delta, oldpfx, newpfx,
|
613
637
|
id_strlen, print_index)) < 0)
|
614
638
|
return error;
|
615
639
|
|
616
|
-
|
617
|
-
|
618
|
-
|
640
|
+
/*
|
641
|
+
* pi->buf now contains the file header data. Go ahead and send it
|
642
|
+
* if there's useful data in there, like similarity. Otherwise, we
|
643
|
+
* should queue it to send when we see the first hunk. This prevents
|
644
|
+
* us from sending a header when all hunks were ignored.
|
645
|
+
*/
|
646
|
+
if (should_force_header(delta) && (error = flush_file_header(delta, pi)) < 0)
|
647
|
+
return error;
|
619
648
|
|
620
|
-
return
|
649
|
+
return 0;
|
621
650
|
}
|
622
651
|
|
623
652
|
static int diff_print_patch_binary(
|
@@ -632,6 +661,16 @@ static int diff_print_patch_binary(
|
|
632
661
|
pi->new_prefix ? pi->new_prefix : DIFF_NEW_PREFIX_DEFAULT;
|
633
662
|
int error;
|
634
663
|
|
664
|
+
if ((error = flush_file_header(delta, pi)) < 0)
|
665
|
+
return error;
|
666
|
+
|
667
|
+
/*
|
668
|
+
* If the caller only wants the header, we just needed to make sure to
|
669
|
+
* call flush_file_header
|
670
|
+
*/
|
671
|
+
if (pi->format == GIT_DIFF_FORMAT_PATCH_HEADER)
|
672
|
+
return 0;
|
673
|
+
|
635
674
|
git_str_clear(pi->buf);
|
636
675
|
|
637
676
|
if ((error = diff_print_patch_file_binary(
|
@@ -651,10 +690,21 @@ static int diff_print_patch_hunk(
|
|
651
690
|
void *data)
|
652
691
|
{
|
653
692
|
diff_print_info *pi = data;
|
693
|
+
int error;
|
654
694
|
|
655
695
|
if (S_ISDIR(d->new_file.mode))
|
656
696
|
return 0;
|
657
697
|
|
698
|
+
if ((error = flush_file_header(d, pi)) < 0)
|
699
|
+
return error;
|
700
|
+
|
701
|
+
/*
|
702
|
+
* If the caller only wants the header, we just needed to make sure to
|
703
|
+
* call flush_file_header
|
704
|
+
*/
|
705
|
+
if (pi->format == GIT_DIFF_FORMAT_PATCH_HEADER)
|
706
|
+
return 0;
|
707
|
+
|
658
708
|
pi->line.origin = GIT_DIFF_LINE_HUNK_HDR;
|
659
709
|
pi->line.content = h->header;
|
660
710
|
pi->line.content_len = h->header_len;
|
@@ -669,10 +719,14 @@ static int diff_print_patch_line(
|
|
669
719
|
void *data)
|
670
720
|
{
|
671
721
|
diff_print_info *pi = data;
|
722
|
+
int error;
|
672
723
|
|
673
724
|
if (S_ISDIR(delta->new_file.mode))
|
674
725
|
return 0;
|
675
726
|
|
727
|
+
if ((error = flush_file_header(delta, pi)) < 0)
|
728
|
+
return error;
|
729
|
+
|
676
730
|
return pi->print_cb(delta, hunk, line, pi->payload);
|
677
731
|
}
|
678
732
|
|
@@ -705,6 +759,8 @@ int git_diff_print(
|
|
705
759
|
break;
|
706
760
|
case GIT_DIFF_FORMAT_PATCH_HEADER:
|
707
761
|
print_file = diff_print_patch_file;
|
762
|
+
print_binary = diff_print_patch_binary;
|
763
|
+
print_hunk = diff_print_patch_hunk;
|
708
764
|
break;
|
709
765
|
case GIT_DIFF_FORMAT_RAW:
|
710
766
|
print_file = diff_print_one_raw;
|
@@ -190,7 +190,7 @@ int git_diff__merge(
|
|
190
190
|
git_pool_strdup_safe(&onto->pool, onto->opts.new_prefix);
|
191
191
|
}
|
192
192
|
|
193
|
-
|
193
|
+
git_vector_dispose_deep(&onto_new);
|
194
194
|
git_pool_clear(&onto_pool);
|
195
195
|
|
196
196
|
return error;
|
@@ -424,13 +424,13 @@ static int apply_splits_and_deletes(
|
|
424
424
|
|
425
425
|
/* swap new delta list into place */
|
426
426
|
git_vector_swap(&diff->deltas, &onto);
|
427
|
-
|
427
|
+
git_vector_dispose(&onto);
|
428
428
|
git_vector_sort(&diff->deltas);
|
429
429
|
|
430
430
|
return 0;
|
431
431
|
|
432
432
|
on_error:
|
433
|
-
|
433
|
+
git_vector_dispose_deep(&onto);
|
434
434
|
|
435
435
|
return -1;
|
436
436
|
}
|
@@ -653,6 +653,23 @@ static int calc_self_similarity(
|
|
653
653
|
return 0;
|
654
654
|
}
|
655
655
|
|
656
|
+
static void handle_non_blob(
|
657
|
+
git_diff *diff,
|
658
|
+
const git_diff_find_options *opts,
|
659
|
+
size_t delta_idx)
|
660
|
+
{
|
661
|
+
git_diff_delta *delta = GIT_VECTOR_GET(&diff->deltas, delta_idx);
|
662
|
+
|
663
|
+
/* skip things that are blobs */
|
664
|
+
if (GIT_MODE_ISBLOB(delta->old_file.mode))
|
665
|
+
return;
|
666
|
+
|
667
|
+
/* honor "remove unmodified" flag for non-blobs (eg submodules) */
|
668
|
+
if (delta->status == GIT_DELTA_UNMODIFIED &&
|
669
|
+
FLAG_SET(opts, GIT_DIFF_FIND_REMOVE_UNMODIFIED))
|
670
|
+
delta->flags |= GIT_DIFF_FLAG__TO_DELETE;
|
671
|
+
}
|
672
|
+
|
656
673
|
static bool is_rename_target(
|
657
674
|
git_diff *diff,
|
658
675
|
const git_diff_find_options *opts,
|
@@ -810,7 +827,8 @@ int git_diff_find_similar(
|
|
810
827
|
git_diff_find_options opts = GIT_DIFF_FIND_OPTIONS_INIT;
|
811
828
|
size_t num_deltas, num_srcs = 0, num_tgts = 0;
|
812
829
|
size_t tried_srcs = 0, tried_tgts = 0;
|
813
|
-
size_t num_rewrites = 0, num_updates = 0, num_bumped = 0
|
830
|
+
size_t num_rewrites = 0, num_updates = 0, num_bumped = 0,
|
831
|
+
num_to_delete = 0;
|
814
832
|
size_t sigcache_size;
|
815
833
|
void **sigcache = NULL; /* cache of similarity metric file signatures */
|
816
834
|
diff_find_match *tgt2src = NULL;
|
@@ -844,6 +862,8 @@ int git_diff_find_similar(
|
|
844
862
|
* mark them for splitting if break-rewrites is enabled
|
845
863
|
*/
|
846
864
|
git_vector_foreach(&diff->deltas, t, tgt) {
|
865
|
+
handle_non_blob(diff, &opts, t);
|
866
|
+
|
847
867
|
if (is_rename_source(diff, &opts, t, sigcache))
|
848
868
|
++num_srcs;
|
849
869
|
|
@@ -852,11 +872,14 @@ int git_diff_find_similar(
|
|
852
872
|
|
853
873
|
if ((tgt->flags & GIT_DIFF_FLAG__TO_SPLIT) != 0)
|
854
874
|
num_rewrites++;
|
875
|
+
|
876
|
+
if ((tgt->flags & GIT_DIFF_FLAG__TO_DELETE) != 0)
|
877
|
+
num_to_delete++;
|
855
878
|
}
|
856
879
|
|
857
|
-
/*
|
880
|
+
/* If there are no candidate srcs or tgts, no need to find matches */
|
858
881
|
if (!num_srcs || !num_tgts)
|
859
|
-
goto
|
882
|
+
goto split_and_delete;
|
860
883
|
|
861
884
|
src2tgt = git__calloc(num_deltas, sizeof(diff_find_match));
|
862
885
|
GIT_ERROR_CHECK_ALLOC(src2tgt);
|
@@ -1093,15 +1116,20 @@ find_best_matches:
|
|
1093
1116
|
}
|
1094
1117
|
}
|
1095
1118
|
|
1119
|
+
split_and_delete:
|
1096
1120
|
/*
|
1097
1121
|
* Actually split and delete entries as needed
|
1098
1122
|
*/
|
1099
1123
|
|
1100
|
-
if (num_rewrites > 0 || num_updates > 0)
|
1124
|
+
if (num_rewrites > 0 || num_updates > 0 || num_to_delete > 0) {
|
1125
|
+
size_t apply_len = diff->deltas.length -
|
1126
|
+
num_rewrites - num_to_delete;
|
1127
|
+
|
1101
1128
|
error = apply_splits_and_deletes(
|
1102
|
-
diff,
|
1129
|
+
diff, apply_len,
|
1103
1130
|
FLAG_SET(&opts, GIT_DIFF_BREAK_REWRITES) &&
|
1104
1131
|
!FLAG_SET(&opts, GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY));
|
1132
|
+
}
|
1105
1133
|
|
1106
1134
|
cleanup:
|
1107
1135
|
git__free(tgt2src);
|