rugged 1.1.1 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -0
- data/README.md +1 -1
- data/ext/rugged/extconf.rb +2 -2
- data/ext/rugged/rugged.c +7 -4
- data/ext/rugged/rugged_config.c +7 -2
- data/ext/rugged/rugged_object.c +1 -1
- data/ext/rugged/rugged_remote.c +17 -0
- data/ext/rugged/rugged_repo.c +3 -3
- data/lib/rugged/repository.rb +2 -2
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/CMakeLists.txt +103 -271
- data/vendor/libgit2/COPYING +149 -24
- data/vendor/libgit2/cmake/AddCFlagIfSupported.cmake +21 -21
- data/vendor/libgit2/cmake/DefaultCFlags.cmake +154 -0
- data/vendor/libgit2/cmake/EnableWarnings.cmake +13 -13
- data/vendor/libgit2/cmake/FindCoreFoundation.cmake +13 -13
- data/vendor/libgit2/cmake/FindGSSAPI.cmake +171 -287
- data/vendor/libgit2/cmake/FindGSSFramework.cmake +13 -13
- data/vendor/libgit2/cmake/{FindHTTP_Parser.cmake → FindHTTPParser.cmake} +17 -17
- data/vendor/libgit2/cmake/FindIconv.cmake +27 -27
- data/vendor/libgit2/cmake/FindLibSSH2.cmake +13 -0
- data/vendor/libgit2/cmake/FindPCRE.cmake +13 -13
- data/vendor/libgit2/cmake/FindPCRE2.cmake +12 -12
- data/vendor/libgit2/cmake/FindPkgLibraries.cmake +19 -19
- data/vendor/libgit2/cmake/FindSecurity.cmake +14 -14
- data/vendor/libgit2/cmake/FindStatNsec.cmake +12 -18
- data/vendor/libgit2/cmake/Findfutimens.cmake +14 -0
- data/vendor/libgit2/cmake/FindmbedTLS.cmake +63 -70
- data/vendor/libgit2/cmake/IdeSplitSources.cmake +18 -18
- data/vendor/libgit2/cmake/PkgBuildConfig.cmake +60 -60
- data/vendor/libgit2/cmake/SanitizeBool.cmake +20 -20
- data/vendor/libgit2/cmake/SelectGSSAPI.cmake +37 -37
- data/vendor/libgit2/cmake/SelectHTTPParser.cmake +19 -0
- data/vendor/libgit2/cmake/SelectHTTPSBackend.cmake +100 -96
- data/vendor/libgit2/cmake/SelectHashes.cmake +39 -48
- data/vendor/libgit2/cmake/SelectRegex.cmake +51 -0
- data/vendor/libgit2/cmake/SelectSSH.cmake +41 -0
- data/vendor/libgit2/cmake/SelectWinHTTP.cmake +17 -0
- data/vendor/libgit2/cmake/SelectZlib.cmake +34 -0
- data/vendor/libgit2/deps/chromium-zlib/CMakeLists.txt +101 -0
- data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +32 -20
- data/vendor/libgit2/deps/ntlmclient/crypt.h +14 -9
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +20 -20
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +3 -3
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +37 -36
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +4 -3
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +178 -51
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +74 -5
- data/vendor/libgit2/deps/ntlmclient/ntlm.c +154 -122
- data/vendor/libgit2/deps/ntlmclient/ntlm.h +17 -13
- data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +17 -4
- data/vendor/libgit2/deps/ntlmclient/unicode.h +10 -4
- data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +16 -27
- data/vendor/libgit2/deps/ntlmclient/unicode_builtin.h +20 -0
- data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +28 -52
- data/vendor/libgit2/deps/ntlmclient/unicode_iconv.h +22 -0
- data/vendor/libgit2/deps/pcre/CMakeLists.txt +88 -88
- data/vendor/libgit2/deps/winhttp/CMakeLists.txt +14 -16
- data/vendor/libgit2/include/git2/apply.h +16 -2
- data/vendor/libgit2/include/git2/attr.h +106 -2
- data/vendor/libgit2/include/git2/blame.h +97 -43
- data/vendor/libgit2/include/git2/blob.h +33 -2
- data/vendor/libgit2/include/git2/branch.h +27 -0
- data/vendor/libgit2/include/git2/buffer.h +18 -78
- data/vendor/libgit2/include/git2/cert.h +43 -6
- data/vendor/libgit2/include/git2/checkout.h +32 -13
- data/vendor/libgit2/include/git2/clone.h +4 -4
- data/vendor/libgit2/include/git2/commit.h +37 -19
- data/vendor/libgit2/include/git2/common.h +46 -5
- data/vendor/libgit2/include/git2/config.h +19 -3
- data/vendor/libgit2/include/git2/credential.h +2 -1
- data/vendor/libgit2/include/git2/credential_helpers.h +1 -0
- data/vendor/libgit2/include/git2/deprecated.h +326 -6
- data/vendor/libgit2/include/git2/describe.h +7 -2
- data/vendor/libgit2/include/git2/diff.h +50 -121
- data/vendor/libgit2/include/git2/email.h +127 -0
- data/vendor/libgit2/include/git2/errors.h +7 -6
- data/vendor/libgit2/include/git2/filter.h +69 -18
- data/vendor/libgit2/include/git2/graph.h +21 -2
- data/vendor/libgit2/include/git2/ignore.h +1 -1
- data/vendor/libgit2/include/git2/index.h +13 -7
- data/vendor/libgit2/include/git2/indexer.h +19 -0
- data/vendor/libgit2/include/git2/merge.h +23 -3
- data/vendor/libgit2/include/git2/message.h +2 -0
- data/vendor/libgit2/include/git2/notes.h +2 -2
- data/vendor/libgit2/include/git2/object.h +23 -0
- data/vendor/libgit2/include/git2/odb.h +65 -6
- data/vendor/libgit2/include/git2/odb_backend.h +1 -1
- data/vendor/libgit2/include/git2/oidarray.h +5 -8
- data/vendor/libgit2/include/git2/pack.h +24 -8
- data/vendor/libgit2/include/git2/patch.h +16 -0
- data/vendor/libgit2/include/git2/pathspec.h +1 -1
- data/vendor/libgit2/include/git2/proxy.h +1 -1
- data/vendor/libgit2/include/git2/rebase.h +34 -2
- data/vendor/libgit2/include/git2/refdb.h +3 -0
- data/vendor/libgit2/include/git2/reflog.h +1 -1
- data/vendor/libgit2/include/git2/refs.h +8 -4
- data/vendor/libgit2/include/git2/remote.h +246 -46
- data/vendor/libgit2/include/git2/repository.h +25 -18
- data/vendor/libgit2/include/git2/reset.h +2 -2
- data/vendor/libgit2/include/git2/revparse.h +5 -5
- data/vendor/libgit2/include/git2/revwalk.h +4 -1
- data/vendor/libgit2/include/git2/signature.h +1 -1
- data/vendor/libgit2/include/git2/stash.h +4 -4
- data/vendor/libgit2/include/git2/status.h +124 -62
- data/vendor/libgit2/include/git2/stdint.h +3 -3
- data/vendor/libgit2/include/git2/submodule.h +16 -2
- data/vendor/libgit2/include/git2/sys/commit_graph.h +174 -0
- data/vendor/libgit2/include/git2/sys/email.h +45 -0
- data/vendor/libgit2/include/git2/sys/filter.h +49 -28
- data/vendor/libgit2/include/git2/sys/midx.h +74 -0
- data/vendor/libgit2/include/git2/sys/odb_backend.h +9 -5
- data/vendor/libgit2/include/git2/sys/remote.h +31 -0
- data/vendor/libgit2/include/git2/sys/stream.h +1 -1
- data/vendor/libgit2/include/git2/sys/transport.h +26 -34
- data/vendor/libgit2/include/git2/tag.h +13 -0
- data/vendor/libgit2/include/git2/tree.h +4 -17
- data/vendor/libgit2/include/git2/types.h +16 -7
- data/vendor/libgit2/include/git2/version.h +4 -4
- data/vendor/libgit2/include/git2/worktree.h +13 -2
- data/vendor/libgit2/include/git2.h +1 -0
- data/vendor/libgit2/src/CMakeLists.txt +192 -290
- data/vendor/libgit2/src/alloc.c +21 -8
- data/vendor/libgit2/src/allocators/failalloc.c +92 -0
- data/vendor/libgit2/src/allocators/failalloc.h +23 -0
- data/vendor/libgit2/src/allocators/stdalloc.c +41 -10
- data/vendor/libgit2/src/allocators/win32_leakcheck.c +118 -0
- data/vendor/libgit2/src/allocators/{win32_crtdbg.h → win32_leakcheck.h} +3 -3
- data/vendor/libgit2/src/annotated_commit.c +21 -9
- data/vendor/libgit2/src/annotated_commit.h +1 -1
- data/vendor/libgit2/src/apply.c +34 -25
- data/vendor/libgit2/src/apply.h +2 -2
- data/vendor/libgit2/src/array.h +11 -11
- data/vendor/libgit2/src/attr.c +204 -82
- data/vendor/libgit2/src/attr_file.c +105 -52
- data/vendor/libgit2/src/attr_file.h +36 -15
- data/vendor/libgit2/src/attrcache.c +55 -45
- data/vendor/libgit2/src/attrcache.h +4 -5
- data/vendor/libgit2/src/blame.c +15 -9
- data/vendor/libgit2/src/blame_git.c +2 -2
- data/vendor/libgit2/src/blob.c +76 -52
- data/vendor/libgit2/src/blob.h +1 -1
- data/vendor/libgit2/src/branch.c +203 -110
- data/vendor/libgit2/src/branch.h +15 -3
- data/vendor/libgit2/src/buf.c +126 -0
- data/vendor/libgit2/src/buf.h +50 -0
- data/vendor/libgit2/src/cache.c +2 -2
- data/vendor/libgit2/src/cache.h +7 -7
- data/vendor/libgit2/src/cc-compat.h +11 -9
- data/vendor/libgit2/src/checkout.c +118 -91
- data/vendor/libgit2/src/cherrypick.c +16 -12
- data/vendor/libgit2/src/clone.c +97 -103
- data/vendor/libgit2/src/commit.c +167 -84
- data/vendor/libgit2/src/commit.h +24 -1
- data/vendor/libgit2/src/commit_graph.c +1224 -0
- data/vendor/libgit2/src/commit_graph.h +169 -0
- data/vendor/libgit2/src/commit_list.c +48 -3
- data/vendor/libgit2/src/commit_list.h +2 -0
- data/vendor/libgit2/src/common.h +35 -5
- data/vendor/libgit2/src/config.c +119 -64
- data/vendor/libgit2/src/config.h +15 -2
- data/vendor/libgit2/src/config_cache.c +5 -3
- data/vendor/libgit2/src/config_file.c +120 -100
- data/vendor/libgit2/src/config_mem.c +9 -9
- data/vendor/libgit2/src/config_parse.c +29 -27
- data/vendor/libgit2/src/crlf.c +36 -23
- data/vendor/libgit2/src/date.c +13 -19
- data/vendor/libgit2/src/date.h +33 -0
- data/vendor/libgit2/src/delta.c +1 -1
- data/vendor/libgit2/src/describe.c +32 -21
- data/vendor/libgit2/src/diff.c +71 -183
- data/vendor/libgit2/src/diff.h +2 -4
- data/vendor/libgit2/src/diff_driver.c +53 -51
- data/vendor/libgit2/src/diff_driver.h +3 -3
- data/vendor/libgit2/src/diff_file.c +31 -26
- data/vendor/libgit2/src/diff_generate.c +76 -23
- data/vendor/libgit2/src/diff_generate.h +5 -3
- data/vendor/libgit2/src/diff_print.c +120 -95
- data/vendor/libgit2/src/diff_stats.c +47 -34
- data/vendor/libgit2/src/{message.h → diff_stats.h} +7 -6
- data/vendor/libgit2/src/diff_tform.c +18 -16
- data/vendor/libgit2/src/diff_xdiff.c +7 -10
- data/vendor/libgit2/src/diff_xdiff.h +1 -1
- data/vendor/libgit2/src/email.c +315 -0
- data/vendor/libgit2/src/email.h +25 -0
- data/vendor/libgit2/src/errors.c +37 -32
- data/vendor/libgit2/src/features.h.in +11 -2
- data/vendor/libgit2/src/fetch.c +77 -26
- data/vendor/libgit2/src/fetch.h +1 -1
- data/vendor/libgit2/src/fetchhead.c +27 -23
- data/vendor/libgit2/src/filebuf.c +36 -34
- data/vendor/libgit2/src/filebuf.h +1 -1
- data/vendor/libgit2/src/filter.c +278 -132
- data/vendor/libgit2/src/filter.h +46 -6
- data/vendor/libgit2/src/fs_path.c +2071 -0
- data/vendor/libgit2/src/fs_path.h +772 -0
- data/vendor/libgit2/src/futils.c +96 -90
- data/vendor/libgit2/src/futils.h +27 -15
- data/vendor/libgit2/src/graph.c +64 -9
- data/vendor/libgit2/src/hash/sha1/collisiondetect.c +5 -5
- data/vendor/libgit2/src/hash/sha1/common_crypto.c +5 -5
- data/vendor/libgit2/src/hash/sha1/generic.c +2 -2
- data/vendor/libgit2/src/hash/sha1/generic.h +1 -1
- data/vendor/libgit2/src/hash/sha1/mbedtls.c +13 -13
- data/vendor/libgit2/src/hash/sha1/openssl.c +5 -5
- data/vendor/libgit2/src/hash/sha1/sha1dc/sha1.c +9 -11
- data/vendor/libgit2/src/hash/sha1/win32.c +21 -17
- data/vendor/libgit2/src/hash/sha1.h +3 -1
- data/vendor/libgit2/src/hash.c +71 -36
- data/vendor/libgit2/src/hash.h +13 -13
- data/vendor/libgit2/src/hashsig.c +23 -10
- data/vendor/libgit2/src/ident.c +30 -20
- data/vendor/libgit2/src/ignore.c +63 -46
- data/vendor/libgit2/src/ignore.h +2 -2
- data/vendor/libgit2/src/index.c +184 -149
- data/vendor/libgit2/src/index.h +7 -4
- data/vendor/libgit2/src/indexer.c +143 -89
- data/vendor/libgit2/src/integer.h +64 -2
- data/vendor/libgit2/src/iterator.c +93 -73
- data/vendor/libgit2/src/iterator.h +6 -6
- data/vendor/libgit2/src/khash.h +3 -12
- data/vendor/libgit2/src/{settings.c → libgit2.c} +165 -56
- data/vendor/libgit2/src/libgit2.h +15 -0
- data/vendor/libgit2/src/mailmap.c +60 -45
- data/vendor/libgit2/src/map.h +3 -3
- data/vendor/libgit2/src/merge.c +104 -61
- data/vendor/libgit2/src/merge.h +3 -15
- data/vendor/libgit2/src/merge_driver.c +21 -15
- data/vendor/libgit2/src/merge_file.c +24 -6
- data/vendor/libgit2/src/message.c +21 -8
- data/vendor/libgit2/src/midx.c +501 -18
- data/vendor/libgit2/src/midx.h +29 -2
- data/vendor/libgit2/src/mwindow.c +103 -59
- data/vendor/libgit2/src/mwindow.h +3 -3
- data/vendor/libgit2/src/net.c +405 -71
- data/vendor/libgit2/src/net.h +26 -5
- data/vendor/libgit2/src/netops.c +7 -5
- data/vendor/libgit2/src/netops.h +3 -3
- data/vendor/libgit2/src/notes.c +40 -49
- data/vendor/libgit2/src/object.c +68 -20
- data/vendor/libgit2/src/object.h +1 -1
- data/vendor/libgit2/src/odb.c +320 -80
- data/vendor/libgit2/src/odb.h +17 -3
- data/vendor/libgit2/src/odb_loose.c +96 -86
- data/vendor/libgit2/src/odb_mempack.c +19 -6
- data/vendor/libgit2/src/odb_pack.c +402 -125
- data/vendor/libgit2/src/oid.c +16 -8
- data/vendor/libgit2/src/oid.h +15 -0
- data/vendor/libgit2/src/oidarray.c +10 -1
- data/vendor/libgit2/src/pack-objects.c +90 -69
- data/vendor/libgit2/src/pack-objects.h +11 -6
- data/vendor/libgit2/src/pack.c +337 -127
- data/vendor/libgit2/src/pack.h +25 -7
- data/vendor/libgit2/src/patch.c +17 -10
- data/vendor/libgit2/src/patch.h +1 -0
- data/vendor/libgit2/src/patch_generate.c +29 -13
- data/vendor/libgit2/src/patch_generate.h +5 -5
- data/vendor/libgit2/src/patch_parse.c +26 -25
- data/vendor/libgit2/src/path.c +86 -1768
- data/vendor/libgit2/src/path.h +39 -635
- data/vendor/libgit2/src/pathspec.c +12 -12
- data/vendor/libgit2/src/pathspec.h +2 -2
- data/vendor/libgit2/src/pool.c +13 -7
- data/vendor/libgit2/src/posix.c +14 -6
- data/vendor/libgit2/src/posix.h +1 -0
- data/vendor/libgit2/src/pqueue.h +1 -1
- data/vendor/libgit2/src/proxy.c +4 -1
- data/vendor/libgit2/src/proxy.h +1 -1
- data/vendor/libgit2/src/push.c +30 -35
- data/vendor/libgit2/src/push.h +4 -16
- data/vendor/libgit2/src/rand.c +226 -0
- data/vendor/libgit2/src/rand.h +37 -0
- data/vendor/libgit2/src/reader.c +18 -14
- data/vendor/libgit2/src/reader.h +2 -2
- data/vendor/libgit2/src/rebase.c +177 -132
- data/vendor/libgit2/src/refdb.c +30 -13
- data/vendor/libgit2/src/refdb_fs.c +548 -222
- data/vendor/libgit2/src/reflog.c +19 -14
- data/vendor/libgit2/src/refs.c +107 -72
- data/vendor/libgit2/src/refs.h +2 -2
- data/vendor/libgit2/src/refspec.c +53 -38
- data/vendor/libgit2/src/refspec.h +5 -2
- data/vendor/libgit2/src/regexp.c +1 -1
- data/vendor/libgit2/src/remote.c +960 -486
- data/vendor/libgit2/src/remote.h +16 -10
- data/vendor/libgit2/src/repository.c +702 -422
- data/vendor/libgit2/src/repository.h +26 -8
- data/vendor/libgit2/src/reset.c +16 -12
- data/vendor/libgit2/src/revert.c +16 -12
- data/vendor/libgit2/src/revparse.c +66 -48
- data/vendor/libgit2/src/revwalk.c +39 -22
- data/vendor/libgit2/src/runtime.c +162 -0
- data/vendor/libgit2/src/runtime.h +62 -0
- data/vendor/libgit2/src/settings.h +11 -0
- data/vendor/libgit2/src/signature.c +18 -11
- data/vendor/libgit2/src/signature.h +1 -1
- data/vendor/libgit2/src/sortedcache.c +1 -1
- data/vendor/libgit2/src/sortedcache.h +10 -8
- data/vendor/libgit2/src/stash.c +39 -38
- data/vendor/libgit2/src/status.c +11 -5
- data/vendor/libgit2/src/{buffer.c → str.c} +459 -136
- data/vendor/libgit2/src/str.h +357 -0
- data/vendor/libgit2/src/strarray.c +2 -1
- data/vendor/libgit2/src/streams/mbedtls.c +22 -23
- data/vendor/libgit2/src/streams/mbedtls.h +1 -1
- data/vendor/libgit2/src/streams/openssl.c +101 -201
- data/vendor/libgit2/src/streams/openssl.h +9 -1
- data/vendor/libgit2/src/streams/openssl_dynamic.c +309 -0
- data/vendor/libgit2/src/streams/openssl_dynamic.h +348 -0
- data/vendor/libgit2/src/streams/openssl_legacy.c +203 -0
- data/vendor/libgit2/src/streams/openssl_legacy.h +63 -0
- data/vendor/libgit2/src/streams/registry.c +5 -6
- data/vendor/libgit2/src/streams/socket.c +6 -2
- data/vendor/libgit2/src/streams/stransport.c +6 -3
- data/vendor/libgit2/src/streams/tls.c +5 -3
- data/vendor/libgit2/src/submodule.c +290 -212
- data/vendor/libgit2/src/submodule.h +10 -10
- data/vendor/libgit2/src/sysdir.c +70 -56
- data/vendor/libgit2/src/sysdir.h +15 -10
- data/vendor/libgit2/src/tag.c +72 -34
- data/vendor/libgit2/src/thread.c +140 -0
- data/vendor/libgit2/src/thread.h +479 -0
- data/vendor/libgit2/src/threadstate.c +84 -0
- data/vendor/libgit2/src/threadstate.h +24 -0
- data/vendor/libgit2/src/trace.c +3 -16
- data/vendor/libgit2/src/trace.h +17 -30
- data/vendor/libgit2/src/trailer.c +2 -2
- data/vendor/libgit2/src/transaction.c +20 -9
- data/vendor/libgit2/src/transport.c +13 -13
- data/vendor/libgit2/src/transports/auth.c +8 -10
- data/vendor/libgit2/src/transports/auth.h +2 -3
- data/vendor/libgit2/src/transports/auth_negotiate.c +23 -17
- data/vendor/libgit2/src/transports/auth_ntlm.c +20 -16
- data/vendor/libgit2/src/transports/auth_ntlm.h +0 -1
- data/vendor/libgit2/src/transports/credential.c +15 -7
- data/vendor/libgit2/src/transports/git.c +10 -14
- data/vendor/libgit2/src/transports/http.c +56 -34
- data/vendor/libgit2/src/transports/http.h +3 -3
- data/vendor/libgit2/src/transports/httpclient.c +106 -79
- data/vendor/libgit2/src/transports/httpclient.h +1 -1
- data/vendor/libgit2/src/transports/local.c +127 -119
- data/vendor/libgit2/src/transports/smart.c +61 -144
- data/vendor/libgit2/src/transports/smart.h +26 -32
- data/vendor/libgit2/src/transports/smart_pkt.c +33 -33
- data/vendor/libgit2/src/transports/smart_protocol.c +68 -44
- data/vendor/libgit2/src/transports/ssh.c +100 -131
- data/vendor/libgit2/src/transports/winhttp.c +86 -82
- data/vendor/libgit2/src/tree-cache.c +5 -5
- data/vendor/libgit2/src/tree-cache.h +2 -2
- data/vendor/libgit2/src/tree.c +150 -116
- data/vendor/libgit2/src/tree.h +1 -0
- data/vendor/libgit2/src/tsort.c +0 -2
- data/vendor/libgit2/src/unix/map.c +3 -3
- data/vendor/libgit2/src/unix/posix.h +1 -4
- data/vendor/libgit2/src/unix/pthread.h +2 -1
- data/vendor/libgit2/src/unix/realpath.c +0 -2
- data/vendor/libgit2/src/utf8.c +150 -0
- data/vendor/libgit2/src/utf8.h +52 -0
- data/vendor/libgit2/src/util.c +68 -144
- data/vendor/libgit2/src/util.h +36 -68
- data/vendor/libgit2/src/vector.c +23 -19
- data/vendor/libgit2/src/vector.h +5 -3
- data/vendor/libgit2/src/win32/findfile.c +172 -114
- data/vendor/libgit2/src/win32/findfile.h +7 -4
- data/vendor/libgit2/src/win32/map.c +1 -1
- data/vendor/libgit2/src/win32/msvc-compat.h +9 -1
- data/vendor/libgit2/src/win32/path_w32.c +162 -33
- data/vendor/libgit2/src/win32/path_w32.h +2 -1
- data/vendor/libgit2/src/win32/posix.h +6 -7
- data/vendor/libgit2/src/win32/posix_w32.c +26 -33
- data/vendor/libgit2/src/win32/precompiled.h +0 -1
- data/vendor/libgit2/src/win32/reparse.h +4 -4
- data/vendor/libgit2/src/win32/thread.c +24 -15
- data/vendor/libgit2/src/win32/thread.h +1 -1
- data/vendor/libgit2/src/win32/w32_buffer.c +5 -6
- data/vendor/libgit2/src/win32/w32_buffer.h +2 -3
- data/vendor/libgit2/src/win32/w32_common.h +18 -9
- data/vendor/libgit2/src/win32/{w32_crtdbg_stacktrace.c → w32_leakcheck.c} +269 -33
- data/vendor/libgit2/src/win32/w32_leakcheck.h +222 -0
- data/vendor/libgit2/src/win32/w32_util.h +6 -6
- data/vendor/libgit2/src/worktree.c +138 -105
- data/vendor/libgit2/src/worktree.h +1 -1
- data/vendor/libgit2/src/xdiff/git-xdiff.h +53 -0
- data/vendor/libgit2/src/xdiff/xdiff.h +15 -15
- data/vendor/libgit2/src/xdiff/xdiffi.c +134 -108
- data/vendor/libgit2/src/xdiff/xemit.c +23 -7
- data/vendor/libgit2/src/xdiff/xhistogram.c +87 -78
- data/vendor/libgit2/src/xdiff/xinclude.h +1 -12
- data/vendor/libgit2/src/xdiff/xmerge.c +104 -117
- data/vendor/libgit2/src/xdiff/xpatience.c +6 -17
- data/vendor/libgit2/src/xdiff/xprepare.c +15 -20
- data/vendor/libgit2/src/xdiff/xutils.c +18 -7
- data/vendor/libgit2/src/zstream.c +6 -6
- data/vendor/libgit2/src/zstream.h +4 -4
- metadata +60 -24
- data/vendor/libgit2/src/allocators/win32_crtdbg.c +0 -118
- data/vendor/libgit2/src/buf_text.c +0 -316
- data/vendor/libgit2/src/buf_text.h +0 -122
- data/vendor/libgit2/src/buffer.h +0 -222
- data/vendor/libgit2/src/global.c +0 -363
- data/vendor/libgit2/src/global.h +0 -41
- data/vendor/libgit2/src/thread-utils.c +0 -58
- data/vendor/libgit2/src/thread-utils.h +0 -369
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +0 -127
- data/vendor/libgit2/src/win32/w32_stack.c +0 -188
- data/vendor/libgit2/src/win32/w32_stack.h +0 -140
@@ -0,0 +1,226 @@
|
|
1
|
+
/* Written in 2018 by David Blackman and Sebastiano Vigna (vigna@acm.org)
|
2
|
+
|
3
|
+
To the extent possible under law, the author has dedicated all copyright
|
4
|
+
and related and neighboring rights to this software to the public domain
|
5
|
+
worldwide. This software is distributed without any warranty.
|
6
|
+
|
7
|
+
See <http://creativecommons.org/publicdomain/zero/1.0/>. */
|
8
|
+
|
9
|
+
#include "common.h"
|
10
|
+
#include "rand.h"
|
11
|
+
#include "runtime.h"
|
12
|
+
|
13
|
+
#if defined(GIT_RAND_GETENTROPY)
|
14
|
+
# include <sys/random.h>
|
15
|
+
#endif
|
16
|
+
|
17
|
+
static uint64_t state[4];
|
18
|
+
static git_mutex state_lock;
|
19
|
+
|
20
|
+
typedef union {
|
21
|
+
double f;
|
22
|
+
uint64_t d;
|
23
|
+
} bits;
|
24
|
+
|
25
|
+
#if defined(GIT_WIN32)
|
26
|
+
GIT_INLINE(int) getseed(uint64_t *seed)
|
27
|
+
{
|
28
|
+
HCRYPTPROV provider;
|
29
|
+
SYSTEMTIME systemtime;
|
30
|
+
FILETIME filetime, idletime, kerneltime, usertime;
|
31
|
+
bits convert;
|
32
|
+
|
33
|
+
if (CryptAcquireContext(&provider, 0, 0, PROV_RSA_FULL,
|
34
|
+
CRYPT_VERIFYCONTEXT|CRYPT_SILENT)) {
|
35
|
+
BOOL success = CryptGenRandom(provider, sizeof(uint64_t), (void *)seed);
|
36
|
+
CryptReleaseContext(provider, 0);
|
37
|
+
|
38
|
+
if (success)
|
39
|
+
return 0;
|
40
|
+
}
|
41
|
+
|
42
|
+
GetSystemTime(&systemtime);
|
43
|
+
if (!SystemTimeToFileTime(&systemtime, &filetime)) {
|
44
|
+
git_error_set(GIT_ERROR_OS, "could not get time for random seed");
|
45
|
+
return -1;
|
46
|
+
}
|
47
|
+
|
48
|
+
/* Fall-through: generate a seed from the time and system state */
|
49
|
+
*seed = 0;
|
50
|
+
*seed |= ((uint64_t)filetime.dwLowDateTime << 32);
|
51
|
+
*seed |= ((uint64_t)filetime.dwHighDateTime);
|
52
|
+
|
53
|
+
GetSystemTimes(&idletime, &kerneltime, &usertime);
|
54
|
+
|
55
|
+
*seed ^= ((uint64_t)idletime.dwLowDateTime << 32);
|
56
|
+
*seed ^= ((uint64_t)kerneltime.dwLowDateTime);
|
57
|
+
*seed ^= ((uint64_t)usertime.dwLowDateTime << 32);
|
58
|
+
|
59
|
+
*seed ^= ((uint64_t)idletime.dwHighDateTime);
|
60
|
+
*seed ^= ((uint64_t)kerneltime.dwHighDateTime << 12);
|
61
|
+
*seed ^= ((uint64_t)usertime.dwHighDateTime << 24);
|
62
|
+
|
63
|
+
*seed ^= ((uint64_t)GetCurrentProcessId() << 32);
|
64
|
+
*seed ^= ((uint64_t)GetCurrentThreadId() << 48);
|
65
|
+
|
66
|
+
convert.f = git__timer(); *seed ^= (convert.d);
|
67
|
+
|
68
|
+
/* Mix in the addresses of some functions and variables */
|
69
|
+
*seed ^= (((uint64_t)((uintptr_t)seed) << 32));
|
70
|
+
*seed ^= (((uint64_t)((uintptr_t)&errno)));
|
71
|
+
|
72
|
+
return 0;
|
73
|
+
}
|
74
|
+
|
75
|
+
#else
|
76
|
+
|
77
|
+
GIT_INLINE(int) getseed(uint64_t *seed)
|
78
|
+
{
|
79
|
+
struct timeval tv;
|
80
|
+
double loadavg[3];
|
81
|
+
bits convert;
|
82
|
+
int fd;
|
83
|
+
|
84
|
+
# if defined(GIT_RAND_GETENTROPY)
|
85
|
+
GIT_UNUSED((fd = 0));
|
86
|
+
|
87
|
+
if (getentropy(seed, sizeof(uint64_t)) == 0)
|
88
|
+
return 0;
|
89
|
+
# else
|
90
|
+
/*
|
91
|
+
* Try to read from /dev/urandom; most modern systems will have
|
92
|
+
* this, but we may be chrooted, etc, so it's not a fatal error
|
93
|
+
*/
|
94
|
+
if ((fd = open("/dev/urandom", O_RDONLY)) >= 0) {
|
95
|
+
ssize_t ret = read(fd, seed, sizeof(uint64_t));
|
96
|
+
close(fd);
|
97
|
+
|
98
|
+
if (ret == (ssize_t)sizeof(uint64_t))
|
99
|
+
return 0;
|
100
|
+
}
|
101
|
+
# endif
|
102
|
+
|
103
|
+
/* Fall-through: generate a seed from the time and system state */
|
104
|
+
if (gettimeofday(&tv, NULL) < 0) {
|
105
|
+
git_error_set(GIT_ERROR_OS, "could get time for random seed");
|
106
|
+
return -1;
|
107
|
+
}
|
108
|
+
|
109
|
+
getloadavg(loadavg, 3);
|
110
|
+
|
111
|
+
*seed = 0;
|
112
|
+
*seed |= ((uint64_t)tv.tv_usec << 40);
|
113
|
+
*seed |= ((uint64_t)tv.tv_sec);
|
114
|
+
|
115
|
+
*seed ^= ((uint64_t)getpid() << 48);
|
116
|
+
*seed ^= ((uint64_t)getppid() << 32);
|
117
|
+
*seed ^= ((uint64_t)getpgid(0) << 28);
|
118
|
+
*seed ^= ((uint64_t)getsid(0) << 16);
|
119
|
+
*seed ^= ((uint64_t)getuid() << 8);
|
120
|
+
*seed ^= ((uint64_t)getgid());
|
121
|
+
|
122
|
+
convert.f = loadavg[0]; *seed ^= (convert.d >> 36);
|
123
|
+
convert.f = loadavg[1]; *seed ^= (convert.d);
|
124
|
+
convert.f = loadavg[2]; *seed ^= (convert.d >> 16);
|
125
|
+
|
126
|
+
convert.f = git__timer(); *seed ^= (convert.d);
|
127
|
+
|
128
|
+
/* Mix in the addresses of some variables */
|
129
|
+
*seed ^= ((uint64_t)((size_t)((void *)seed)) << 32);
|
130
|
+
*seed ^= ((uint64_t)((size_t)((void *)&errno)));
|
131
|
+
|
132
|
+
return 0;
|
133
|
+
}
|
134
|
+
#endif
|
135
|
+
|
136
|
+
static void git_rand_global_shutdown(void)
|
137
|
+
{
|
138
|
+
git_mutex_free(&state_lock);
|
139
|
+
}
|
140
|
+
|
141
|
+
int git_rand_global_init(void)
|
142
|
+
{
|
143
|
+
uint64_t seed = 0;
|
144
|
+
|
145
|
+
if (git_mutex_init(&state_lock) < 0 || getseed(&seed) < 0)
|
146
|
+
return -1;
|
147
|
+
|
148
|
+
if (!seed) {
|
149
|
+
git_error_set(GIT_ERROR_INTERNAL, "failed to generate random seed");
|
150
|
+
return -1;
|
151
|
+
}
|
152
|
+
|
153
|
+
git_rand_seed(seed);
|
154
|
+
git_runtime_shutdown_register(git_rand_global_shutdown);
|
155
|
+
|
156
|
+
return 0;
|
157
|
+
}
|
158
|
+
|
159
|
+
/*
|
160
|
+
* This is splitmix64. xoroshiro256** uses 256 bit seed; this is used
|
161
|
+
* to generate 256 bits of seed from the given 64, per the author's
|
162
|
+
* recommendation.
|
163
|
+
*/
|
164
|
+
GIT_INLINE(uint64_t) splitmix64(uint64_t *in)
|
165
|
+
{
|
166
|
+
uint64_t z;
|
167
|
+
|
168
|
+
*in += 0x9e3779b97f4a7c15;
|
169
|
+
|
170
|
+
z = *in;
|
171
|
+
z = (z ^ (z >> 30)) * 0xbf58476d1ce4e5b9;
|
172
|
+
z = (z ^ (z >> 27)) * 0x94d049bb133111eb;
|
173
|
+
return z ^ (z >> 31);
|
174
|
+
}
|
175
|
+
|
176
|
+
void git_rand_seed(uint64_t seed)
|
177
|
+
{
|
178
|
+
uint64_t mixer;
|
179
|
+
|
180
|
+
mixer = seed;
|
181
|
+
|
182
|
+
git_mutex_lock(&state_lock);
|
183
|
+
state[0] = splitmix64(&mixer);
|
184
|
+
state[1] = splitmix64(&mixer);
|
185
|
+
state[2] = splitmix64(&mixer);
|
186
|
+
state[3] = splitmix64(&mixer);
|
187
|
+
git_mutex_unlock(&state_lock);
|
188
|
+
}
|
189
|
+
|
190
|
+
/* This is xoshiro256** 1.0, one of our all-purpose, rock-solid
|
191
|
+
generators. It has excellent (sub-ns) speed, a state (256 bits) that is
|
192
|
+
large enough for any parallel application, and it passes all tests we
|
193
|
+
are aware of.
|
194
|
+
|
195
|
+
For generating just floating-point numbers, xoshiro256+ is even faster.
|
196
|
+
|
197
|
+
The state must be seeded so that it is not everywhere zero. If you have
|
198
|
+
a 64-bit seed, we suggest to seed a splitmix64 generator and use its
|
199
|
+
output to fill s. */
|
200
|
+
|
201
|
+
GIT_INLINE(uint64_t) rotl(const uint64_t x, int k) {
|
202
|
+
return (x << k) | (x >> (64 - k));
|
203
|
+
}
|
204
|
+
|
205
|
+
uint64_t git_rand_next(void) {
|
206
|
+
uint64_t t, result;
|
207
|
+
|
208
|
+
git_mutex_lock(&state_lock);
|
209
|
+
|
210
|
+
result = rotl(state[1] * 5, 7) * 9;
|
211
|
+
|
212
|
+
t = state[1] << 17;
|
213
|
+
|
214
|
+
state[2] ^= state[0];
|
215
|
+
state[3] ^= state[1];
|
216
|
+
state[1] ^= state[2];
|
217
|
+
state[0] ^= state[3];
|
218
|
+
|
219
|
+
state[2] ^= t;
|
220
|
+
|
221
|
+
state[3] = rotl(state[3], 45);
|
222
|
+
|
223
|
+
git_mutex_unlock(&state_lock);
|
224
|
+
|
225
|
+
return result;
|
226
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
|
+
*
|
4
|
+
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
|
+
* a Linking Exception. For full terms see the included COPYING file.
|
6
|
+
*/
|
7
|
+
#ifndef INCLUDE_rand_h__
|
8
|
+
#define INCLUDE_rand_h__
|
9
|
+
|
10
|
+
#include "common.h"
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Initialize the random number generation subsystem. This will
|
14
|
+
* seed the random number generator with the system's entropy pool,
|
15
|
+
* if available, and will fall back to the current time and
|
16
|
+
* system information if not.
|
17
|
+
*/
|
18
|
+
int git_rand_global_init(void);
|
19
|
+
|
20
|
+
/**
|
21
|
+
* Seed the pseudo-random number generator. This is not needed to be
|
22
|
+
* called; the PRNG is seeded by `git_rand_global_init`, but it may
|
23
|
+
* be useful for testing. When the same seed is specified, the same
|
24
|
+
* sequence of random numbers from `git_rand_next` is emitted.
|
25
|
+
*
|
26
|
+
* @param seed the seed to use
|
27
|
+
*/
|
28
|
+
void git_rand_seed(uint64_t seed);
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Get the next pseudo-random number in the sequence.
|
32
|
+
*
|
33
|
+
* @return a 64-bit pseudo-random number
|
34
|
+
*/
|
35
|
+
uint64_t git_rand_next(void);
|
36
|
+
|
37
|
+
#endif
|
data/vendor/libgit2/src/reader.c
CHANGED
@@ -23,7 +23,7 @@ typedef struct {
|
|
23
23
|
} tree_reader;
|
24
24
|
|
25
25
|
static int tree_reader_read(
|
26
|
-
|
26
|
+
git_str *out,
|
27
27
|
git_oid *out_id,
|
28
28
|
git_filemode_t *out_filemode,
|
29
29
|
git_reader *_reader,
|
@@ -42,7 +42,7 @@ static int tree_reader_read(
|
|
42
42
|
blobsize = git_blob_rawsize(blob);
|
43
43
|
GIT_ERROR_CHECK_BLOBSIZE(blobsize);
|
44
44
|
|
45
|
-
if ((error =
|
45
|
+
if ((error = git_str_set(out, git_blob_rawcontent(blob), (size_t)blobsize)) < 0)
|
46
46
|
goto done;
|
47
47
|
|
48
48
|
if (out_id)
|
@@ -61,7 +61,8 @@ int git_reader_for_tree(git_reader **out, git_tree *tree)
|
|
61
61
|
{
|
62
62
|
tree_reader *reader;
|
63
63
|
|
64
|
-
|
64
|
+
GIT_ASSERT_ARG(out);
|
65
|
+
GIT_ASSERT_ARG(tree);
|
65
66
|
|
66
67
|
reader = git__calloc(1, sizeof(tree_reader));
|
67
68
|
GIT_ERROR_CHECK_ALLOC(reader);
|
@@ -82,14 +83,14 @@ typedef struct {
|
|
82
83
|
} workdir_reader;
|
83
84
|
|
84
85
|
static int workdir_reader_read(
|
85
|
-
|
86
|
+
git_str *out,
|
86
87
|
git_oid *out_id,
|
87
88
|
git_filemode_t *out_filemode,
|
88
89
|
git_reader *_reader,
|
89
90
|
const char *filename)
|
90
91
|
{
|
91
92
|
workdir_reader *reader = (workdir_reader *)_reader;
|
92
|
-
|
93
|
+
git_str path = GIT_STR_INIT;
|
93
94
|
struct stat st;
|
94
95
|
git_filemode_t filemode;
|
95
96
|
git_filter_list *filters = NULL;
|
@@ -97,8 +98,7 @@ static int workdir_reader_read(
|
|
97
98
|
git_oid id;
|
98
99
|
int error;
|
99
100
|
|
100
|
-
if ((error =
|
101
|
-
git_repository_workdir(reader->repo), filename)) < 0)
|
101
|
+
if ((error = git_repository_workdir_path(&path, reader->repo, filename)) < 0)
|
102
102
|
goto done;
|
103
103
|
|
104
104
|
if ((error = p_lstat(path.ptr, &st)) < 0) {
|
@@ -120,7 +120,7 @@ static int workdir_reader_read(
|
|
120
120
|
GIT_FILTER_TO_ODB, GIT_FILTER_DEFAULT)) < 0)
|
121
121
|
goto done;
|
122
122
|
|
123
|
-
if ((error =
|
123
|
+
if ((error = git_filter_list__apply_to_file(out,
|
124
124
|
filters, reader->repo, path.ptr)) < 0)
|
125
125
|
goto done;
|
126
126
|
|
@@ -146,7 +146,7 @@ static int workdir_reader_read(
|
|
146
146
|
|
147
147
|
done:
|
148
148
|
git_filter_list_free(filters);
|
149
|
-
|
149
|
+
git_str_dispose(&path);
|
150
150
|
return error;
|
151
151
|
}
|
152
152
|
|
@@ -158,7 +158,8 @@ int git_reader_for_workdir(
|
|
158
158
|
workdir_reader *reader;
|
159
159
|
int error;
|
160
160
|
|
161
|
-
|
161
|
+
GIT_ASSERT_ARG(out);
|
162
|
+
GIT_ASSERT_ARG(repo);
|
162
163
|
|
163
164
|
reader = git__calloc(1, sizeof(workdir_reader));
|
164
165
|
GIT_ERROR_CHECK_ALLOC(reader);
|
@@ -185,7 +186,7 @@ typedef struct {
|
|
185
186
|
} index_reader;
|
186
187
|
|
187
188
|
static int index_reader_read(
|
188
|
-
|
189
|
+
git_str *out,
|
189
190
|
git_oid *out_id,
|
190
191
|
git_filemode_t *out_filemode,
|
191
192
|
git_reader *_reader,
|
@@ -223,7 +224,8 @@ int git_reader_for_index(
|
|
223
224
|
index_reader *reader;
|
224
225
|
int error;
|
225
226
|
|
226
|
-
|
227
|
+
GIT_ASSERT_ARG(out);
|
228
|
+
GIT_ASSERT_ARG(repo);
|
227
229
|
|
228
230
|
reader = git__calloc(1, sizeof(index_reader));
|
229
231
|
GIT_ERROR_CHECK_ALLOC(reader);
|
@@ -245,13 +247,15 @@ int git_reader_for_index(
|
|
245
247
|
/* generic */
|
246
248
|
|
247
249
|
int git_reader_read(
|
248
|
-
|
250
|
+
git_str *out,
|
249
251
|
git_oid *out_id,
|
250
252
|
git_filemode_t *out_filemode,
|
251
253
|
git_reader *reader,
|
252
254
|
const char *filename)
|
253
255
|
{
|
254
|
-
|
256
|
+
GIT_ASSERT_ARG(out);
|
257
|
+
GIT_ASSERT_ARG(reader);
|
258
|
+
GIT_ASSERT_ARG(filename);
|
255
259
|
|
256
260
|
return reader->read(out, out_id, out_filemode, reader, filename);
|
257
261
|
}
|
data/vendor/libgit2/src/reader.h
CHANGED
@@ -25,7 +25,7 @@ typedef struct git_reader git_reader;
|
|
25
25
|
* reader after disposing the underlying object that it reads.
|
26
26
|
*/
|
27
27
|
struct git_reader {
|
28
|
-
int (*read)(
|
28
|
+
int (*read)(git_str *out, git_oid *out_oid, git_filemode_t *mode, git_reader *reader, const char *filename);
|
29
29
|
};
|
30
30
|
|
31
31
|
/**
|
@@ -91,7 +91,7 @@ extern int git_reader_for_workdir(
|
|
91
91
|
* @param filename The filename to read from the reader
|
92
92
|
*/
|
93
93
|
extern int git_reader_read(
|
94
|
-
|
94
|
+
git_str *out,
|
95
95
|
git_oid *out_id,
|
96
96
|
git_filemode_t *out_filemode,
|
97
97
|
git_reader *reader,
|