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
@@ -1,84 +1,85 @@
|
|
1
1
|
add_library(git2internal OBJECT)
|
2
2
|
set_target_properties(git2internal PROPERTIES C_STANDARD 90)
|
3
|
+
set_target_properties(git2internal PROPERTIES C_EXTENSIONS OFF)
|
3
4
|
|
4
|
-
IF(DEBUG_POOL)
|
5
|
-
SET(GIT_DEBUG_POOL 1)
|
6
|
-
ENDIF()
|
7
|
-
ADD_FEATURE_INFO(debugpool GIT_DEBUG_POOL "debug pool allocator")
|
8
5
|
|
9
|
-
|
6
|
+
if(DEPRECATE_HARD)
|
7
|
+
add_definitions(-DGIT_DEPRECATE_HARD)
|
8
|
+
endif()
|
9
|
+
|
10
|
+
if(DEBUG_POOL)
|
11
|
+
set(GIT_DEBUG_POOL 1)
|
12
|
+
endif()
|
13
|
+
add_feature_info(debugpool GIT_DEBUG_POOL "debug pool allocator")
|
14
|
+
|
15
|
+
if(DEBUG_STRICT_ALLOC)
|
16
|
+
set(GIT_DEBUG_STRICT_ALLOC 1)
|
17
|
+
endif()
|
18
|
+
add_feature_info(debugalloc GIT_DEBUG_STRICT_ALLOC "debug strict allocators")
|
19
|
+
|
20
|
+
if(DEBUG_STRICT_OPEN)
|
21
|
+
set(GIT_DEBUG_STRICT_OPEN 1)
|
22
|
+
endif()
|
23
|
+
add_feature_info(debugopen GIT_DEBUG_STRICT_OPEN "path validation in open")
|
24
|
+
|
25
|
+
|
26
|
+
include(PkgBuildConfig)
|
27
|
+
include(SanitizeBool)
|
10
28
|
|
11
29
|
# This variable will contain the libraries we need to put into
|
12
30
|
# libgit2.pc's Requires.private. That is, what we're linking to or
|
13
31
|
# what someone who's statically linking us needs to link to.
|
14
|
-
|
32
|
+
set(LIBGIT2_PC_REQUIRES "")
|
15
33
|
# This will be set later if we use the system's http-parser library or
|
16
34
|
# use iconv (OSX) and will be written to the Libs.private field in the
|
17
35
|
# pc file.
|
18
|
-
|
36
|
+
set(LIBGIT2_PC_LIBS "")
|
19
37
|
|
20
|
-
|
38
|
+
set(LIBGIT2_INCLUDES
|
21
39
|
"${CMAKE_CURRENT_BINARY_DIR}"
|
22
|
-
"${
|
23
|
-
"${
|
24
|
-
SET(LIBGIT2_SYSTEM_INCLUDES "")
|
25
|
-
SET(LIBGIT2_LIBS "")
|
40
|
+
"${PROJECT_SOURCE_DIR}/src"
|
41
|
+
"${PROJECT_SOURCE_DIR}/include")
|
26
42
|
|
27
|
-
|
43
|
+
if(HAVE_FUTIMENS)
|
44
|
+
set(GIT_USE_FUTIMENS 1)
|
45
|
+
endif ()
|
46
|
+
add_feature_info(futimens GIT_USE_FUTIMENS "futimens support")
|
28
47
|
|
29
|
-
|
30
|
-
IF(ENABLE_TRACE)
|
31
|
-
SET(GIT_TRACE 1)
|
32
|
-
ENDIF()
|
33
|
-
ADD_FEATURE_INFO(tracing GIT_TRACE "tracing support")
|
34
|
-
|
35
|
-
CHECK_FUNCTION_EXISTS(futimens HAVE_FUTIMENS)
|
36
|
-
IF (HAVE_FUTIMENS)
|
37
|
-
SET(GIT_USE_FUTIMENS 1)
|
38
|
-
ENDIF ()
|
39
|
-
|
40
|
-
CHECK_PROTOTYPE_DEFINITION(qsort_r
|
48
|
+
check_prototype_definition(qsort_r
|
41
49
|
"void qsort_r(void *base, size_t nmemb, size_t size, void *thunk, int (*compar)(void *, const void *, const void *))"
|
42
|
-
"" "stdlib.h"
|
43
|
-
IF (HAVE_QSORT_R_BSD)
|
44
|
-
target_compile_definitions(git2internal PRIVATE HAVE_QSORT_R_BSD)
|
45
|
-
ENDIF()
|
50
|
+
"" "stdlib.h" GIT_QSORT_R_BSD)
|
46
51
|
|
47
|
-
|
52
|
+
check_prototype_definition(qsort_r
|
48
53
|
"void qsort_r(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *, void *), void *arg)"
|
49
|
-
"" "stdlib.h"
|
50
|
-
|
51
|
-
|
52
|
-
ENDIF()
|
54
|
+
"" "stdlib.h" GIT_QSORT_R_GNU)
|
55
|
+
|
56
|
+
check_function_exists(qsort_s GIT_QSORT_S)
|
53
57
|
|
54
|
-
|
55
|
-
IF (HAVE_QSORT_S)
|
56
|
-
target_compile_definitions(git2internal PRIVATE HAVE_QSORT_S)
|
57
|
-
ENDIF ()
|
58
|
+
check_function_exists(getentropy GIT_RAND_GETENTROPY)
|
58
59
|
|
59
60
|
# Find required dependencies
|
60
61
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
62
|
+
if(WIN32)
|
63
|
+
list(APPEND LIBGIT2_SYSTEM_LIBS ws2_32)
|
64
|
+
elseif(CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
|
65
|
+
list(APPEND LIBGIT2_SYSTEM_LIBS socket nsl)
|
66
|
+
list(APPEND LIBGIT2_PC_LIBS "-lsocket" "-lnsl")
|
67
|
+
elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku")
|
68
|
+
list(APPEND LIBGIT2_SYSTEM_LIBS network)
|
69
|
+
list(APPEND LIBGIT2_PC_LIBS "-lnetwork")
|
70
|
+
endif()
|
71
|
+
|
72
|
+
check_library_exists(rt clock_gettime "time.h" NEED_LIBRT)
|
73
|
+
if(NEED_LIBRT)
|
74
|
+
list(APPEND LIBGIT2_SYSTEM_LIBS rt)
|
75
|
+
list(APPEND LIBGIT2_PC_LIBS "-lrt")
|
76
|
+
endif()
|
77
|
+
|
78
|
+
if(USE_THREADS)
|
79
|
+
list(APPEND LIBGIT2_SYSTEM_LIBS ${CMAKE_THREAD_LIBS_INIT})
|
80
|
+
list(APPEND LIBGIT2_PC_LIBS ${CMAKE_THREAD_LIBS_INIT})
|
81
|
+
endif()
|
82
|
+
add_feature_info(threadsafe USE_THREADS "threadsafe support")
|
82
83
|
|
83
84
|
|
84
85
|
if(WIN32 AND EMBED_SSH_PATH)
|
@@ -91,201 +92,90 @@ if(WIN32 AND EMBED_SSH_PATH)
|
|
91
92
|
set(GIT_SSH 1)
|
92
93
|
endif()
|
93
94
|
|
94
|
-
IF (WIN32 AND WINHTTP)
|
95
|
-
SET(GIT_WINHTTP 1)
|
96
|
-
|
97
|
-
# Since MinGW does not come with headers or an import library for winhttp,
|
98
|
-
# we have to include a private header and generate our own import library
|
99
|
-
IF (MINGW)
|
100
|
-
ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/winhttp" "${libgit2_BINARY_DIR}/deps/winhttp")
|
101
|
-
LIST(APPEND LIBGIT2_LIBS winhttp)
|
102
|
-
LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/winhttp")
|
103
|
-
ELSE()
|
104
|
-
LIST(APPEND LIBGIT2_LIBS "winhttp")
|
105
|
-
LIST(APPEND LIBGIT2_PC_LIBS "-lwinhttp")
|
106
|
-
ENDIF ()
|
107
|
-
|
108
|
-
LIST(APPEND LIBGIT2_LIBS "rpcrt4" "crypt32" "ole32")
|
109
|
-
LIST(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32")
|
110
|
-
ENDIF()
|
111
|
-
|
112
95
|
include(SelectHTTPSBackend)
|
113
96
|
include(SelectHashes)
|
97
|
+
include(SelectHTTPParser)
|
98
|
+
include(SelectRegex)
|
99
|
+
include(SelectSSH)
|
100
|
+
include(SelectWinHTTP)
|
101
|
+
include(SelectZlib)
|
102
|
+
|
103
|
+
|
104
|
+
if(USE_SHA1 STREQUAL "CollisionDetection")
|
105
|
+
file(GLOB SRC_SHA1 hash/sha1/collisiondetect.* hash/sha1/sha1dc/*)
|
106
|
+
elseif(USE_SHA1 STREQUAL "OpenSSL")
|
107
|
+
file(GLOB SRC_SHA1 hash/sha1/openssl.*)
|
108
|
+
elseif(USE_SHA1 STREQUAL "CommonCrypto")
|
109
|
+
file(GLOB SRC_SHA1 hash/sha1/common_crypto.*)
|
110
|
+
elseif(USE_SHA1 STREQUAL "mbedTLS")
|
111
|
+
file(GLOB SRC_SHA1 hash/sha1/mbedtls.*)
|
112
|
+
elseif(USE_SHA1 STREQUAL "Win32")
|
113
|
+
file(GLOB SRC_SHA1 hash/sha1/win32.*)
|
114
|
+
elseif(USE_SHA1 STREQUAL "Generic")
|
115
|
+
file(GLOB SRC_SHA1 hash/sha1/generic.*)
|
116
|
+
endif()
|
117
|
+
list(APPEND SRC_SHA1 "hash/sha1.h")
|
114
118
|
target_sources(git2internal PRIVATE ${SRC_SHA1})
|
115
119
|
|
116
|
-
# Specify regular expression implementation
|
117
|
-
FIND_PACKAGE(PCRE)
|
118
|
-
|
119
|
-
IF(REGEX_BACKEND STREQUAL "")
|
120
|
-
CHECK_SYMBOL_EXISTS(regcomp_l "regex.h;xlocale.h" HAVE_REGCOMP_L)
|
121
|
-
|
122
|
-
IF(HAVE_REGCOMP_L)
|
123
|
-
SET(REGEX_BACKEND "regcomp_l")
|
124
|
-
ELSEIF(PCRE_FOUND)
|
125
|
-
SET(REGEX_BACKEND "pcre")
|
126
|
-
ELSE()
|
127
|
-
SET(REGEX_BACKEND "builtin")
|
128
|
-
ENDIF()
|
129
|
-
ENDIF()
|
130
|
-
|
131
|
-
IF(REGEX_BACKEND STREQUAL "regcomp_l")
|
132
|
-
ADD_FEATURE_INFO(regex ON "using system regcomp_l")
|
133
|
-
SET(GIT_REGEX_REGCOMP_L 1)
|
134
|
-
ELSEIF(REGEX_BACKEND STREQUAL "pcre2")
|
135
|
-
FIND_PACKAGE(PCRE2)
|
136
|
-
|
137
|
-
IF(NOT PCRE2_FOUND)
|
138
|
-
MESSAGE(FATAL_ERROR "PCRE2 support was requested but not found")
|
139
|
-
ENDIF()
|
140
|
-
|
141
|
-
ADD_FEATURE_INFO(regex ON "using system PCRE2")
|
142
|
-
SET(GIT_REGEX_PCRE2 1)
|
143
|
-
|
144
|
-
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${PCRE2_INCLUDE_DIRS})
|
145
|
-
LIST(APPEND LIBGIT2_LIBS ${PCRE2_LIBRARIES})
|
146
|
-
LIST(APPEND LIBGIT2_PC_REQUIRES "libpcre2-8")
|
147
|
-
ELSEIF(REGEX_BACKEND STREQUAL "pcre")
|
148
|
-
ADD_FEATURE_INFO(regex ON "using system PCRE")
|
149
|
-
SET(GIT_REGEX_PCRE 1)
|
150
|
-
|
151
|
-
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${PCRE_INCLUDE_DIRS})
|
152
|
-
LIST(APPEND LIBGIT2_LIBS ${PCRE_LIBRARIES})
|
153
|
-
LIST(APPEND LIBGIT2_PC_REQUIRES "libpcre")
|
154
|
-
ELSEIF(REGEX_BACKEND STREQUAL "regcomp")
|
155
|
-
ADD_FEATURE_INFO(regex ON "using system regcomp")
|
156
|
-
SET(GIT_REGEX_REGCOMP 1)
|
157
|
-
ELSEIF(REGEX_BACKEND STREQUAL "builtin")
|
158
|
-
ADD_FEATURE_INFO(regex ON "using bundled PCRE")
|
159
|
-
SET(GIT_REGEX_BUILTIN 1)
|
160
|
-
|
161
|
-
ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/pcre" "${libgit2_BINARY_DIR}/deps/pcre")
|
162
|
-
LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/pcre")
|
163
|
-
LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:pcre>)
|
164
|
-
ELSE()
|
165
|
-
MESSAGE(FATAL_ERROR "The REGEX_BACKEND option provided is not supported")
|
166
|
-
ENDIF()
|
167
|
-
|
168
|
-
# Optional external dependency: http-parser
|
169
|
-
IF(USE_HTTP_PARSER STREQUAL "system")
|
170
|
-
FIND_PACKAGE(HTTP_Parser)
|
171
|
-
|
172
|
-
IF (HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2)
|
173
|
-
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${HTTP_PARSER_INCLUDE_DIRS})
|
174
|
-
LIST(APPEND LIBGIT2_LIBS ${HTTP_PARSER_LIBRARIES})
|
175
|
-
LIST(APPEND LIBGIT2_PC_LIBS "-lhttp_parser")
|
176
|
-
ADD_FEATURE_INFO(http-parser ON "http-parser support (system)")
|
177
|
-
ELSE()
|
178
|
-
MESSAGE(FATAL_ERROR "http-parser support was requested but not found")
|
179
|
-
ENDIF()
|
180
|
-
ELSE()
|
181
|
-
MESSAGE(STATUS "http-parser version 2 was not found or disabled; using bundled 3rd-party sources.")
|
182
|
-
ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/http-parser" "${libgit2_BINARY_DIR}/deps/http-parser")
|
183
|
-
LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/http-parser")
|
184
|
-
LIST(APPEND LIBGIT2_OBJECTS "$<TARGET_OBJECTS:http-parser>")
|
185
|
-
ADD_FEATURE_INFO(http-parser ON "http-parser support (bundled)")
|
186
|
-
ENDIF()
|
187
|
-
|
188
|
-
# Optional external dependency: zlib
|
189
|
-
IF(NOT USE_BUNDLED_ZLIB)
|
190
|
-
FIND_PACKAGE(ZLIB)
|
191
|
-
IF(ZLIB_FOUND)
|
192
|
-
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${ZLIB_INCLUDE_DIRS})
|
193
|
-
LIST(APPEND LIBGIT2_LIBS ${ZLIB_LIBRARIES})
|
194
|
-
IF(APPLE OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
195
|
-
LIST(APPEND LIBGIT2_PC_LIBS "-lz")
|
196
|
-
ELSE()
|
197
|
-
LIST(APPEND LIBGIT2_PC_REQUIRES "zlib")
|
198
|
-
ENDIF()
|
199
|
-
ADD_FEATURE_INFO(zlib ON "using system zlib")
|
200
|
-
ELSE()
|
201
|
-
MESSAGE(STATUS "zlib was not found; using bundled 3rd-party sources." )
|
202
|
-
ENDIF()
|
203
|
-
ENDIF()
|
204
|
-
IF(USE_BUNDLED_ZLIB OR NOT ZLIB_FOUND)
|
205
|
-
ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/zlib" "${libgit2_BINARY_DIR}/deps/zlib")
|
206
|
-
LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/zlib")
|
207
|
-
LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:zlib>)
|
208
|
-
ADD_FEATURE_INFO(zlib ON "using bundled zlib")
|
209
|
-
ENDIF()
|
210
|
-
|
211
|
-
# Optional external dependency: libssh2
|
212
|
-
IF (USE_SSH)
|
213
|
-
FIND_PKGLIBRARIES(LIBSSH2 libssh2)
|
214
|
-
ENDIF()
|
215
|
-
IF (LIBSSH2_FOUND)
|
216
|
-
SET(GIT_SSH 1)
|
217
|
-
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${LIBSSH2_INCLUDE_DIRS})
|
218
|
-
LIST(APPEND LIBGIT2_LIBS ${LIBSSH2_LIBRARIES})
|
219
|
-
LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS})
|
220
|
-
|
221
|
-
CHECK_LIBRARY_EXISTS("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "${LIBSSH2_LIBRARY_DIRS}" HAVE_LIBSSH2_MEMORY_CREDENTIALS)
|
222
|
-
IF (HAVE_LIBSSH2_MEMORY_CREDENTIALS)
|
223
|
-
SET(GIT_SSH_MEMORY_CREDENTIALS 1)
|
224
|
-
ENDIF()
|
225
|
-
ELSE()
|
226
|
-
MESSAGE(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.")
|
227
|
-
ENDIF()
|
228
|
-
ADD_FEATURE_INFO(SSH GIT_SSH "SSH transport support")
|
229
|
-
|
230
120
|
# Optional external dependency: ntlmclient
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
121
|
+
if(USE_NTLMCLIENT)
|
122
|
+
set(GIT_NTLM 1)
|
123
|
+
add_subdirectory("${PROJECT_SOURCE_DIR}/deps/ntlmclient" "${PROJECT_BINARY_DIR}/deps/ntlmclient")
|
124
|
+
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${PROJECT_SOURCE_DIR}/deps/ntlmclient")
|
125
|
+
list(APPEND LIBGIT2_DEPENDENCY_OBJECTS "$<TARGET_OBJECTS:ntlmclient>")
|
126
|
+
endif()
|
127
|
+
add_feature_info(ntlmclient GIT_NTLM "NTLM authentication support for Unix")
|
238
128
|
|
239
129
|
# Optional external dependency: GSSAPI
|
240
130
|
|
241
|
-
|
131
|
+
include(SelectGSSAPI)
|
242
132
|
|
243
133
|
# Optional external dependency: iconv
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
134
|
+
if(USE_ICONV)
|
135
|
+
find_package(Iconv)
|
136
|
+
endif()
|
137
|
+
if(ICONV_FOUND)
|
138
|
+
set(GIT_USE_ICONV 1)
|
139
|
+
list(APPEND LIBGIT2_SYSTEM_INCLUDES ${ICONV_INCLUDE_DIR})
|
140
|
+
list(APPEND LIBGIT2_SYSTEM_LIBS ${ICONV_LIBRARIES})
|
141
|
+
list(APPEND LIBGIT2_PC_LIBS ${ICONV_LIBRARIES})
|
142
|
+
endif()
|
143
|
+
add_feature_info(iconv GIT_USE_ICONV "iconv encoding conversion support")
|
144
|
+
|
145
|
+
|
146
|
+
if(USE_THREADS)
|
147
|
+
if(NOT WIN32)
|
148
|
+
find_package(Threads REQUIRED)
|
149
|
+
endif()
|
150
|
+
|
151
|
+
set(GIT_THREADS 1)
|
152
|
+
endif()
|
153
|
+
|
154
|
+
if(USE_NSEC)
|
155
|
+
set(GIT_USE_NSEC 1)
|
156
|
+
endif()
|
157
|
+
|
158
|
+
if(HAVE_STRUCT_STAT_ST_MTIM)
|
159
|
+
set(GIT_USE_STAT_MTIM 1)
|
160
|
+
elseif(HAVE_STRUCT_STAT_ST_MTIMESPEC)
|
161
|
+
set(GIT_USE_STAT_MTIMESPEC 1)
|
162
|
+
elseif(HAVE_STRUCT_STAT_ST_MTIME_NSEC)
|
163
|
+
set(GIT_USE_STAT_MTIME_NSEC 1)
|
164
|
+
endif()
|
275
165
|
|
276
166
|
target_compile_definitions(git2internal PRIVATE _FILE_OFFSET_BITS=64)
|
277
167
|
|
278
168
|
# Collect sourcefiles
|
279
169
|
file(GLOB SRC_H
|
280
|
-
"${
|
281
|
-
"${
|
282
|
-
"${
|
170
|
+
"${PROJECT_SOURCE_DIR}/include/git2.h"
|
171
|
+
"${PROJECT_SOURCE_DIR}/include/git2/*.h"
|
172
|
+
"${PROJECT_SOURCE_DIR}/include/git2/sys/*.h")
|
283
173
|
list(SORT SRC_H)
|
284
174
|
target_sources(git2internal PRIVATE ${SRC_H})
|
285
175
|
|
286
176
|
# On Windows use specific platform sources
|
287
177
|
if(WIN32 AND NOT CYGWIN)
|
288
|
-
|
178
|
+
set(WIN_RC "win32/git2.rc")
|
289
179
|
|
290
180
|
file(GLOB SRC_OS win32/*.c win32/*.h)
|
291
181
|
list(SORT SRC_OS)
|
@@ -298,9 +188,9 @@ else()
|
|
298
188
|
target_sources(git2internal PRIVATE ${SRC_OS})
|
299
189
|
endif()
|
300
190
|
|
301
|
-
|
191
|
+
if(USE_LEAK_CHECKER STREQUAL "valgrind")
|
302
192
|
target_compile_definitions(git2internal PRIVATE VALGRIND)
|
303
|
-
|
193
|
+
endif()
|
304
194
|
|
305
195
|
file(GLOB SRC_GIT2 *.c *.h
|
306
196
|
allocators/*.c allocators/*.h
|
@@ -310,78 +200,90 @@ file(GLOB SRC_GIT2 *.c *.h
|
|
310
200
|
list(SORT SRC_GIT2)
|
311
201
|
target_sources(git2internal PRIVATE ${SRC_GIT2})
|
312
202
|
|
313
|
-
|
203
|
+
if(APPLE)
|
314
204
|
# The old Secure Transport API has been deprecated in macOS 10.15.
|
315
|
-
|
316
|
-
|
205
|
+
set_source_files_properties(streams/stransport.c PROPERTIES COMPILE_FLAGS -Wno-deprecated)
|
206
|
+
endif()
|
317
207
|
|
318
208
|
# the xdiff dependency is not (yet) warning-free, disable warnings as
|
319
209
|
# errors for the xdiff sources until we've sorted them out
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
210
|
+
if(MSVC)
|
211
|
+
set_source_files_properties(xdiff/xdiffi.c PROPERTIES COMPILE_FLAGS -WX-)
|
212
|
+
set_source_files_properties(xdiff/xemit.c PROPERTIES COMPILE_FLAGS -WX-)
|
213
|
+
set_source_files_properties(xdiff/xhistogram.c PROPERTIES COMPILE_FLAGS -WX-)
|
214
|
+
set_source_files_properties(xdiff/xmerge.c PROPERTIES COMPILE_FLAGS -WX-)
|
215
|
+
set_source_files_properties(xdiff/xutils.c PROPERTIES COMPILE_FLAGS -WX-)
|
216
|
+
set_source_files_properties(xdiff/xpatience.c PROPERTIES COMPILE_FLAGS -WX-)
|
217
|
+
else()
|
218
|
+
set_source_files_properties(xdiff/xdiffi.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare -Wno-unused-parameter")
|
219
|
+
set_source_files_properties(xdiff/xemit.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare -Wno-unused-parameter")
|
220
|
+
set_source_files_properties(xdiff/xhistogram.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
|
221
|
+
set_source_files_properties(xdiff/xutils.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
|
222
|
+
set_source_files_properties(xdiff/xpatience.c PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
|
223
|
+
endif()
|
324
224
|
|
325
225
|
# Determine architecture of the machine
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
226
|
+
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
227
|
+
set(GIT_ARCH_64 1)
|
228
|
+
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
229
|
+
set(GIT_ARCH_32 1)
|
230
|
+
elseif(CMAKE_SIZEOF_VOID_P)
|
231
|
+
message(FATAL_ERROR "Unsupported architecture (pointer size is ${CMAKE_SIZEOF_VOID_P} bytes)")
|
232
|
+
else()
|
233
|
+
message(FATAL_ERROR "Unsupported architecture (CMAKE_SIZEOF_VOID_P is unset)")
|
234
|
+
endif()
|
235
|
+
|
236
|
+
configure_file(features.h.in git2/sys/features.h)
|
237
|
+
|
238
|
+
ide_split_sources(git2internal)
|
239
|
+
list(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:git2internal> ${LIBGIT2_DEPENDENCY_OBJECTS})
|
240
|
+
|
241
|
+
target_include_directories(git2internal PRIVATE ${LIBGIT2_INCLUDES} ${LIBGIT2_DEPENDENCY_INCLUDES} PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
242
|
+
target_include_directories(git2internal SYSTEM PRIVATE ${LIBGIT2_SYSTEM_INCLUDES})
|
243
|
+
|
244
|
+
set(LIBGIT2_INCLUDES ${LIBGIT2_INCLUDES} PARENT_SCOPE)
|
245
|
+
set(LIBGIT2_OBJECTS ${LIBGIT2_OBJECTS} PARENT_SCOPE)
|
246
|
+
set(LIBGIT2_DEPENDENCY_INCLUDES ${LIBGIT2_DEPENDENCY_INCLUDES} PARENT_SCOPE)
|
247
|
+
set(LIBGIT2_DEPENDENCY_OBJECTS ${LIBGIT2_DEPENDENCY_OBJECTS} PARENT_SCOPE)
|
248
|
+
set(LIBGIT2_SYSTEM_INCLUDES ${LIBGIT2_SYSTEM_INCLUDES} PARENT_SCOPE)
|
249
|
+
set(LIBGIT2_SYSTEM_LIBS ${LIBGIT2_SYSTEM_LIBS} PARENT_SCOPE)
|
250
|
+
|
251
|
+
if(XCODE_VERSION)
|
350
252
|
# This is required for Xcode to actually link the libgit2 library
|
351
253
|
# when using only object libraries.
|
352
|
-
|
353
|
-
|
354
|
-
|
254
|
+
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.c "")
|
255
|
+
list(APPEND LIBGIT2_OBJECTS ${CMAKE_CURRENT_BINARY_DIR}/dummy.c)
|
256
|
+
endif()
|
355
257
|
|
356
258
|
# Compile and link libgit2
|
357
|
-
|
358
|
-
|
259
|
+
add_library(git2 ${WIN_RC} ${LIBGIT2_OBJECTS})
|
260
|
+
target_link_libraries(git2 ${LIBGIT2_SYSTEM_LIBS})
|
359
261
|
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
262
|
+
set_target_properties(git2 PROPERTIES C_STANDARD 90)
|
263
|
+
set_target_properties(git2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
264
|
+
set_target_properties(git2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
265
|
+
set_target_properties(git2 PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
364
266
|
|
365
267
|
# Workaround for Cmake bug #0011240 (see http://public.kitware.com/Bug/view.php?id=11240)
|
366
268
|
# Win64+MSVC+static libs = linker error
|
367
|
-
|
368
|
-
|
369
|
-
|
269
|
+
if(MSVC AND GIT_ARCH_64 AND NOT BUILD_SHARED_LIBS)
|
270
|
+
set_target_properties(git2 PROPERTIES STATIC_LIBRARY_FLAGS "/MACHINE:x64")
|
271
|
+
endif()
|
370
272
|
|
371
|
-
|
273
|
+
ide_split_sources(git2)
|
372
274
|
|
373
275
|
if(SONAME)
|
374
276
|
set_target_properties(git2 PROPERTIES VERSION ${libgit2_VERSION})
|
375
277
|
set_target_properties(git2 PROPERTIES SOVERSION "${libgit2_VERSION_MAJOR}.${libgit2_VERSION_MINOR}")
|
376
278
|
if(LIBGIT2_FILENAME)
|
377
|
-
target_compile_definitions(
|
279
|
+
target_compile_definitions(git2 PRIVATE LIBGIT2_FILENAME=\"${LIBGIT2_FILENAME}\")
|
378
280
|
set_target_properties(git2 PROPERTIES OUTPUT_NAME ${LIBGIT2_FILENAME})
|
379
281
|
elseif(DEFINED LIBGIT2_PREFIX)
|
380
282
|
set_target_properties(git2 PROPERTIES PREFIX "${LIBGIT2_PREFIX}")
|
381
283
|
endif()
|
382
284
|
endif()
|
383
285
|
|
384
|
-
|
286
|
+
pkg_build_config(NAME libgit2
|
385
287
|
VERSION ${libgit2_VERSION}
|
386
288
|
DESCRIPTION "The git library, take 2"
|
387
289
|
LIBS_SELF git2
|
@@ -389,17 +291,17 @@ PKG_BUILD_CONFIG(NAME libgit2
|
|
389
291
|
REQUIRES ${LIBGIT2_PC_REQUIRES}
|
390
292
|
)
|
391
293
|
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
294
|
+
if(MSVC_IDE)
|
295
|
+
# Precompiled headers
|
296
|
+
set_target_properties(git2 PROPERTIES COMPILE_FLAGS "/Yuprecompiled.h /FIprecompiled.h")
|
297
|
+
set_source_files_properties(win32/precompiled.c COMPILE_FLAGS "/Ycprecompiled.h")
|
298
|
+
endif()
|
397
299
|
|
398
300
|
# Install
|
399
|
-
|
301
|
+
install(TARGETS git2
|
400
302
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
401
303
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
402
304
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
403
305
|
)
|
404
|
-
|
405
|
-
|
306
|
+
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/git2 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
307
|
+
install(FILES ${PROJECT_SOURCE_DIR}/include/git2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
data/vendor/libgit2/src/alloc.c
CHANGED
@@ -6,16 +6,29 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
#include "alloc.h"
|
9
|
+
#include "runtime.h"
|
9
10
|
|
11
|
+
#include "allocators/failalloc.h"
|
10
12
|
#include "allocators/stdalloc.h"
|
11
|
-
#include "allocators/
|
12
|
-
|
13
|
-
|
13
|
+
#include "allocators/win32_leakcheck.h"
|
14
|
+
|
15
|
+
/* Fail any allocation until git_libgit2_init is called. */
|
16
|
+
git_allocator git__allocator = {
|
17
|
+
git_failalloc_malloc,
|
18
|
+
git_failalloc_calloc,
|
19
|
+
git_failalloc_strdup,
|
20
|
+
git_failalloc_strndup,
|
21
|
+
git_failalloc_substrdup,
|
22
|
+
git_failalloc_realloc,
|
23
|
+
git_failalloc_reallocarray,
|
24
|
+
git_failalloc_mallocarray,
|
25
|
+
git_failalloc_free
|
26
|
+
};
|
14
27
|
|
15
28
|
static int setup_default_allocator(void)
|
16
29
|
{
|
17
|
-
#if defined(
|
18
|
-
return
|
30
|
+
#if defined(GIT_WIN32_LEAKCHECK)
|
31
|
+
return git_win32_leakcheck_init_allocator(&git__allocator);
|
19
32
|
#else
|
20
33
|
return git_stdalloc_init_allocator(&git__allocator);
|
21
34
|
#endif
|
@@ -24,10 +37,10 @@ static int setup_default_allocator(void)
|
|
24
37
|
int git_allocator_global_init(void)
|
25
38
|
{
|
26
39
|
/*
|
27
|
-
* We don't want to overwrite any allocator which has been set
|
28
|
-
* the init function is called.
|
40
|
+
* We don't want to overwrite any allocator which has been set
|
41
|
+
* before the init function is called.
|
29
42
|
*/
|
30
|
-
if (git__allocator.gmalloc !=
|
43
|
+
if (git__allocator.gmalloc != git_failalloc_malloc)
|
31
44
|
return 0;
|
32
45
|
|
33
46
|
return setup_default_allocator();
|