rugged 1.6.3 → 1.9.0
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/ext/rugged/rugged_allocator.c +0 -54
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/AUTHORS +1 -0
- data/vendor/libgit2/CMakeLists.txt +25 -17
- data/vendor/libgit2/COPYING +195 -1
- data/vendor/libgit2/cmake/CheckPrototypeDefinitionSafe.cmake +16 -0
- data/vendor/libgit2/cmake/{FindIconv.cmake → FindIntlIconv.cmake} +6 -0
- data/vendor/libgit2/cmake/FindLLHTTP.cmake +39 -0
- data/vendor/libgit2/cmake/SelectGSSAPI.cmake +4 -4
- data/vendor/libgit2/cmake/SelectHTTPParser.cmake +23 -8
- data/vendor/libgit2/cmake/SelectHTTPSBackend.cmake +34 -6
- data/vendor/libgit2/cmake/SelectHashes.cmake +32 -11
- data/vendor/libgit2/cmake/SelectRegex.cmake +6 -1
- data/vendor/libgit2/cmake/SelectSSH.cmake +22 -17
- data/vendor/libgit2/cmake/SelectXdiff.cmake +9 -0
- 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/pcre/LICENCE +5 -5
- data/vendor/libgit2/deps/pcre/pcre.h +2 -2
- data/vendor/libgit2/deps/pcre/pcre_compile.c +6 -3
- data/vendor/libgit2/deps/pcre/pcre_exec.c +2 -2
- data/vendor/libgit2/deps/xdiff/CMakeLists.txt +28 -0
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/git-xdiff.h +4 -1
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xdiffi.c +19 -18
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xdiffi.h +2 -4
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xemit.c +3 -3
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xhistogram.c +7 -18
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xmacros.h +18 -1
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xmerge.c +22 -20
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xpatience.c +21 -30
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xprepare.c +13 -30
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xutils.c +18 -1
- data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xutils.h +2 -1
- 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 +138 -56
- 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 +77 -9
- data/vendor/libgit2/include/git2/email.h +9 -29
- data/vendor/libgit2/include/git2/errors.h +49 -74
- 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 +100 -6
- 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 +24 -25
- 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 +112 -18
- data/vendor/libgit2/include/git2/repository.h +61 -15
- 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 -34
- data/vendor/libgit2/include/git2/sys/commit.h +77 -3
- data/vendor/libgit2/include/git2/sys/commit_graph.h +109 -58
- 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 +47 -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 +25 -2
- data/vendor/libgit2/include/git2/sys/transport.h +44 -5
- 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 +19 -7
- data/vendor/libgit2/src/CMakeLists.txt +40 -15
- 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 +27 -13
- 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 +60 -10
- data/vendor/libgit2/src/cli/progress.h +16 -4
- 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 +27 -27
- data/vendor/libgit2/src/libgit2/annotated_commit.c +2 -2
- data/vendor/libgit2/src/libgit2/annotated_commit.h +1 -1
- data/vendor/libgit2/src/libgit2/apply.c +14 -16
- 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 +152 -59
- data/vendor/libgit2/src/libgit2/blame.h +1 -0
- data/vendor/libgit2/src/libgit2/blame_git.c +0 -1
- data/vendor/libgit2/src/libgit2/branch.c +2 -2
- 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 +4 -5
- data/vendor/libgit2/src/libgit2/clone.c +186 -164
- data/vendor/libgit2/src/libgit2/clone.h +4 -1
- data/vendor/libgit2/src/libgit2/commit.c +123 -9
- data/vendor/libgit2/src/libgit2/commit_graph.c +166 -88
- data/vendor/libgit2/src/libgit2/commit_graph.h +21 -6
- data/vendor/libgit2/src/libgit2/commit_list.c +12 -5
- data/vendor/libgit2/src/libgit2/commit_list.h +1 -0
- data/vendor/libgit2/src/libgit2/config.c +394 -300
- 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 +113 -96
- 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 +34 -31
- data/vendor/libgit2/src/libgit2/diff.c +17 -8
- data/vendor/libgit2/src/libgit2/diff.h +6 -6
- 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_file.c +7 -7
- data/vendor/libgit2/src/libgit2/diff_generate.c +39 -18
- data/vendor/libgit2/src/libgit2/diff_parse.c +22 -6
- data/vendor/libgit2/src/libgit2/diff_print.c +88 -13
- data/vendor/libgit2/src/libgit2/diff_tform.c +40 -12
- data/vendor/libgit2/src/libgit2/diff_xdiff.h +1 -1
- data/vendor/libgit2/src/libgit2/email.c +5 -3
- data/vendor/libgit2/src/libgit2/fetch.c +39 -9
- data/vendor/libgit2/src/libgit2/fetch.h +0 -2
- data/vendor/libgit2/src/libgit2/fetchhead.c +11 -9
- 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 +270 -0
- data/vendor/libgit2/src/libgit2/grafts.h +35 -0
- data/vendor/libgit2/src/libgit2/graph.c +1 -1
- data/vendor/libgit2/src/libgit2/hashmap_oid.h +30 -0
- data/vendor/libgit2/src/libgit2/ident.c +3 -3
- data/vendor/libgit2/src/libgit2/ignore.c +9 -5
- data/vendor/libgit2/src/libgit2/index.c +392 -208
- data/vendor/libgit2/src/libgit2/index.h +16 -3
- 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 +44 -41
- data/vendor/libgit2/src/libgit2/iterator.c +34 -13
- data/vendor/libgit2/src/libgit2/iterator.h +3 -0
- data/vendor/libgit2/src/libgit2/libgit2.c +155 -331
- data/vendor/libgit2/src/libgit2/mailmap.c +1 -1
- data/vendor/libgit2/src/libgit2/merge.c +56 -46
- data/vendor/libgit2/src/libgit2/merge_driver.c +2 -2
- data/vendor/libgit2/src/libgit2/merge_file.c +0 -2
- data/vendor/libgit2/src/libgit2/midx.c +86 -44
- data/vendor/libgit2/src/libgit2/midx.h +13 -3
- data/vendor/libgit2/src/libgit2/mwindow.c +38 -45
- data/vendor/libgit2/src/libgit2/mwindow.h +4 -0
- data/vendor/libgit2/src/libgit2/notes.c +9 -8
- data/vendor/libgit2/src/libgit2/object.c +42 -16
- data/vendor/libgit2/src/libgit2/object.h +6 -0
- data/vendor/libgit2/src/libgit2/odb.c +16 -9
- data/vendor/libgit2/src/libgit2/odb_mempack.c +49 -17
- data/vendor/libgit2/src/libgit2/odb_pack.c +28 -7
- data/vendor/libgit2/src/libgit2/oid.c +35 -2
- data/vendor/libgit2/src/libgit2/oid.h +11 -0
- data/vendor/libgit2/src/libgit2/oidarray.c +49 -3
- data/vendor/libgit2/src/libgit2/oidarray.h +5 -1
- data/vendor/libgit2/src/libgit2/pack-objects.c +77 -43
- data/vendor/libgit2/src/libgit2/pack-objects.h +17 -6
- data/vendor/libgit2/src/libgit2/pack.c +33 -27
- data/vendor/libgit2/src/libgit2/pack.h +15 -10
- data/vendor/libgit2/src/libgit2/parse.c +7 -4
- data/vendor/libgit2/src/libgit2/parse.h +1 -1
- data/vendor/libgit2/src/libgit2/patch.h +7 -1
- data/vendor/libgit2/src/libgit2/patch_generate.c +24 -5
- data/vendor/libgit2/src/libgit2/patch_parse.c +18 -10
- 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 +81 -30
- data/vendor/libgit2/src/libgit2/push.h +1 -0
- data/vendor/libgit2/src/libgit2/reader.c +1 -1
- data/vendor/libgit2/src/libgit2/rebase.c +72 -84
- data/vendor/libgit2/src/libgit2/refdb_fs.c +146 -70
- 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 +34 -8
- 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 +136 -67
- data/vendor/libgit2/src/libgit2/remote.h +1 -0
- data/vendor/libgit2/src/libgit2/repository.c +789 -330
- data/vendor/libgit2/src/libgit2/repository.h +22 -3
- data/vendor/libgit2/src/libgit2/reset.c +2 -2
- data/vendor/libgit2/src/libgit2/revert.c +9 -13
- data/vendor/libgit2/src/libgit2/revparse.c +6 -3
- data/vendor/libgit2/src/libgit2/revwalk.c +36 -11
- 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/stash.c +9 -8
- data/vendor/libgit2/src/libgit2/status.c +1 -1
- data/vendor/libgit2/src/libgit2/streams/mbedtls.c +54 -61
- data/vendor/libgit2/src/libgit2/streams/openssl.c +40 -23
- 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/schannel.c +715 -0
- data/vendor/libgit2/src/libgit2/streams/schannel.h +28 -0
- data/vendor/libgit2/src/libgit2/streams/socket.c +237 -51
- data/vendor/libgit2/src/libgit2/streams/socket.h +3 -1
- data/vendor/libgit2/src/libgit2/streams/stransport.c +79 -19
- data/vendor/libgit2/src/libgit2/streams/tls.c +5 -0
- data/vendor/libgit2/src/libgit2/submodule.c +106 -63
- data/vendor/libgit2/src/libgit2/submodule.h +9 -10
- 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/auth.h +1 -2
- data/vendor/libgit2/src/libgit2/transports/{auth_negotiate.c → auth_gssapi.c} +32 -32
- data/vendor/libgit2/src/libgit2/transports/auth_negotiate.h +1 -1
- data/vendor/libgit2/src/libgit2/transports/auth_ntlm.h +1 -1
- data/vendor/libgit2/src/libgit2/transports/{auth_ntlm.c → auth_ntlmclient.c} +12 -12
- data/vendor/libgit2/src/libgit2/transports/auth_sspi.c +341 -0
- data/vendor/libgit2/src/libgit2/transports/credential.c +1 -1
- data/vendor/libgit2/src/libgit2/transports/git.c +7 -8
- data/vendor/libgit2/src/libgit2/transports/http.c +8 -4
- data/vendor/libgit2/src/libgit2/transports/http.h +0 -10
- data/vendor/libgit2/src/libgit2/transports/httpclient.c +117 -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 +21 -11
- data/vendor/libgit2/src/libgit2/transports/smart.c +50 -32
- data/vendor/libgit2/src/libgit2/transports/smart.h +26 -9
- data/vendor/libgit2/src/libgit2/transports/smart_pkt.c +139 -18
- data/vendor/libgit2/src/libgit2/transports/smart_protocol.c +209 -57
- 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 +48 -21
- data/vendor/libgit2/src/libgit2/tree-cache.c +26 -16
- data/vendor/libgit2/src/libgit2/tree-cache.h +5 -3
- data/vendor/libgit2/src/libgit2/tree.c +35 -27
- data/vendor/libgit2/src/libgit2/tree.h +3 -2
- data/vendor/libgit2/src/libgit2/worktree.c +39 -27
- data/vendor/libgit2/src/util/CMakeLists.txt +4 -6
- data/vendor/libgit2/src/util/alloc.c +69 -7
- data/vendor/libgit2/src/util/alloc.h +34 -9
- 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/failalloc.c +0 -60
- data/vendor/libgit2/src/util/allocators/failalloc.h +0 -6
- data/vendor/libgit2/src/util/allocators/stdalloc.c +2 -115
- data/vendor/libgit2/src/util/allocators/win32_leakcheck.c +0 -68
- data/vendor/libgit2/src/util/array.h +24 -18
- data/vendor/libgit2/src/util/cc-compat.h +4 -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/filebuf.c +6 -1
- data/vendor/libgit2/src/util/filebuf.h +19 -6
- data/vendor/libgit2/src/util/fs_path.c +16 -5
- data/vendor/libgit2/src/util/fs_path.h +23 -0
- data/vendor/libgit2/src/util/futils.c +14 -10
- data/vendor/libgit2/src/util/futils.h +13 -4
- data/vendor/libgit2/src/util/git2_features.h.in +21 -4
- 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 +318 -161
- data/vendor/libgit2/src/util/net.h +27 -0
- data/vendor/libgit2/src/util/pool.c +1 -1
- data/vendor/libgit2/src/util/pool.h +5 -0
- data/vendor/libgit2/src/util/posix.c +54 -0
- data/vendor/libgit2/src/util/posix.h +22 -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 +6 -10
- 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/staticstr.h +66 -0
- 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 +17 -12
- data/vendor/libgit2/src/util/util.h +28 -54
- data/vendor/libgit2/src/util/vector.c +3 -3
- data/vendor/libgit2/src/util/vector.h +2 -2
- data/vendor/libgit2/src/util/win32/error.c +1 -1
- data/vendor/libgit2/src/util/win32/path_w32.c +8 -8
- data/vendor/libgit2/src/util/win32/posix_w32.c +30 -7
- data/vendor/libgit2/src/util/win32/process.c +506 -0
- data/vendor/libgit2/src/util/win32/utf-conv.c +73 -75
- data/vendor/libgit2/src/util/win32/utf-conv.h +81 -14
- data/vendor/libgit2/src/util/win32/w32_util.c +1 -1
- metadata +72 -49
- data/vendor/libgit2/cmake/SelectWinHTTP.cmake +0 -17
- 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 -238
- 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/netops.c +0 -124
- data/vendor/libgit2/src/libgit2/netops.h +0 -68
- 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 -84
- data/vendor/libgit2/src/libgit2/threadstate.h +0 -24
- 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
- /data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xdiff.h +0 -0
- /data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xemit.h +0 -0
- /data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xinclude.h +0 -0
- /data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xprepare.h +0 -0
- /data/vendor/libgit2/{src/libgit2 → deps}/xdiff/xtypes.h +0 -0
@@ -61,8 +61,8 @@ static git_diff_delta *diff_delta__alloc(
|
|
61
61
|
}
|
62
62
|
delta->status = status;
|
63
63
|
|
64
|
-
git_oid_clear(&delta->old_file.id,
|
65
|
-
git_oid_clear(&delta->new_file.id,
|
64
|
+
git_oid_clear(&delta->old_file.id, diff->base.opts.oid_type);
|
65
|
+
git_oid_clear(&delta->new_file.id, diff->base.opts.oid_type);
|
66
66
|
|
67
67
|
return delta;
|
68
68
|
}
|
@@ -149,10 +149,13 @@ static int diff_delta__from_one(
|
|
149
149
|
const git_index_entry *entry = nitem;
|
150
150
|
bool has_old = false;
|
151
151
|
git_diff_delta *delta;
|
152
|
+
git_oid_t oid_type;
|
152
153
|
const char *matched_pathspec;
|
153
154
|
|
154
155
|
GIT_ASSERT_ARG((oitem != NULL) ^ (nitem != NULL));
|
155
156
|
|
157
|
+
oid_type = diff->base.opts.oid_type;
|
158
|
+
|
156
159
|
if (oitem) {
|
157
160
|
entry = oitem;
|
158
161
|
has_old = true;
|
@@ -186,20 +189,23 @@ static int diff_delta__from_one(
|
|
186
189
|
GIT_ASSERT(status != GIT_DELTA_MODIFIED);
|
187
190
|
delta->nfiles = 1;
|
188
191
|
|
192
|
+
git_oid_clear(&delta->old_file.id, diff->base.opts.oid_type);
|
193
|
+
git_oid_clear(&delta->new_file.id, diff->base.opts.oid_type);
|
194
|
+
|
189
195
|
if (has_old) {
|
190
196
|
delta->old_file.mode = entry->mode;
|
191
197
|
delta->old_file.size = entry->file_size;
|
192
198
|
delta->old_file.flags |= GIT_DIFF_FLAG_EXISTS;
|
193
199
|
git_oid_cpy(&delta->old_file.id, &entry->id);
|
194
|
-
git_oid_clear(&delta->new_file.id,
|
195
|
-
delta->old_file.id_abbrev =
|
200
|
+
git_oid_clear(&delta->new_file.id, oid_type);
|
201
|
+
delta->old_file.id_abbrev = (uint16_t)git_oid_hexsize(oid_type);
|
196
202
|
} else /* ADDED, IGNORED, UNTRACKED */ {
|
197
203
|
delta->new_file.mode = entry->mode;
|
198
204
|
delta->new_file.size = entry->file_size;
|
199
205
|
delta->new_file.flags |= GIT_DIFF_FLAG_EXISTS;
|
200
|
-
git_oid_clear(&delta->old_file.id,
|
206
|
+
git_oid_clear(&delta->old_file.id, oid_type);
|
201
207
|
git_oid_cpy(&delta->new_file.id, &entry->id);
|
202
|
-
delta->new_file.id_abbrev =
|
208
|
+
delta->new_file.id_abbrev = (uint16_t)git_oid_hexsize(oid_type);
|
203
209
|
}
|
204
210
|
|
205
211
|
delta->old_file.flags |= GIT_DIFF_FLAG_VALID_ID;
|
@@ -225,6 +231,9 @@ static int diff_delta__from_two(
|
|
225
231
|
const git_oid *old_id = &old_entry->id;
|
226
232
|
git_diff_delta *delta;
|
227
233
|
const char *canonical_path = old_entry->path;
|
234
|
+
git_oid_t oid_type;
|
235
|
+
|
236
|
+
oid_type = diff->base.opts.oid_type;
|
228
237
|
|
229
238
|
if (status == GIT_DELTA_UNMODIFIED &&
|
230
239
|
DIFF_FLAG_ISNT_SET(diff, GIT_DIFF_INCLUDE_UNMODIFIED))
|
@@ -254,14 +263,14 @@ static int diff_delta__from_two(
|
|
254
263
|
delta->old_file.size = old_entry->file_size;
|
255
264
|
delta->old_file.mode = old_mode;
|
256
265
|
git_oid_cpy(&delta->old_file.id, old_id);
|
257
|
-
delta->old_file.id_abbrev =
|
266
|
+
delta->old_file.id_abbrev = (uint16_t)git_oid_hexsize(oid_type);
|
258
267
|
delta->old_file.flags |= GIT_DIFF_FLAG_VALID_ID |
|
259
268
|
GIT_DIFF_FLAG_EXISTS;
|
260
269
|
}
|
261
270
|
|
262
271
|
if (!git_index_entry_is_conflict(new_entry)) {
|
263
272
|
git_oid_cpy(&delta->new_file.id, new_id);
|
264
|
-
delta->new_file.id_abbrev =
|
273
|
+
delta->new_file.id_abbrev = (uint16_t)git_oid_hexsize(oid_type);
|
265
274
|
delta->new_file.size = new_entry->file_size;
|
266
275
|
delta->new_file.mode = new_mode;
|
267
276
|
delta->old_file.flags |= GIT_DIFF_FLAG_EXISTS;
|
@@ -420,7 +429,7 @@ static void diff_generated_free(git_diff *d)
|
|
420
429
|
git_diff_generated *diff = (git_diff_generated *)d;
|
421
430
|
|
422
431
|
git_attr_session__free(&diff->base.attrsession);
|
423
|
-
|
432
|
+
git_vector_dispose_deep(&diff->base.deltas);
|
424
433
|
|
425
434
|
git_pathspec__vfree(&diff->pathspec);
|
426
435
|
git_pool_clear(&diff->base.pool);
|
@@ -490,6 +499,14 @@ static int diff_generated_apply_options(
|
|
490
499
|
return -1;
|
491
500
|
}
|
492
501
|
|
502
|
+
if (!diff->base.opts.oid_type) {
|
503
|
+
diff->base.opts.oid_type = repo->oid_type;
|
504
|
+
} else if (diff->base.opts.oid_type != repo->oid_type) {
|
505
|
+
git_error_set(GIT_ERROR_INVALID,
|
506
|
+
"specified object ID type does not match repository object ID type");
|
507
|
+
return -1;
|
508
|
+
}
|
509
|
+
|
493
510
|
/* flag INCLUDE_TYPECHANGE_TREES implies INCLUDE_TYPECHANGE */
|
494
511
|
if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_TYPECHANGE_TREES))
|
495
512
|
diff->base.opts.flags |= GIT_DIFF_INCLUDE_TYPECHANGE;
|
@@ -603,7 +620,7 @@ int git_diff__oid_for_file(
|
|
603
620
|
entry.mode = mode;
|
604
621
|
entry.file_size = (uint32_t)size;
|
605
622
|
entry.path = (char *)path;
|
606
|
-
git_oid_clear(&entry.id,
|
623
|
+
git_oid_clear(&entry.id, diff->opts.oid_type);
|
607
624
|
|
608
625
|
return git_diff__oid_for_entry(out, diff, &entry, mode, NULL);
|
609
626
|
}
|
@@ -624,7 +641,7 @@ int git_diff__oid_for_entry(
|
|
624
641
|
GIT_ASSERT(d->type == GIT_DIFF_TYPE_GENERATED);
|
625
642
|
diff = (git_diff_generated *)d;
|
626
643
|
|
627
|
-
git_oid_clear(out,
|
644
|
+
git_oid_clear(out, diff->base.opts.oid_type);
|
628
645
|
|
629
646
|
if (git_repository_workdir_path(&full_path, diff->base.repo, entry.path) < 0)
|
630
647
|
return -1;
|
@@ -660,7 +677,8 @@ int git_diff__oid_for_entry(
|
|
660
677
|
git_error_clear();
|
661
678
|
}
|
662
679
|
} else if (S_ISLNK(mode)) {
|
663
|
-
error = git_odb__hashlink(out, full_path.ptr,
|
680
|
+
error = git_odb__hashlink(out, full_path.ptr,
|
681
|
+
diff->base.opts.oid_type);
|
664
682
|
diff->base.perf.oid_calculations++;
|
665
683
|
} else if (!git__is_sizet(entry.file_size)) {
|
666
684
|
git_error_set(GIT_ERROR_NOMEMORY, "file size overflow (for 32-bits) on '%s'",
|
@@ -676,7 +694,8 @@ int git_diff__oid_for_entry(
|
|
676
694
|
else {
|
677
695
|
error = git_odb__hashfd_filtered(
|
678
696
|
out, fd, (size_t)entry.file_size,
|
679
|
-
GIT_OBJECT_BLOB,
|
697
|
+
GIT_OBJECT_BLOB, diff->base.opts.oid_type,
|
698
|
+
fl);
|
680
699
|
p_close(fd);
|
681
700
|
diff->base.perf.oid_calculations++;
|
682
701
|
}
|
@@ -710,7 +729,7 @@ typedef struct {
|
|
710
729
|
git_iterator *new_iter;
|
711
730
|
const git_index_entry *oitem;
|
712
731
|
const git_index_entry *nitem;
|
713
|
-
|
732
|
+
git_submodule_cache *submodule_cache;
|
714
733
|
bool submodule_cache_initialized;
|
715
734
|
} diff_in_progress;
|
716
735
|
|
@@ -726,7 +745,7 @@ static int maybe_modified_submodule(
|
|
726
745
|
git_submodule *sub;
|
727
746
|
unsigned int sm_status = 0;
|
728
747
|
git_submodule_ignore_t ign = diff->base.opts.ignore_submodules;
|
729
|
-
|
748
|
+
git_submodule_cache *submodule_cache = NULL;
|
730
749
|
|
731
750
|
*status = GIT_DELTA_UNMODIFIED;
|
732
751
|
|
@@ -785,7 +804,7 @@ static int maybe_modified(
|
|
785
804
|
git_diff_generated *diff,
|
786
805
|
diff_in_progress *info)
|
787
806
|
{
|
788
|
-
git_oid noid
|
807
|
+
git_oid noid;
|
789
808
|
git_delta_t status = GIT_DELTA_MODIFIED;
|
790
809
|
const git_index_entry *oitem = info->oitem;
|
791
810
|
const git_index_entry *nitem = info->nitem;
|
@@ -796,6 +815,8 @@ static int maybe_modified(
|
|
796
815
|
const char *matched_pathspec;
|
797
816
|
int error = 0;
|
798
817
|
|
818
|
+
git_oid_clear(&noid, diff->base.opts.oid_type);
|
819
|
+
|
799
820
|
if (!diff_pathspec_match(&matched_pathspec, diff, oitem))
|
800
821
|
return 0;
|
801
822
|
|
@@ -1700,11 +1721,11 @@ int git_diff__commit(
|
|
1700
1721
|
*out = NULL;
|
1701
1722
|
|
1702
1723
|
if ((parents = git_commit_parentcount(commit)) > 1) {
|
1703
|
-
char commit_oidstr[
|
1724
|
+
char commit_oidstr[GIT_OID_MAX_HEXSIZE + 1];
|
1704
1725
|
|
1705
1726
|
error = -1;
|
1706
1727
|
git_error_set(GIT_ERROR_INVALID, "commit %s is a merge commit",
|
1707
|
-
git_oid_tostr(commit_oidstr,
|
1728
|
+
git_oid_tostr(commit_oidstr, GIT_OID_MAX_HEXSIZE + 1, git_commit_id(commit)));
|
1708
1729
|
goto on_error;
|
1709
1730
|
}
|
1710
1731
|
|
@@ -20,16 +20,16 @@ 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));
|
29
29
|
git__free(diff);
|
30
30
|
}
|
31
31
|
|
32
|
-
static git_diff_parsed *diff_parsed_alloc(
|
32
|
+
static git_diff_parsed *diff_parsed_alloc(git_oid_t oid_type)
|
33
33
|
{
|
34
34
|
git_diff_parsed *diff;
|
35
35
|
|
@@ -51,6 +51,7 @@ static git_diff_parsed *diff_parsed_alloc(void)
|
|
51
51
|
}
|
52
52
|
|
53
53
|
diff->base.opts.flags &= ~GIT_DIFF_IGNORE_CASE;
|
54
|
+
diff->base.opts.oid_type = oid_type;
|
54
55
|
|
55
56
|
if (git_pool_init(&diff->base.pool, 1) < 0 ||
|
56
57
|
git_vector_init(&diff->patches, 0, NULL) < 0 ||
|
@@ -67,19 +68,34 @@ static git_diff_parsed *diff_parsed_alloc(void)
|
|
67
68
|
int git_diff_from_buffer(
|
68
69
|
git_diff **out,
|
69
70
|
const char *content,
|
70
|
-
size_t content_len
|
71
|
+
size_t content_len
|
72
|
+
#ifdef GIT_EXPERIMENTAL_SHA256
|
73
|
+
, git_diff_parse_options *opts
|
74
|
+
#endif
|
75
|
+
)
|
71
76
|
{
|
72
77
|
git_diff_parsed *diff;
|
73
78
|
git_patch *patch;
|
74
79
|
git_patch_parse_ctx *ctx = NULL;
|
80
|
+
git_patch_options patch_opts = GIT_PATCH_OPTIONS_INIT;
|
81
|
+
git_oid_t oid_type;
|
75
82
|
int error = 0;
|
76
83
|
|
77
84
|
*out = NULL;
|
78
85
|
|
79
|
-
|
86
|
+
#ifdef GIT_EXPERIMENTAL_SHA256
|
87
|
+
oid_type = (opts && opts->oid_type) ? opts->oid_type :
|
88
|
+
GIT_OID_DEFAULT;
|
89
|
+
#else
|
90
|
+
oid_type = GIT_OID_DEFAULT;
|
91
|
+
#endif
|
92
|
+
|
93
|
+
patch_opts.oid_type = oid_type;
|
94
|
+
|
95
|
+
diff = diff_parsed_alloc(oid_type);
|
80
96
|
GIT_ERROR_CHECK_ALLOC(diff);
|
81
97
|
|
82
|
-
ctx = git_patch_parse_ctx_init(content, content_len,
|
98
|
+
ctx = git_patch_parse_ctx_init(content, content_len, &patch_opts);
|
83
99
|
GIT_ERROR_CHECK_ALLOC(ctx);
|
84
100
|
|
85
101
|
while (ctx->parse_ctx.remain_len) {
|
@@ -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,8 @@ typedef struct {
|
|
29
30
|
const char *new_prefix;
|
30
31
|
uint32_t flags;
|
31
32
|
int id_strlen;
|
33
|
+
unsigned int sent_file_header;
|
34
|
+
git_oid_t oid_type;
|
32
35
|
|
33
36
|
int (*strcomp)(const char *, const char *);
|
34
37
|
} diff_print_info;
|
@@ -46,16 +49,15 @@ static int diff_print_info_init__common(
|
|
46
49
|
pi->payload = payload;
|
47
50
|
pi->buf = out;
|
48
51
|
|
52
|
+
GIT_ASSERT(pi->oid_type);
|
53
|
+
|
49
54
|
if (!pi->id_strlen) {
|
50
55
|
if (!repo)
|
51
56
|
pi->id_strlen = GIT_ABBREV_DEFAULT;
|
52
|
-
else if (
|
57
|
+
else if (git_repository__abbrev_length(&pi->id_strlen, repo) < 0)
|
53
58
|
return -1;
|
54
59
|
}
|
55
60
|
|
56
|
-
if (pi->id_strlen > GIT_OID_SHA1_HEXSIZE)
|
57
|
-
pi->id_strlen = GIT_OID_SHA1_HEXSIZE;
|
58
|
-
|
59
61
|
memset(&pi->line, 0, sizeof(pi->line));
|
60
62
|
pi->line.old_lineno = -1;
|
61
63
|
pi->line.new_lineno = -1;
|
@@ -78,6 +80,7 @@ static int diff_print_info_init_fromdiff(
|
|
78
80
|
|
79
81
|
if (diff) {
|
80
82
|
pi->flags = diff->opts.flags;
|
83
|
+
pi->oid_type = diff->opts.oid_type;
|
81
84
|
pi->id_strlen = diff->opts.id_abbrev;
|
82
85
|
pi->old_prefix = diff->opts.old_prefix;
|
83
86
|
pi->new_prefix = diff->opts.new_prefix;
|
@@ -101,6 +104,7 @@ static int diff_print_info_init_frompatch(
|
|
101
104
|
memset(pi, 0, sizeof(diff_print_info));
|
102
105
|
|
103
106
|
pi->flags = patch->diff_opts.flags;
|
107
|
+
pi->oid_type = patch->diff_opts.oid_type;
|
104
108
|
pi->id_strlen = patch->diff_opts.id_abbrev;
|
105
109
|
pi->old_prefix = patch->diff_opts.old_prefix;
|
106
110
|
pi->new_prefix = patch->diff_opts.new_prefix;
|
@@ -212,7 +216,10 @@ static int diff_print_one_raw(
|
|
212
216
|
git_str *out = pi->buf;
|
213
217
|
int id_abbrev;
|
214
218
|
char code = git_diff_status_char(delta->status);
|
215
|
-
char start_oid[
|
219
|
+
char start_oid[GIT_OID_MAX_HEXSIZE + 1],
|
220
|
+
end_oid[GIT_OID_MAX_HEXSIZE + 1];
|
221
|
+
size_t oid_hexsize;
|
222
|
+
bool id_is_abbrev;
|
216
223
|
|
217
224
|
GIT_UNUSED(progress);
|
218
225
|
|
@@ -231,12 +238,21 @@ static int diff_print_one_raw(
|
|
231
238
|
return -1;
|
232
239
|
}
|
233
240
|
|
241
|
+
#ifdef GIT_EXPERIMENTAL_SHA256
|
242
|
+
GIT_ASSERT(delta->old_file.id.type == delta->new_file.id.type);
|
243
|
+
oid_hexsize = git_oid_hexsize(delta->old_file.id.type);
|
244
|
+
#else
|
245
|
+
oid_hexsize = GIT_OID_SHA1_HEXSIZE;
|
246
|
+
#endif
|
247
|
+
|
248
|
+
id_is_abbrev = (pi->id_strlen > 0 &&
|
249
|
+
(size_t)pi->id_strlen <= oid_hexsize);
|
250
|
+
|
234
251
|
git_oid_tostr(start_oid, pi->id_strlen + 1, &delta->old_file.id);
|
235
252
|
git_oid_tostr(end_oid, pi->id_strlen + 1, &delta->new_file.id);
|
236
253
|
|
237
|
-
git_str_printf(
|
238
|
-
|
239
|
-
":%06o %06o %s... %s... %c" : ":%06o %06o %s %s %c",
|
254
|
+
git_str_printf(out,
|
255
|
+
id_is_abbrev ? ":%06o %06o %s... %s... %c" : ":%06o %06o %s %s %c",
|
240
256
|
delta->old_file.mode, delta->new_file.mode, start_oid, end_oid, code);
|
241
257
|
|
242
258
|
if (delta->similarity > 0)
|
@@ -273,7 +289,8 @@ static int diff_print_oid_range(
|
|
273
289
|
git_str *out, const git_diff_delta *delta, int id_strlen,
|
274
290
|
bool print_index)
|
275
291
|
{
|
276
|
-
char start_oid[
|
292
|
+
char start_oid[GIT_OID_MAX_HEXSIZE + 1],
|
293
|
+
end_oid[GIT_OID_MAX_HEXSIZE + 1];
|
277
294
|
|
278
295
|
if (delta->old_file.mode &&
|
279
296
|
id_strlen > delta->old_file.id_abbrev) {
|
@@ -560,6 +577,30 @@ static int diff_print_patch_file_binary(
|
|
560
577
|
return error;
|
561
578
|
}
|
562
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
|
+
|
563
604
|
static int diff_print_patch_file(
|
564
605
|
const git_diff_delta *delta, float progress, void *data)
|
565
606
|
{
|
@@ -590,15 +631,22 @@ static int diff_print_patch_file(
|
|
590
631
|
(pi->flags & GIT_DIFF_SHOW_UNTRACKED_CONTENT) == 0))
|
591
632
|
return 0;
|
592
633
|
|
634
|
+
pi->sent_file_header = 0;
|
635
|
+
|
593
636
|
if ((error = git_diff_delta__format_file_header(pi->buf, delta, oldpfx, newpfx,
|
594
637
|
id_strlen, print_index)) < 0)
|
595
638
|
return error;
|
596
639
|
|
597
|
-
|
598
|
-
|
599
|
-
|
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;
|
600
648
|
|
601
|
-
return
|
649
|
+
return 0;
|
602
650
|
}
|
603
651
|
|
604
652
|
static int diff_print_patch_binary(
|
@@ -613,6 +661,16 @@ static int diff_print_patch_binary(
|
|
613
661
|
pi->new_prefix ? pi->new_prefix : DIFF_NEW_PREFIX_DEFAULT;
|
614
662
|
int error;
|
615
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
|
+
|
616
674
|
git_str_clear(pi->buf);
|
617
675
|
|
618
676
|
if ((error = diff_print_patch_file_binary(
|
@@ -632,10 +690,21 @@ static int diff_print_patch_hunk(
|
|
632
690
|
void *data)
|
633
691
|
{
|
634
692
|
diff_print_info *pi = data;
|
693
|
+
int error;
|
635
694
|
|
636
695
|
if (S_ISDIR(d->new_file.mode))
|
637
696
|
return 0;
|
638
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
|
+
|
639
708
|
pi->line.origin = GIT_DIFF_LINE_HUNK_HDR;
|
640
709
|
pi->line.content = h->header;
|
641
710
|
pi->line.content_len = h->header_len;
|
@@ -650,10 +719,14 @@ static int diff_print_patch_line(
|
|
650
719
|
void *data)
|
651
720
|
{
|
652
721
|
diff_print_info *pi = data;
|
722
|
+
int error;
|
653
723
|
|
654
724
|
if (S_ISDIR(delta->new_file.mode))
|
655
725
|
return 0;
|
656
726
|
|
727
|
+
if ((error = flush_file_header(delta, pi)) < 0)
|
728
|
+
return error;
|
729
|
+
|
657
730
|
return pi->print_cb(delta, hunk, line, pi->payload);
|
658
731
|
}
|
659
732
|
|
@@ -686,6 +759,8 @@ int git_diff_print(
|
|
686
759
|
break;
|
687
760
|
case GIT_DIFF_FORMAT_PATCH_HEADER:
|
688
761
|
print_file = diff_print_patch_file;
|
762
|
+
print_binary = diff_print_patch_binary;
|
763
|
+
print_hunk = diff_print_patch_hunk;
|
689
764
|
break;
|
690
765
|
case GIT_DIFF_FORMAT_RAW:
|
691
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;
|
@@ -364,7 +364,7 @@ static int insert_delete_side_of_split(
|
|
364
364
|
memset(&deleted->new_file, 0, sizeof(deleted->new_file));
|
365
365
|
deleted->new_file.path = deleted->old_file.path;
|
366
366
|
deleted->new_file.flags |= GIT_DIFF_FLAG_VALID_ID;
|
367
|
-
git_oid_clear(&deleted->new_file.id,
|
367
|
+
git_oid_clear(&deleted->new_file.id, diff->opts.oid_type);
|
368
368
|
|
369
369
|
return git_vector_insert(onto, deleted);
|
370
370
|
}
|
@@ -398,7 +398,7 @@ static int apply_splits_and_deletes(
|
|
398
398
|
memset(&delta->old_file, 0, sizeof(delta->old_file));
|
399
399
|
delta->old_file.path = delta->new_file.path;
|
400
400
|
delta->old_file.flags |= GIT_DIFF_FLAG_VALID_ID;
|
401
|
-
git_oid_clear(&delta->old_file.id,
|
401
|
+
git_oid_clear(&delta->old_file.id, diff->opts.oid_type);
|
402
402
|
}
|
403
403
|
|
404
404
|
/* clean up delta before inserting into new list */
|
@@ -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);
|
@@ -997,7 +1020,7 @@ find_best_matches:
|
|
997
1020
|
memset(&src->new_file, 0, sizeof(src->new_file));
|
998
1021
|
src->new_file.path = src->old_file.path;
|
999
1022
|
src->new_file.flags |= GIT_DIFF_FLAG_VALID_ID;
|
1000
|
-
git_oid_clear(&src->new_file.id,
|
1023
|
+
git_oid_clear(&src->new_file.id, diff->opts.oid_type);
|
1001
1024
|
|
1002
1025
|
num_updates++;
|
1003
1026
|
|
@@ -1023,7 +1046,7 @@ find_best_matches:
|
|
1023
1046
|
memset(&src->old_file, 0, sizeof(src->old_file));
|
1024
1047
|
src->old_file.path = src->new_file.path;
|
1025
1048
|
src->old_file.flags |= GIT_DIFF_FLAG_VALID_ID;
|
1026
|
-
git_oid_clear(&src->old_file.id,
|
1049
|
+
git_oid_clear(&src->old_file.id, diff->opts.oid_type);
|
1027
1050
|
|
1028
1051
|
src->flags &= ~GIT_DIFF_FLAG__TO_SPLIT;
|
1029
1052
|
num_rewrites--;
|
@@ -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);
|
@@ -16,6 +16,7 @@
|
|
16
16
|
|
17
17
|
#include "git2/email.h"
|
18
18
|
#include "git2/patch.h"
|
19
|
+
#include "git2/sys/email.h"
|
19
20
|
#include "git2/version.h"
|
20
21
|
|
21
22
|
/*
|
@@ -130,11 +131,12 @@ static int append_header(
|
|
130
131
|
const git_signature *author,
|
131
132
|
git_email_create_options *opts)
|
132
133
|
{
|
133
|
-
char id[
|
134
|
+
char id[GIT_OID_MAX_HEXSIZE + 1];
|
134
135
|
int error;
|
135
136
|
|
136
|
-
|
137
|
-
|
137
|
+
git_oid_tostr(id, GIT_OID_MAX_HEXSIZE + 1, commit_id);
|
138
|
+
|
139
|
+
if ((error = git_str_printf(out, "From %s %s\n", id, EMAIL_TIMESTAMP)) < 0 ||
|
138
140
|
(error = git_str_printf(out, "From: %s <%s>\n", author->name, author->email)) < 0 ||
|
139
141
|
(error = append_date(out, &author->when)) < 0 ||
|
140
142
|
(error = append_subject(out, patch_idx, patch_count, summary, opts)) < 0)
|