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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd9e9d1521fe3c4ead7642651af0bbf071c2b076be3144458d8f11abc58a95b3
|
4
|
+
data.tar.gz: 4f1cfdbbd40ec1cf1061a62ee73265b2e3b51b4cdc076096ab90984fa284549d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bb5a3504f11e676cfc01ae0212e8d0e67cd3bf79bf32e73f4d88662e15f1e6997b50ade4cc7cd4d453f55670d921fa00f2feeec17bbfc69e82e31323114a837
|
7
|
+
data.tar.gz: 3c1d68d25b56f587ab5e7532d077cc793feebed4d1d90d25b566c7969c326328d0c96d847f90774c2beb0b33de914b7887b0316a1960cd8620133bdc5e451449
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -577,7 +577,7 @@ You can store bare repositories in alternative backends instead of storing on di
|
|
577
577
|
`redbadger/rugged-redis` for an example of how a rugged backend works).
|
578
578
|
|
579
579
|
```ruby
|
580
|
-
a_backend =
|
580
|
+
a_backend = MyProject::CustomObjectDB(opt1: 'setting', opt2: 'setting')
|
581
581
|
|
582
582
|
repo = Rugged::Repository.init_at('repo_name', :bare, backend: a_backend)
|
583
583
|
|
data/ext/rugged/extconf.rb
CHANGED
@@ -98,12 +98,12 @@ else
|
|
98
98
|
end
|
99
99
|
|
100
100
|
Dir.chdir(LIBGIT2_DIR) do
|
101
|
-
Dir.mkdir("build") if !Dir.
|
101
|
+
Dir.mkdir("build") if !Dir.exist?("build")
|
102
102
|
|
103
103
|
Dir.chdir("build") do
|
104
104
|
# On Windows, Ruby-DevKit is MSYS-based, so ensure to use MSYS Makefiles.
|
105
105
|
generator = "-G \"MSYS Makefiles\"" if Gem.win_platform?
|
106
|
-
run_cmake(5 * 60, ".. -
|
106
|
+
run_cmake(5 * 60, ".. -DBUILD_TESTS=OFF -DUSE_THREADS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo #{cmake_flags.join(' ')} #{generator}")
|
107
107
|
sys(MAKE)
|
108
108
|
|
109
109
|
# "normal" libraries (and libgit2 builds) get all these when they build but we're doing it
|
data/ext/rugged/rugged.c
CHANGED
@@ -220,15 +220,18 @@ static VALUE rb_git_prettify_message(int argc, VALUE *argv, VALUE self)
|
|
220
220
|
return result;
|
221
221
|
}
|
222
222
|
|
223
|
-
static VALUE minimize_cb(
|
223
|
+
static VALUE minimize_cb(RB_BLOCK_CALL_FUNC_ARGLIST(rb_oid, shorten))
|
224
224
|
{
|
225
|
+
git_oid_shorten *shortener = (git_oid_shorten*) shorten;
|
226
|
+
|
225
227
|
Check_Type(rb_oid, T_STRING);
|
226
228
|
git_oid_shorten_add(shortener, RSTRING_PTR(rb_oid));
|
227
229
|
return Qnil;
|
228
230
|
}
|
229
231
|
|
230
|
-
static VALUE minimize_yield(
|
232
|
+
static VALUE minimize_yield(RB_BLOCK_CALL_FUNC_ARGLIST(rb_oid, args))
|
231
233
|
{
|
234
|
+
VALUE *data = (VALUE*) args;
|
232
235
|
rb_funcall(data[0], rb_intern("call"), 1,
|
233
236
|
rb_str_substr(rb_oid, 0, FIX2INT(data[1])));
|
234
237
|
return Qnil;
|
@@ -293,7 +296,7 @@ static VALUE rb_git_minimize_oid(int argc, VALUE *argv, VALUE self)
|
|
293
296
|
|
294
297
|
shrt = git_oid_shorten_new(minlen);
|
295
298
|
|
296
|
-
|
299
|
+
rb_block_call(rb_enum, rb_intern("each"), 0, NULL, minimize_cb, (VALUE)shrt);
|
297
300
|
length = git_oid_shorten_add(shrt, NULL);
|
298
301
|
|
299
302
|
git_oid_shorten_free(shrt);
|
@@ -305,7 +308,7 @@ static VALUE rb_git_minimize_oid(int argc, VALUE *argv, VALUE self)
|
|
305
308
|
yield_data[0] = rb_block;
|
306
309
|
yield_data[1] = INT2FIX(length);
|
307
310
|
|
308
|
-
|
311
|
+
rb_block_call(rb_enum, rb_intern("each"), 0, NULL, minimize_yield, (VALUE)yield_data);
|
309
312
|
return Qnil;
|
310
313
|
}
|
311
314
|
|
data/ext/rugged/rugged_config.c
CHANGED
@@ -181,17 +181,22 @@ static int cb_config__each_key(const git_config_entry *entry, void *payload)
|
|
181
181
|
static int cb_config__each_pair(const git_config_entry *entry, void *payload)
|
182
182
|
{
|
183
183
|
int *exception = (int *) payload;
|
184
|
+
VALUE value;
|
184
185
|
|
185
|
-
|
186
|
+
value = entry->value ? rb_str_new_utf8(entry->value) : Qnil;
|
187
|
+
rb_protect(rb_yield, rb_ary_new3(2, rb_str_new_utf8(entry->name), value), exception);
|
186
188
|
|
187
189
|
return (*exception != 0) ? GIT_EUSER : GIT_OK;
|
188
190
|
}
|
189
191
|
|
190
192
|
static int cb_config__to_hash(const git_config_entry *entry, void *opaque)
|
191
193
|
{
|
194
|
+
VALUE value;
|
195
|
+
|
196
|
+
value = entry->value ? rb_str_new_utf8(entry->value) : Qnil;
|
192
197
|
rb_hash_aset((VALUE)opaque,
|
193
198
|
rb_str_new_utf8(entry->name),
|
194
|
-
|
199
|
+
value
|
195
200
|
);
|
196
201
|
|
197
202
|
return GIT_OK;
|
data/ext/rugged/rugged_object.c
CHANGED
@@ -400,7 +400,7 @@ static VALUE rb_git_object_read_raw(VALUE self)
|
|
400
400
|
|
401
401
|
void Init_rugged_object(void)
|
402
402
|
{
|
403
|
-
rb_cRuggedObject = rb_define_class_under(rb_mRugged, "Object",
|
403
|
+
rb_cRuggedObject = rb_define_class_under(rb_mRugged, "Object", rb_cObject);
|
404
404
|
rb_define_singleton_method(rb_cRuggedObject, "lookup", rb_git_object_lookup, 2);
|
405
405
|
rb_define_singleton_method(rb_cRuggedObject, "rev_parse", rb_git_object_rev_parse, 2);
|
406
406
|
rb_define_singleton_method(rb_cRuggedObject, "rev_parse_oid", rb_git_object_rev_parse_oid, 2);
|
data/ext/rugged/rugged_remote.c
CHANGED
@@ -219,6 +219,17 @@ static void init_proxy_options(VALUE rb_options, git_proxy_options *proxy_option
|
|
219
219
|
}
|
220
220
|
}
|
221
221
|
|
222
|
+
static void init_pb_parallelism(VALUE rb_options, git_push_options *opts)
|
223
|
+
{
|
224
|
+
if (NIL_P(rb_options)) return;
|
225
|
+
|
226
|
+
VALUE val = rb_hash_aref(rb_options, CSTR2SYM("pb_parallelism"));
|
227
|
+
if (!NIL_P(val)) {
|
228
|
+
Check_Type(val, T_FIXNUM);
|
229
|
+
opts->pb_parallelism = FIX2UINT(val);
|
230
|
+
}
|
231
|
+
}
|
232
|
+
|
222
233
|
static int parse_prune_type(VALUE rb_prune_type)
|
223
234
|
{
|
224
235
|
if (rb_prune_type == Qtrue) {
|
@@ -683,6 +694,11 @@ static VALUE rb_git_remote_fetch(int argc, VALUE *argv, VALUE self)
|
|
683
694
|
* :proxy_url ::
|
684
695
|
* The url of an http proxy to use to access the remote repository.
|
685
696
|
*
|
697
|
+
* :pb_parallelism ::
|
698
|
+
* Sets the number of worker threads that will be available to the packbuilder when generating
|
699
|
+
* a pack file, if required by the transport being used. A value of 0 means the packbuilder will
|
700
|
+
* auto-detect the number of of threads to use.
|
701
|
+
*
|
686
702
|
* Example:
|
687
703
|
*
|
688
704
|
* remote = Rugged::Remote.lookup(@repo, 'origin')
|
@@ -709,6 +725,7 @@ static VALUE rb_git_remote_push(int argc, VALUE *argv, VALUE self)
|
|
709
725
|
rugged_remote_init_callbacks_and_payload_from_options(rb_options, &opts.callbacks, &payload);
|
710
726
|
init_custom_headers(rb_options, &opts.custom_headers);
|
711
727
|
init_proxy_options(rb_options, &opts.proxy_opts);
|
728
|
+
init_pb_parallelism(rb_options, &opts);
|
712
729
|
|
713
730
|
error = git_remote_push(remote, &refspecs, &opts);
|
714
731
|
|
data/ext/rugged/rugged_repo.c
CHANGED
@@ -1460,8 +1460,8 @@ static VALUE rb_git_repo_is_shallow(VALUE self)
|
|
1460
1460
|
* call-seq:
|
1461
1461
|
* repo.empty? -> true or false
|
1462
1462
|
*
|
1463
|
-
* Return whether a repository is empty or not. An empty repository has
|
1464
|
-
*
|
1463
|
+
* Return whether a repository is empty or not. An empty repository has HEAD
|
1464
|
+
* pointing to the default value and there are no other references.
|
1465
1465
|
*/
|
1466
1466
|
static VALUE rb_git_repo_is_empty(VALUE self)
|
1467
1467
|
{
|
@@ -2845,7 +2845,7 @@ void Init_rugged_repo(void)
|
|
2845
2845
|
rb_define_method(rb_cRuggedRepo, "cherrypick_commit", rb_git_repo_cherrypick_commit, -1);
|
2846
2846
|
rb_define_method(rb_cRuggedRepo, "fetch_attributes", rb_git_repo_attributes, -1);
|
2847
2847
|
|
2848
|
-
rb_cRuggedOdbObject = rb_define_class_under(rb_mRugged, "OdbObject",
|
2848
|
+
rb_cRuggedOdbObject = rb_define_class_under(rb_mRugged, "OdbObject", rb_cObject);
|
2849
2849
|
rb_define_method(rb_cRuggedOdbObject, "data", rb_git_odbobj_data, 0);
|
2850
2850
|
rb_define_method(rb_cRuggedOdbObject, "len", rb_git_odbobj_size, 0);
|
2851
2851
|
rb_define_method(rb_cRuggedOdbObject, "type", rb_git_odbobj_type, 0);
|
data/lib/rugged/repository.rb
CHANGED
@@ -263,12 +263,12 @@ module Rugged
|
|
263
263
|
#
|
264
264
|
# Returns a hash containing the pushed refspecs as keys and
|
265
265
|
# any error messages or +nil+ as values.
|
266
|
-
def push(remote_or_url, *args)
|
266
|
+
def push(remote_or_url, *args, **kwargs)
|
267
267
|
unless remote_or_url.kind_of? Remote
|
268
268
|
remote_or_url = remotes[remote_or_url] || remotes.create_anonymous(remote_or_url)
|
269
269
|
end
|
270
270
|
|
271
|
-
remote_or_url.push(*args)
|
271
|
+
remote_or_url.push(*args, **kwargs)
|
272
272
|
end
|
273
273
|
end
|
274
274
|
end
|
data/lib/rugged/version.rb
CHANGED
@@ -1,301 +1,133 @@
|
|
1
1
|
# CMake build script for the libgit2 project
|
2
|
-
#
|
3
|
-
# Building (out of source build):
|
4
|
-
# > mkdir build && cd build
|
5
|
-
# > cmake .. [-DSETTINGS=VALUE]
|
6
|
-
# > cmake --build .
|
7
|
-
#
|
8
|
-
# Testing:
|
9
|
-
# > ctest -V
|
10
|
-
#
|
11
|
-
# Install:
|
12
|
-
# > cmake --build . --target install
|
2
|
+
# See `README.md` for build instructions.
|
13
3
|
|
14
|
-
|
4
|
+
cmake_minimum_required(VERSION 3.5.1)
|
15
5
|
|
16
|
-
project(libgit2 VERSION "1.
|
6
|
+
project(libgit2 VERSION "1.4.3" LANGUAGES C)
|
17
7
|
|
18
8
|
# Add find modules to the path
|
19
|
-
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${
|
20
|
-
|
21
|
-
INCLUDE(CheckLibraryExists)
|
22
|
-
INCLUDE(CheckFunctionExists)
|
23
|
-
INCLUDE(CheckSymbolExists)
|
24
|
-
INCLUDE(CheckStructHasMember)
|
25
|
-
INCLUDE(CheckPrototypeDefinition) # Added in CMake 3.0
|
26
|
-
INCLUDE(AddCFlagIfSupported)
|
27
|
-
INCLUDE(FindPkgLibraries)
|
28
|
-
INCLUDE(FindThreads)
|
29
|
-
INCLUDE(FindStatNsec)
|
30
|
-
INCLUDE(GNUInstallDirs)
|
31
|
-
INCLUDE(IdeSplitSources)
|
32
|
-
INCLUDE(FeatureSummary)
|
33
|
-
INCLUDE(EnableWarnings)
|
9
|
+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
|
34
10
|
|
11
|
+
#
|
35
12
|
# Build options
|
36
13
|
#
|
37
|
-
OPTION(SONAME "Set the (SO)VERSION of the target" ON)
|
38
|
-
OPTION(BUILD_SHARED_LIBS "Build Shared Library (OFF for Static)" ON)
|
39
|
-
OPTION(THREADSAFE "Build libgit2 as threadsafe" ON)
|
40
|
-
OPTION(BUILD_CLAR "Build Tests using the Clar suite" ON)
|
41
|
-
OPTION(BUILD_EXAMPLES "Build library usage example apps" OFF)
|
42
|
-
OPTION(BUILD_FUZZERS "Build the fuzz targets" OFF)
|
43
|
-
OPTION(ENABLE_TRACE "Enables tracing support" ON)
|
44
|
-
OPTION(LIBGIT2_FILENAME "Name of the produced binary" OFF)
|
45
|
-
OPTION(USE_SSH "Link with libssh2 to enable SSH support" ON)
|
46
|
-
OPTION(USE_HTTPS "Enable HTTPS support. Can be set to a specific backend" ON)
|
47
|
-
OPTION(USE_SHA1 "Enable SHA1. Can be set to CollisionDetection(ON)/HTTPS/Generic" ON)
|
48
|
-
OPTION(USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF)
|
49
|
-
OPTION(USE_STANDALONE_FUZZERS "Enable standalone fuzzers (compatible with gcc)" OFF)
|
50
|
-
OPTION(USE_LEAK_CHECKER "Run tests with leak checker" OFF)
|
51
|
-
OPTION(DEBUG_POOL "Enable debug pool allocator" OFF)
|
52
|
-
OPTION(ENABLE_WERROR "Enable compilation with -Werror" OFF)
|
53
|
-
OPTION(USE_BUNDLED_ZLIB "Use the bundled version of zlib" OFF)
|
54
|
-
SET(USE_HTTP_PARSER "" CACHE STRING "Specifies the HTTP Parser implementation; either system or builtin.")
|
55
|
-
OPTION(DEPRECATE_HARD "Do not include deprecated functions in the library" OFF)
|
56
|
-
SET(REGEX_BACKEND "" CACHE STRING "Regular expression implementation. One of regcomp_l, pcre2, pcre, regcomp, or builtin.")
|
57
14
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
15
|
+
# Optional subsystems
|
16
|
+
option(BUILD_SHARED_LIBS "Build Shared Library (OFF for Static)" ON)
|
17
|
+
option(BUILD_TESTS "Build Tests using the Clar suite" ON)
|
18
|
+
option(BUILD_EXAMPLES "Build library usage example apps" OFF)
|
19
|
+
option(BUILD_FUZZERS "Build the fuzz targets" OFF)
|
20
|
+
|
21
|
+
# Suggested functionality that may not be available on a per-platform basis
|
22
|
+
option(USE_THREADS "Use threads for parallel processing when possible" ON)
|
23
|
+
option(USE_NSEC "Support nanosecond precision file mtimes and ctimes" ON)
|
24
|
+
|
25
|
+
# Backend selection
|
26
|
+
option(USE_SSH "Link with libssh2 to enable SSH support" OFF)
|
27
|
+
option(USE_HTTPS "Enable HTTPS support. Can be set to a specific backend" ON)
|
28
|
+
option(USE_SHA1 "Enable SHA1. Can be set to CollisionDetection(ON)/HTTPS/Generic" ON)
|
29
|
+
option(USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF)
|
30
|
+
set(USE_HTTP_PARSER "" CACHE STRING "Specifies the HTTP Parser implementation; either system or builtin.")
|
31
|
+
set(REGEX_BACKEND "" CACHE STRING "Regular expression implementation. One of regcomp_l, pcre2, pcre, regcomp, or builtin.")
|
32
|
+
option(USE_BUNDLED_ZLIB "Use the bundled version of zlib. Can be set to one of Bundled(ON)/Chromium. The Chromium option requires a x86_64 processor with SSE4.2 and CLMUL" OFF)
|
33
|
+
|
34
|
+
# Debugging options
|
35
|
+
option(USE_LEAK_CHECKER "Run tests with leak checker" OFF)
|
36
|
+
option(USE_STANDALONE_FUZZERS "Enable standalone fuzzers (compatible with gcc)" OFF)
|
37
|
+
option(DEBUG_POOL "Enable debug pool allocator" OFF)
|
38
|
+
option(DEBUG_STRICT_ALLOC "Enable strict allocator behavior" OFF)
|
39
|
+
option(DEBUG_STRICT_OPEN "Enable path validation in open" OFF)
|
40
|
+
|
41
|
+
# Output options
|
42
|
+
option(SONAME "Set the (SO)VERSION of the target" ON)
|
43
|
+
set(LIBGIT2_FILENAME "git2" CACHE STRING "Name of the produced binary")
|
44
|
+
option(DEPRECATE_HARD "Do not include deprecated functions in the library" OFF)
|
45
|
+
|
46
|
+
# Compilation options
|
47
|
+
option(ENABLE_WERROR "Enable compilation with -Werror" OFF)
|
48
|
+
|
49
|
+
if(UNIX)
|
50
|
+
# NTLM client requires crypto libraries from the system HTTPS stack
|
51
|
+
if(NOT USE_HTTPS)
|
52
|
+
option(USE_NTLMCLIENT "Enable NTLM support on Unix." OFF)
|
53
|
+
else()
|
54
|
+
option(USE_NTLMCLIENT "Enable NTLM support on Unix." ON)
|
55
|
+
endif()
|
65
56
|
|
66
|
-
|
67
|
-
|
68
|
-
ENDIF()
|
57
|
+
option(ENABLE_REPRODUCIBLE_BUILDS "Enable reproducible builds" OFF)
|
58
|
+
endif()
|
69
59
|
|
70
|
-
|
71
|
-
|
72
|
-
|
60
|
+
if(APPLE)
|
61
|
+
option(USE_ICONV "Link with and use iconv library" ON)
|
62
|
+
endif()
|
73
63
|
|
74
|
-
|
64
|
+
if(MSVC)
|
75
65
|
# This option must match the settings used in your program, in particular if you
|
76
66
|
# are linking statically
|
77
|
-
|
67
|
+
option(STATIC_CRT "Link the static CRT libraries" ON)
|
78
68
|
|
79
69
|
# If you want to embed a copy of libssh2 into libgit2, pass a
|
80
70
|
# path to libssh2
|
81
|
-
|
82
|
-
ENDIF()
|
71
|
+
option(EMBED_SSH_PATH "Path to libssh2 to embed (Windows)" OFF)
|
83
72
|
|
73
|
+
# Enable leak checking using the debugging C runtime.
|
74
|
+
option(WIN32_LEAKCHECK "Enable leak reporting via crtdbg" OFF)
|
75
|
+
endif()
|
84
76
|
|
85
|
-
|
77
|
+
if(WIN32)
|
86
78
|
# By default, libgit2 is built with WinHTTP. To use the built-in
|
87
|
-
# HTTP transport, invoke CMake with the "-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
# /MP - Parallel build
|
114
|
-
SET(CMAKE_C_FLAGS "/GF /MP /nologo ${CMAKE_C_FLAGS}")
|
115
|
-
|
116
|
-
# /Gd - explicitly set cdecl calling convention
|
117
|
-
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gd")
|
118
|
-
|
119
|
-
IF (NOT (MSVC_VERSION LESS 1900))
|
120
|
-
# /guard:cf - Enable Control Flow Guard
|
121
|
-
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /guard:cf")
|
122
|
-
ENDIF()
|
123
|
-
|
124
|
-
IF (STATIC_CRT)
|
125
|
-
SET(CRT_FLAG_DEBUG "/MTd")
|
126
|
-
SET(CRT_FLAG_RELEASE "/MT")
|
127
|
-
ELSE()
|
128
|
-
SET(CRT_FLAG_DEBUG "/MDd")
|
129
|
-
SET(CRT_FLAG_RELEASE "/MD")
|
130
|
-
ENDIF()
|
131
|
-
|
132
|
-
IF (MSVC_CRTDBG)
|
133
|
-
SET(GIT_MSVC_CRTDBG 1)
|
134
|
-
SET(CRT_FLAG_DEBUG "${CRT_FLAG_DEBUG}")
|
135
|
-
SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} Dbghelp.lib")
|
136
|
-
ENDIF()
|
137
|
-
|
138
|
-
# /Zi - Create debugging information
|
139
|
-
# /Od - Disable optimization
|
140
|
-
# /D_DEBUG - #define _DEBUG
|
141
|
-
# /MTd - Statically link the multithreaded debug version of the CRT
|
142
|
-
# /MDd - Dynamically link the multithreaded debug version of the CRT
|
143
|
-
# /RTC1 - Run time checks
|
144
|
-
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Zi /Od /D_DEBUG /RTC1 ${CRT_FLAG_DEBUG}")
|
145
|
-
|
146
|
-
# /DNDEBUG - Disables asserts
|
147
|
-
# /MT - Statically link the multithreaded release version of the CRT
|
148
|
-
# /MD - Dynamically link the multithreaded release version of the CRT
|
149
|
-
# /O2 - Optimize for speed
|
150
|
-
# /Oy - Enable frame pointer omission (FPO) (otherwise CMake will automatically turn it off)
|
151
|
-
# /GL - Link time code generation (whole program optimization)
|
152
|
-
# /Gy - Function-level linking
|
153
|
-
SET(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /O2 /Oy /GL /Gy ${CRT_FLAG_RELEASE}")
|
79
|
+
# HTTP transport, invoke CMake with the "-DUSE_WINHTTP=OFF" argument.
|
80
|
+
option(USE_WINHTTP "Use Win32 WinHTTP routines" ON)
|
81
|
+
endif()
|
82
|
+
|
83
|
+
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
|
84
|
+
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
|
85
|
+
endif()
|
86
|
+
|
87
|
+
|
88
|
+
# Modules
|
89
|
+
|
90
|
+
include(CheckLibraryExists)
|
91
|
+
include(CheckFunctionExists)
|
92
|
+
include(CheckSymbolExists)
|
93
|
+
include(CheckStructHasMember)
|
94
|
+
include(CheckPrototypeDefinition)
|
95
|
+
include(AddCFlagIfSupported)
|
96
|
+
include(FindPkgLibraries)
|
97
|
+
include(FindThreads)
|
98
|
+
include(FindStatNsec)
|
99
|
+
include(Findfutimens)
|
100
|
+
include(GNUInstallDirs)
|
101
|
+
include(IdeSplitSources)
|
102
|
+
include(FeatureSummary)
|
103
|
+
include(EnableWarnings)
|
104
|
+
include(DefaultCFlags)
|
154
105
|
|
155
|
-
# /Oy- - Disable frame pointer omission (FPO)
|
156
|
-
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/DNDEBUG /Zi /O2 /Oy- /GL /Gy ${CRT_FLAG_RELEASE}")
|
157
106
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
# /IGNORE:4221 - Ignore empty compilation units
|
162
|
-
SET(CMAKE_STATIC_LINKER_FLAGS "/IGNORE:4221")
|
163
|
-
|
164
|
-
# /DYNAMICBASE - Address space load randomization (ASLR)
|
165
|
-
# /NXCOMPAT - Data execution prevention (DEP)
|
166
|
-
# /LARGEADDRESSAWARE - >2GB user address space on x86
|
167
|
-
# /VERSION - Embed version information in PE header
|
168
|
-
SET(CMAKE_EXE_LINKER_FLAGS "/DYNAMICBASE /NXCOMPAT /LARGEADDRESSAWARE /VERSION:${libgit2_VERSION_MAJOR}.${libgit2_VERSION_MINOR}")
|
169
|
-
|
170
|
-
IF (NOT (MSVC_VERSION LESS 1900))
|
171
|
-
# /GUARD:CF - Enable Control Flow Guard
|
172
|
-
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /GUARD:CF")
|
173
|
-
ENDIF()
|
174
|
-
|
175
|
-
# /DEBUG - Create a PDB
|
176
|
-
# /LTCG - Link time code generation (whole program optimization)
|
177
|
-
# /OPT:REF /OPT:ICF - Fold out duplicate code at link step
|
178
|
-
# /INCREMENTAL:NO - Required to use /LTCG
|
179
|
-
# /DEBUGTYPE:cv,fixup - Additional data embedded in the PDB (requires /INCREMENTAL:NO, so not on for Debug)
|
180
|
-
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG")
|
181
|
-
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "/RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO")
|
182
|
-
SET(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/DEBUG /RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO /DEBUGTYPE:cv,fixup")
|
183
|
-
SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "/RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO")
|
184
|
-
|
185
|
-
# Same linker settings for DLL as EXE
|
186
|
-
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
187
|
-
SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
|
188
|
-
SET(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
|
189
|
-
SET(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}")
|
190
|
-
SET(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL}")
|
191
|
-
ELSE ()
|
192
|
-
IF (ENABLE_REPRODUCIBLE_BUILDS)
|
193
|
-
SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Dqc <TARGET> <LINK_FLAGS> <OBJECTS>")
|
194
|
-
SET(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> Dq <TARGET> <LINK_FLAGS> <OBJECTS>")
|
195
|
-
SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -D <TARGET>")
|
196
|
-
ENDIF()
|
197
|
-
|
198
|
-
SET(CMAKE_C_FLAGS "-D_GNU_SOURCE ${CMAKE_C_FLAGS}")
|
199
|
-
|
200
|
-
ENABLE_WARNINGS(all)
|
201
|
-
ENABLE_WARNINGS(extra)
|
202
|
-
|
203
|
-
IF (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
|
204
|
-
SET(CMAKE_C_FLAGS "-D_POSIX_C_SOURCE=200112L -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS ${CMAKE_C_FLAGS}")
|
205
|
-
ENDIF()
|
206
|
-
|
207
|
-
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -O0")
|
208
|
-
|
209
|
-
IF (MINGW OR MSYS) # MinGW and MSYS always do PIC and complain if we tell them to
|
210
|
-
STRING(REGEX REPLACE "-fPIC" "" CMAKE_SHARED_LIBRARY_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS}")
|
211
|
-
ELSEIF (BUILD_SHARED_LIBS)
|
212
|
-
ADD_C_FLAG_IF_SUPPORTED(-fvisibility=hidden)
|
107
|
+
#
|
108
|
+
# Subdirectories
|
109
|
+
#
|
213
110
|
|
214
|
-
|
215
|
-
ENDIF ()
|
111
|
+
add_subdirectory(src)
|
216
112
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
ADD_DEFINITIONS(-D__USE_MINGW_ANSI_STDIO=1)
|
222
|
-
ENDIF ()
|
113
|
+
if(BUILD_TESTS)
|
114
|
+
enable_testing()
|
115
|
+
add_subdirectory(tests)
|
116
|
+
endif()
|
223
117
|
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
enable_warnings(strict-aliasing)
|
228
|
-
enable_warnings(strict-prototypes)
|
229
|
-
enable_warnings(declaration-after-statement)
|
230
|
-
enable_warnings(shift-count-overflow)
|
231
|
-
enable_warnings(unused-const-variable)
|
232
|
-
enable_warnings(unused-function)
|
233
|
-
enable_warnings(int-conversion)
|
118
|
+
if(BUILD_EXAMPLES)
|
119
|
+
add_subdirectory(examples)
|
120
|
+
endif()
|
234
121
|
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
if(MINGW)
|
239
|
-
disable_warnings(format)
|
240
|
-
disable_warnings(format-security)
|
241
|
-
else()
|
242
|
-
enable_warnings(format)
|
243
|
-
enable_warnings(format-security)
|
122
|
+
if(BUILD_FUZZERS)
|
123
|
+
if((BUILD_TESTS OR BUILD_EXAMPLES) AND NOT USE_STANDALONE_FUZZERS)
|
124
|
+
message(FATAL_ERROR "Cannot build the fuzzer and the tests or examples together")
|
244
125
|
endif()
|
245
|
-
|
246
|
-
|
247
|
-
# Ensure that MinGW provides the correct header files.
|
248
|
-
IF (WIN32 AND NOT CYGWIN)
|
249
|
-
ADD_DEFINITIONS(-DWIN32 -D_WIN32_WINNT=0x0600)
|
250
|
-
ENDIF()
|
251
|
-
|
252
|
-
IF( NOT CMAKE_CONFIGURATION_TYPES )
|
253
|
-
# Build Debug by default
|
254
|
-
IF (NOT CMAKE_BUILD_TYPE)
|
255
|
-
SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
|
256
|
-
ENDIF ()
|
257
|
-
ELSE()
|
258
|
-
# Using a multi-configuration generator eg MSVC or Xcode
|
259
|
-
# that uses CMAKE_CONFIGURATION_TYPES and not CMAKE_BUILD_TYPE
|
260
|
-
ENDIF()
|
261
|
-
|
262
|
-
IF(BUILD_FUZZERS AND NOT USE_STANDALONE_FUZZERS)
|
263
|
-
# The actual sanitizer link target will be added when linking the fuzz
|
264
|
-
# targets.
|
265
|
-
SET(CMAKE_REQUIRED_FLAGS "-fsanitize=fuzzer-no-link")
|
266
|
-
ADD_C_FLAG(-fsanitize=fuzzer-no-link)
|
267
|
-
UNSET(CMAKE_REQUIRED_FLAGS)
|
268
|
-
ENDIF ()
|
269
|
-
|
270
|
-
ADD_SUBDIRECTORY(src)
|
271
|
-
|
272
|
-
# Tests
|
273
|
-
IF (NOT MSVC)
|
274
|
-
IF (NOT BUILD_SHARED_LIBS)
|
275
|
-
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
276
|
-
ENDIF()
|
277
|
-
ENDIF ()
|
278
|
-
|
279
|
-
IF (BUILD_CLAR)
|
280
|
-
ENABLE_TESTING()
|
281
|
-
ADD_SUBDIRECTORY(tests)
|
282
|
-
ENDIF ()
|
126
|
+
add_subdirectory(fuzzers)
|
127
|
+
endif()
|
283
128
|
|
284
|
-
IF (BUILD_EXAMPLES)
|
285
|
-
ADD_SUBDIRECTORY(examples)
|
286
|
-
ENDIF ()
|
287
129
|
|
288
|
-
|
289
|
-
IF(NOT USE_STANDALONE_FUZZERS)
|
290
|
-
IF(BUILD_EXAMPLES)
|
291
|
-
MESSAGE(FATAL_ERROR "Cannot build the fuzzer targets and the examples together")
|
292
|
-
ENDIF()
|
293
|
-
IF(BUILD_CLAR)
|
294
|
-
MESSAGE(FATAL_ERROR "Cannot build the fuzzer targets and the tests together")
|
295
|
-
ENDIF()
|
296
|
-
ENDIF()
|
297
|
-
ADD_SUBDIRECTORY(fuzzers)
|
298
|
-
ENDIF()
|
130
|
+
# Summary
|
299
131
|
|
300
|
-
|
301
|
-
|
132
|
+
feature_summary(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:")
|
133
|
+
feature_summary(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:")
|