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
@@ -133,6 +133,9 @@ typedef enum {
|
|
133
133
|
*/
|
134
134
|
GIT_DIFF_INDENT_HEURISTIC = (1u << 18),
|
135
135
|
|
136
|
+
/** Ignore blank lines */
|
137
|
+
GIT_DIFF_IGNORE_BLANK_LINES = (1u << 19),
|
138
|
+
|
136
139
|
/** Treat all files as text, disabling binary attributes & detection */
|
137
140
|
GIT_DIFF_FORCE_TEXT = (1u << 20),
|
138
141
|
/** Treat all files as binary, disabling text diffs */
|
@@ -167,7 +170,7 @@ typedef enum {
|
|
167
170
|
/** Include the necessary deflate / delta information so that `git-apply`
|
168
171
|
* can apply given diff information to binary files.
|
169
172
|
*/
|
170
|
-
GIT_DIFF_SHOW_BINARY = (1u << 30)
|
173
|
+
GIT_DIFF_SHOW_BINARY = (1u << 30)
|
171
174
|
} git_diff_option_t;
|
172
175
|
|
173
176
|
/**
|
@@ -205,6 +208,7 @@ typedef enum {
|
|
205
208
|
GIT_DIFF_FLAG_NOT_BINARY = (1u << 1), /**< file(s) treated as text data */
|
206
209
|
GIT_DIFF_FLAG_VALID_ID = (1u << 2), /**< `id` value is known correct */
|
207
210
|
GIT_DIFF_FLAG_EXISTS = (1u << 3), /**< file exists at this side of the delta */
|
211
|
+
GIT_DIFF_FLAG_VALID_SIZE = (1u << 4) /**< file size value is known correct */
|
208
212
|
} git_diff_flag_t;
|
209
213
|
|
210
214
|
/**
|
@@ -228,7 +232,7 @@ typedef enum {
|
|
228
232
|
GIT_DELTA_UNTRACKED = 7, /**< entry is untracked item in workdir */
|
229
233
|
GIT_DELTA_TYPECHANGE = 8, /**< type of entry changed between old and new */
|
230
234
|
GIT_DELTA_UNREADABLE = 9, /**< entry is unreadable */
|
231
|
-
GIT_DELTA_CONFLICTED = 10
|
235
|
+
GIT_DELTA_CONFLICTED = 10 /**< entry in the index is conflicted */
|
232
236
|
} git_delta_t;
|
233
237
|
|
234
238
|
/**
|
@@ -237,32 +241,43 @@ typedef enum {
|
|
237
241
|
* Although this is called a "file", it could represent a file, a symbolic
|
238
242
|
* link, a submodule commit id, or even a tree (although that only if you
|
239
243
|
* are tracking type changes or ignored/untracked directories).
|
240
|
-
*
|
241
|
-
* The `id` is the `git_oid` of the item. If the entry represents an
|
242
|
-
* absent side of a diff (e.g. the `old_file` of a `GIT_DELTA_ADDED` delta),
|
243
|
-
* then the oid will be zeroes.
|
244
|
-
*
|
245
|
-
* `path` is the NUL-terminated path to the entry relative to the working
|
246
|
-
* directory of the repository.
|
247
|
-
*
|
248
|
-
* `size` is the size of the entry in bytes.
|
249
|
-
*
|
250
|
-
* `flags` is a combination of the `git_diff_flag_t` types
|
251
|
-
*
|
252
|
-
* `mode` is, roughly, the stat() `st_mode` value for the item. This will
|
253
|
-
* be restricted to one of the `git_filemode_t` values.
|
254
|
-
*
|
255
|
-
* The `id_abbrev` represents the known length of the `id` field, when
|
256
|
-
* converted to a hex string. It is generally `GIT_OID_HEXSZ`, unless this
|
257
|
-
* delta was created from reading a patch file, in which case it may be
|
258
|
-
* abbreviated to something reasonable, like 7 characters.
|
259
244
|
*/
|
260
245
|
typedef struct {
|
246
|
+
/**
|
247
|
+
* The `git_oid` of the item. If the entry represents an
|
248
|
+
* absent side of a diff (e.g. the `old_file` of a `GIT_DELTA_ADDED` delta),
|
249
|
+
* then the oid will be zeroes.
|
250
|
+
*/
|
261
251
|
git_oid id;
|
252
|
+
|
253
|
+
/**
|
254
|
+
* The NUL-terminated path to the entry relative to the working
|
255
|
+
* directory of the repository.
|
256
|
+
*/
|
262
257
|
const char *path;
|
258
|
+
|
259
|
+
/**
|
260
|
+
* The size of the entry in bytes.
|
261
|
+
*/
|
263
262
|
git_object_size_t size;
|
263
|
+
|
264
|
+
/**
|
265
|
+
* A combination of the `git_diff_flag_t` types
|
266
|
+
*/
|
264
267
|
uint32_t flags;
|
268
|
+
|
269
|
+
/**
|
270
|
+
* Roughly, the stat() `st_mode` value for the item. This will
|
271
|
+
* be restricted to one of the `git_filemode_t` values.
|
272
|
+
*/
|
265
273
|
uint16_t mode;
|
274
|
+
|
275
|
+
/**
|
276
|
+
* Represents the known length of the `id` field, when
|
277
|
+
* converted to a hex string. It is generally `GIT_OID_HEXSZ`, unless this
|
278
|
+
* delta was created from reading a patch file, in which case it may be
|
279
|
+
* abbreviated to something reasonable, like 7 characters.
|
280
|
+
*/
|
266
281
|
uint16_t id_abbrev;
|
267
282
|
} git_diff_file;
|
268
283
|
|
@@ -483,7 +498,7 @@ typedef enum {
|
|
483
498
|
GIT_DIFF_BINARY_LITERAL,
|
484
499
|
|
485
500
|
/** The binary data is the delta from one side to the other. */
|
486
|
-
GIT_DIFF_BINARY_DELTA
|
501
|
+
GIT_DIFF_BINARY_DELTA
|
487
502
|
} git_diff_binary_t;
|
488
503
|
|
489
504
|
/** The contents of one of the files in a binary diff. */
|
@@ -692,7 +707,7 @@ typedef enum {
|
|
692
707
|
* GIT_DIFF_INCLUDE_UNMODIFIED flag. If you do not want UNMODIFIED
|
693
708
|
* records in the final result, pass this flag to have them removed.
|
694
709
|
*/
|
695
|
-
GIT_DIFF_FIND_REMOVE_UNMODIFIED = (1u << 16)
|
710
|
+
GIT_DIFF_FIND_REMOVE_UNMODIFIED = (1u << 16)
|
696
711
|
} git_diff_find_t;
|
697
712
|
|
698
713
|
/**
|
@@ -744,7 +759,7 @@ typedef struct {
|
|
744
759
|
uint16_t copy_threshold;
|
745
760
|
|
746
761
|
/**
|
747
|
-
*
|
762
|
+
* Threshold below which similar files will be split into a delete/add pair.
|
748
763
|
* This is equivalent to the last part of the -B option. Defaults to 60.
|
749
764
|
*/
|
750
765
|
uint16_t break_rewrite_threshold;
|
@@ -754,7 +769,7 @@ typedef struct {
|
|
754
769
|
*
|
755
770
|
* This is a little different from the `-l` option from Git because we
|
756
771
|
* will still process up to this many matches before abandoning the search.
|
757
|
-
* Defaults to
|
772
|
+
* Defaults to 1000.
|
758
773
|
*/
|
759
774
|
size_t rename_limit;
|
760
775
|
|
@@ -817,6 +832,7 @@ GIT_EXTERN(void) git_diff_free(git_diff *diff);
|
|
817
832
|
* @param old_tree A git_tree object to diff from, or NULL for empty tree.
|
818
833
|
* @param new_tree A git_tree object to diff to, or NULL for empty tree.
|
819
834
|
* @param opts Structure with options to influence diff or NULL for defaults.
|
835
|
+
* @return 0 or an error code.
|
820
836
|
*/
|
821
837
|
GIT_EXTERN(int) git_diff_tree_to_tree(
|
822
838
|
git_diff **diff,
|
@@ -843,6 +859,7 @@ GIT_EXTERN(int) git_diff_tree_to_tree(
|
|
843
859
|
* @param old_tree A git_tree object to diff from, or NULL for empty tree.
|
844
860
|
* @param index The index to diff with; repo index used if NULL.
|
845
861
|
* @param opts Structure with options to influence diff or NULL for defaults.
|
862
|
+
* @return 0 or an error code.
|
846
863
|
*/
|
847
864
|
GIT_EXTERN(int) git_diff_tree_to_index(
|
848
865
|
git_diff **diff,
|
@@ -870,6 +887,7 @@ GIT_EXTERN(int) git_diff_tree_to_index(
|
|
870
887
|
* @param repo The repository.
|
871
888
|
* @param index The index to diff from; repo index used if NULL.
|
872
889
|
* @param opts Structure with options to influence diff or NULL for defaults.
|
890
|
+
* @return 0 or an error code.
|
873
891
|
*/
|
874
892
|
GIT_EXTERN(int) git_diff_index_to_workdir(
|
875
893
|
git_diff **diff,
|
@@ -899,6 +917,7 @@ GIT_EXTERN(int) git_diff_index_to_workdir(
|
|
899
917
|
* @param repo The repository containing the tree.
|
900
918
|
* @param old_tree A git_tree object to diff from, or NULL for empty tree.
|
901
919
|
* @param opts Structure with options to influence diff or NULL for defaults.
|
920
|
+
* @return 0 or an error code.
|
902
921
|
*/
|
903
922
|
GIT_EXTERN(int) git_diff_tree_to_workdir(
|
904
923
|
git_diff **diff,
|
@@ -918,6 +937,7 @@ GIT_EXTERN(int) git_diff_tree_to_workdir(
|
|
918
937
|
* @param repo The repository containing the tree.
|
919
938
|
* @param old_tree A git_tree object to diff from, or NULL for empty tree.
|
920
939
|
* @param opts Structure with options to influence diff or NULL for defaults.
|
940
|
+
* @return 0 or an error code.
|
921
941
|
*/
|
922
942
|
GIT_EXTERN(int) git_diff_tree_to_workdir_with_index(
|
923
943
|
git_diff **diff,
|
@@ -936,6 +956,7 @@ GIT_EXTERN(int) git_diff_tree_to_workdir_with_index(
|
|
936
956
|
* @param old_index A git_index object to diff from.
|
937
957
|
* @param new_index A git_index object to diff to.
|
938
958
|
* @param opts Structure with options to influence diff or NULL for defaults.
|
959
|
+
* @return 0 or an error code.
|
939
960
|
*/
|
940
961
|
GIT_EXTERN(int) git_diff_index_to_index(
|
941
962
|
git_diff **diff,
|
@@ -956,6 +977,7 @@ GIT_EXTERN(int) git_diff_index_to_index(
|
|
956
977
|
*
|
957
978
|
* @param onto Diff to merge into.
|
958
979
|
* @param from Diff to merge.
|
980
|
+
* @return 0 or an error code.
|
959
981
|
*/
|
960
982
|
GIT_EXTERN(int) git_diff_merge(
|
961
983
|
git_diff *onto,
|
@@ -1093,7 +1115,7 @@ typedef enum {
|
|
1093
1115
|
GIT_DIFF_FORMAT_RAW = 3u, /**< like git diff --raw */
|
1094
1116
|
GIT_DIFF_FORMAT_NAME_ONLY = 4u, /**< like git diff --name-only */
|
1095
1117
|
GIT_DIFF_FORMAT_NAME_STATUS = 5u, /**< like git diff --name-status */
|
1096
|
-
GIT_DIFF_FORMAT_PATCH_ID = 6u
|
1118
|
+
GIT_DIFF_FORMAT_PATCH_ID = 6u /**< git diff as used by git patch-id */
|
1097
1119
|
} git_diff_format_t;
|
1098
1120
|
|
1099
1121
|
/**
|
@@ -1297,13 +1319,13 @@ typedef enum {
|
|
1297
1319
|
GIT_DIFF_STATS_NUMBER = (1u << 2),
|
1298
1320
|
|
1299
1321
|
/** Extended header information such as creations, renames and mode changes, equivalent of `--summary` */
|
1300
|
-
GIT_DIFF_STATS_INCLUDE_SUMMARY = (1u << 3)
|
1322
|
+
GIT_DIFF_STATS_INCLUDE_SUMMARY = (1u << 3)
|
1301
1323
|
} git_diff_stats_format_t;
|
1302
1324
|
|
1303
1325
|
/**
|
1304
1326
|
* Accumulate diff statistics for all patches.
|
1305
1327
|
*
|
1306
|
-
* @param out Structure
|
1328
|
+
* @param out Structure containing the diff statistics.
|
1307
1329
|
* @param diff A git_diff generated by one of the above functions.
|
1308
1330
|
* @return 0 on success; non-zero on error
|
1309
1331
|
*/
|
@@ -1361,99 +1383,6 @@ GIT_EXTERN(int) git_diff_stats_to_buf(
|
|
1361
1383
|
*/
|
1362
1384
|
GIT_EXTERN(void) git_diff_stats_free(git_diff_stats *stats);
|
1363
1385
|
|
1364
|
-
/**
|
1365
|
-
* Formatting options for diff e-mail generation
|
1366
|
-
*/
|
1367
|
-
typedef enum {
|
1368
|
-
/** Normal patch, the default */
|
1369
|
-
GIT_DIFF_FORMAT_EMAIL_NONE = 0,
|
1370
|
-
|
1371
|
-
/** Don't insert "[PATCH]" in the subject header*/
|
1372
|
-
GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER = (1 << 0),
|
1373
|
-
|
1374
|
-
} git_diff_format_email_flags_t;
|
1375
|
-
|
1376
|
-
/**
|
1377
|
-
* Options for controlling the formatting of the generated e-mail.
|
1378
|
-
*/
|
1379
|
-
typedef struct {
|
1380
|
-
unsigned int version;
|
1381
|
-
|
1382
|
-
/** see `git_diff_format_email_flags_t` above */
|
1383
|
-
uint32_t flags;
|
1384
|
-
|
1385
|
-
/** This patch number */
|
1386
|
-
size_t patch_no;
|
1387
|
-
|
1388
|
-
/** Total number of patches in this series */
|
1389
|
-
size_t total_patches;
|
1390
|
-
|
1391
|
-
/** id to use for the commit */
|
1392
|
-
const git_oid *id;
|
1393
|
-
|
1394
|
-
/** Summary of the change */
|
1395
|
-
const char *summary;
|
1396
|
-
|
1397
|
-
/** Commit message's body */
|
1398
|
-
const char *body;
|
1399
|
-
|
1400
|
-
/** Author of the change */
|
1401
|
-
const git_signature *author;
|
1402
|
-
} git_diff_format_email_options;
|
1403
|
-
|
1404
|
-
#define GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION 1
|
1405
|
-
#define GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT {GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION, 0, 1, 1, NULL, NULL, NULL, NULL}
|
1406
|
-
|
1407
|
-
/**
|
1408
|
-
* Create an e-mail ready patch from a diff.
|
1409
|
-
*
|
1410
|
-
* @param out buffer to store the e-mail patch in
|
1411
|
-
* @param diff containing the commit
|
1412
|
-
* @param opts structure with options to influence content and formatting.
|
1413
|
-
* @return 0 or an error code
|
1414
|
-
*/
|
1415
|
-
GIT_EXTERN(int) git_diff_format_email(
|
1416
|
-
git_buf *out,
|
1417
|
-
git_diff *diff,
|
1418
|
-
const git_diff_format_email_options *opts);
|
1419
|
-
|
1420
|
-
/**
|
1421
|
-
* Create an e-mail ready patch for a commit.
|
1422
|
-
*
|
1423
|
-
* Does not support creating patches for merge commits (yet).
|
1424
|
-
*
|
1425
|
-
* @param out buffer to store the e-mail patch in
|
1426
|
-
* @param repo containing the commit
|
1427
|
-
* @param commit pointer to up commit
|
1428
|
-
* @param patch_no patch number of the commit
|
1429
|
-
* @param total_patches total number of patches in the patch set
|
1430
|
-
* @param flags determines the formatting of the e-mail
|
1431
|
-
* @param diff_opts structure with options to influence diff or NULL for defaults.
|
1432
|
-
* @return 0 or an error code
|
1433
|
-
*/
|
1434
|
-
GIT_EXTERN(int) git_diff_commit_as_email(
|
1435
|
-
git_buf *out,
|
1436
|
-
git_repository *repo,
|
1437
|
-
git_commit *commit,
|
1438
|
-
size_t patch_no,
|
1439
|
-
size_t total_patches,
|
1440
|
-
uint32_t flags,
|
1441
|
-
const git_diff_options *diff_opts);
|
1442
|
-
|
1443
|
-
/**
|
1444
|
-
* Initialize git_diff_format_email_options structure
|
1445
|
-
*
|
1446
|
-
* Initializes a `git_diff_format_email_options` with default values. Equivalent
|
1447
|
-
* to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.
|
1448
|
-
*
|
1449
|
-
* @param opts The `git_blame_options` struct to initialize.
|
1450
|
-
* @param version The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`.
|
1451
|
-
* @return Zero on success; -1 on failure.
|
1452
|
-
*/
|
1453
|
-
GIT_EXTERN(int) git_diff_format_email_options_init(
|
1454
|
-
git_diff_format_email_options *opts,
|
1455
|
-
unsigned int version);
|
1456
|
-
|
1457
1386
|
/**
|
1458
1387
|
* Patch ID options structure
|
1459
1388
|
*
|
@@ -0,0 +1,127 @@
|
|
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_git_email_h__
|
8
|
+
#define INCLUDE_git_email_h__
|
9
|
+
|
10
|
+
#include "common.h"
|
11
|
+
|
12
|
+
/**
|
13
|
+
* @file git2/email.h
|
14
|
+
* @brief Git email formatting and application routines.
|
15
|
+
* @ingroup Git
|
16
|
+
* @{
|
17
|
+
*/
|
18
|
+
GIT_BEGIN_DECL
|
19
|
+
|
20
|
+
/**
|
21
|
+
* Formatting options for diff e-mail generation
|
22
|
+
*/
|
23
|
+
typedef enum {
|
24
|
+
/** Normal patch, the default */
|
25
|
+
GIT_EMAIL_CREATE_DEFAULT = 0,
|
26
|
+
|
27
|
+
/** Do not include patch numbers in the subject prefix. */
|
28
|
+
GIT_EMAIL_CREATE_OMIT_NUMBERS = (1u << 0),
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Include numbers in the subject prefix even when the
|
32
|
+
* patch is for a single commit (1/1).
|
33
|
+
*/
|
34
|
+
GIT_EMAIL_CREATE_ALWAYS_NUMBER = (1u << 1),
|
35
|
+
|
36
|
+
/** Do not perform rename or similarity detection. */
|
37
|
+
GIT_EMAIL_CREATE_NO_RENAMES = (1u << 2)
|
38
|
+
} git_email_create_flags_t;
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Options for controlling the formatting of the generated e-mail.
|
42
|
+
*/
|
43
|
+
typedef struct {
|
44
|
+
unsigned int version;
|
45
|
+
|
46
|
+
/** see `git_email_create_flags_t` above */
|
47
|
+
uint32_t flags;
|
48
|
+
|
49
|
+
/** Options to use when creating diffs */
|
50
|
+
git_diff_options diff_opts;
|
51
|
+
|
52
|
+
/** Options for finding similarities within diffs */
|
53
|
+
git_diff_find_options diff_find_opts;
|
54
|
+
|
55
|
+
/**
|
56
|
+
* The subject prefix, by default "PATCH". If set to an empty
|
57
|
+
* string ("") then only the patch numbers will be shown in the
|
58
|
+
* prefix. If the subject_prefix is empty and patch numbers
|
59
|
+
* are not being shown, the prefix will be omitted entirely.
|
60
|
+
*/
|
61
|
+
const char *subject_prefix;
|
62
|
+
|
63
|
+
/**
|
64
|
+
* The starting patch number; this cannot be 0. By default,
|
65
|
+
* this is 1.
|
66
|
+
*/
|
67
|
+
size_t start_number;
|
68
|
+
|
69
|
+
/** The "re-roll" number. By default, there is no re-roll. */
|
70
|
+
size_t reroll_number;
|
71
|
+
} git_email_create_options;
|
72
|
+
|
73
|
+
/*
|
74
|
+
* By default, our options include rename detection and binary
|
75
|
+
* diffs to match `git format-patch`.
|
76
|
+
*/
|
77
|
+
#define GIT_EMAIL_CREATE_OPTIONS_VERSION 1
|
78
|
+
#define GIT_EMAIL_CREATE_OPTIONS_INIT \
|
79
|
+
{ \
|
80
|
+
GIT_EMAIL_CREATE_OPTIONS_VERSION, \
|
81
|
+
GIT_EMAIL_CREATE_DEFAULT, \
|
82
|
+
{ GIT_DIFF_OPTIONS_VERSION, GIT_DIFF_SHOW_BINARY, GIT_SUBMODULE_IGNORE_UNSPECIFIED, {NULL,0}, NULL, NULL, NULL, 3 }, \
|
83
|
+
GIT_DIFF_FIND_OPTIONS_INIT \
|
84
|
+
}
|
85
|
+
|
86
|
+
/**
|
87
|
+
* Create a diff for a commit in mbox format for sending via email.
|
88
|
+
*
|
89
|
+
* @param out buffer to store the e-mail patch in
|
90
|
+
* @param diff the changes to include in the email
|
91
|
+
* @param patch_idx the patch index
|
92
|
+
* @param patch_count the total number of patches that will be included
|
93
|
+
* @param commit_id the commit id for this change
|
94
|
+
* @param summary the commit message for this change
|
95
|
+
* @param body optional text to include above the diffstat
|
96
|
+
* @param author the person who authored this commit
|
97
|
+
* @param opts email creation options
|
98
|
+
*/
|
99
|
+
GIT_EXTERN(int) git_email_create_from_diff(
|
100
|
+
git_buf *out,
|
101
|
+
git_diff *diff,
|
102
|
+
size_t patch_idx,
|
103
|
+
size_t patch_count,
|
104
|
+
const git_oid *commit_id,
|
105
|
+
const char *summary,
|
106
|
+
const char *body,
|
107
|
+
const git_signature *author,
|
108
|
+
const git_email_create_options *opts);
|
109
|
+
|
110
|
+
/**
|
111
|
+
* Create a diff for a commit in mbox format for sending via email.
|
112
|
+
* The commit must not be a merge commit.
|
113
|
+
*
|
114
|
+
* @param out buffer to store the e-mail patch in
|
115
|
+
* @param commit commit to create a patch for
|
116
|
+
* @param opts email creation options
|
117
|
+
*/
|
118
|
+
GIT_EXTERN(int) git_email_create_from_commit(
|
119
|
+
git_buf *out,
|
120
|
+
git_commit *commit,
|
121
|
+
const git_email_create_options *opts);
|
122
|
+
|
123
|
+
GIT_END_DECL
|
124
|
+
|
125
|
+
/** @} */
|
126
|
+
|
127
|
+
#endif
|
@@ -42,14 +42,14 @@ typedef enum {
|
|
42
42
|
GIT_ECONFLICT = -13, /**< Checkout conflicts prevented operation */
|
43
43
|
GIT_ELOCKED = -14, /**< Lock file prevented operation */
|
44
44
|
GIT_EMODIFIED = -15, /**< Reference value does not match expected */
|
45
|
-
GIT_EAUTH = -16,
|
46
|
-
GIT_ECERTIFICATE = -17,
|
45
|
+
GIT_EAUTH = -16, /**< Authentication error */
|
46
|
+
GIT_ECERTIFICATE = -17, /**< Server certificate is invalid */
|
47
47
|
GIT_EAPPLIED = -18, /**< Patch/merge has already been applied */
|
48
|
-
GIT_EPEEL = -19,
|
49
|
-
GIT_EEOF = -20,
|
50
|
-
GIT_EINVALID = -21,
|
48
|
+
GIT_EPEEL = -19, /**< The requested peel operation is not possible */
|
49
|
+
GIT_EEOF = -20, /**< Unexpected EOF */
|
50
|
+
GIT_EINVALID = -21, /**< Invalid operation or input */
|
51
51
|
GIT_EUNCOMMITTED = -22, /**< Uncommitted changes in index prevented operation */
|
52
|
-
GIT_EDIRECTORY = -23,
|
52
|
+
GIT_EDIRECTORY = -23, /**< The operation is not valid for a directory */
|
53
53
|
GIT_EMERGECONFLICT = -24, /**< A merge conflict exists and cannot continue */
|
54
54
|
|
55
55
|
GIT_PASSTHROUGH = -30, /**< A user-configured callback refused to act */
|
@@ -58,6 +58,7 @@ typedef enum {
|
|
58
58
|
GIT_EMISMATCH = -33, /**< Hashsum mismatch in object */
|
59
59
|
GIT_EINDEXDIRTY = -34, /**< Unsaved changes in the index would be overwritten */
|
60
60
|
GIT_EAPPLYFAIL = -35, /**< Patch application failed */
|
61
|
+
GIT_EOWNER = -36 /**< The object is not owned by the current user */
|
61
62
|
} git_error_code;
|
62
63
|
|
63
64
|
/**
|
@@ -32,7 +32,7 @@ typedef enum {
|
|
32
32
|
GIT_FILTER_TO_WORKTREE = 0,
|
33
33
|
GIT_FILTER_SMUDGE = GIT_FILTER_TO_WORKTREE,
|
34
34
|
GIT_FILTER_TO_ODB = 1,
|
35
|
-
GIT_FILTER_CLEAN = GIT_FILTER_TO_ODB
|
35
|
+
GIT_FILTER_CLEAN = GIT_FILTER_TO_ODB
|
36
36
|
} git_filter_mode_t;
|
37
37
|
|
38
38
|
/**
|
@@ -49,8 +49,39 @@ typedef enum {
|
|
49
49
|
|
50
50
|
/** Load attributes from `.gitattributes` in the root of HEAD */
|
51
51
|
GIT_FILTER_ATTRIBUTES_FROM_HEAD = (1u << 2),
|
52
|
+
|
53
|
+
/**
|
54
|
+
* Load attributes from `.gitattributes` in a given commit.
|
55
|
+
* This can only be specified in a `git_filter_options`.
|
56
|
+
*/
|
57
|
+
GIT_FILTER_ATTRIBUTES_FROM_COMMIT = (1u << 3)
|
52
58
|
} git_filter_flag_t;
|
53
59
|
|
60
|
+
/**
|
61
|
+
* Filtering options
|
62
|
+
*/
|
63
|
+
typedef struct {
|
64
|
+
unsigned int version;
|
65
|
+
|
66
|
+
/** See `git_filter_flag_t` above */
|
67
|
+
uint32_t flags;
|
68
|
+
|
69
|
+
#ifdef GIT_DEPRECATE_HARD
|
70
|
+
void *reserved;
|
71
|
+
#else
|
72
|
+
git_oid *commit_id;
|
73
|
+
#endif
|
74
|
+
|
75
|
+
/**
|
76
|
+
* The commit to load attributes from, when
|
77
|
+
* `GIT_FILTER_ATTRIBUTES_FROM_COMMIT` is specified.
|
78
|
+
*/
|
79
|
+
git_oid attr_commit_id;
|
80
|
+
} git_filter_options;
|
81
|
+
|
82
|
+
#define GIT_FILTER_OPTIONS_VERSION 1
|
83
|
+
#define GIT_FILTER_OPTIONS_INIT {GIT_FILTER_OPTIONS_VERSION}
|
84
|
+
|
54
85
|
/**
|
55
86
|
* A filter that can transform file data
|
56
87
|
*
|
@@ -103,6 +134,29 @@ GIT_EXTERN(int) git_filter_list_load(
|
|
103
134
|
git_filter_mode_t mode,
|
104
135
|
uint32_t flags);
|
105
136
|
|
137
|
+
/**
|
138
|
+
* Load the filter list for a given path.
|
139
|
+
*
|
140
|
+
* This will return 0 (success) but set the output git_filter_list to NULL
|
141
|
+
* if no filters are requested for the given file.
|
142
|
+
*
|
143
|
+
* @param filters Output newly created git_filter_list (or NULL)
|
144
|
+
* @param repo Repository object that contains `path`
|
145
|
+
* @param blob The blob to which the filter will be applied (if known)
|
146
|
+
* @param path Relative path of the file to be filtered
|
147
|
+
* @param mode Filtering direction (WT->ODB or ODB->WT)
|
148
|
+
* @param opts The `git_filter_options` to use when loading filters
|
149
|
+
* @return 0 on success (which could still return NULL if no filters are
|
150
|
+
* needed for the requested file), <0 on error
|
151
|
+
*/
|
152
|
+
GIT_EXTERN(int) git_filter_list_load_ext(
|
153
|
+
git_filter_list **filters,
|
154
|
+
git_repository *repo,
|
155
|
+
git_blob *blob,
|
156
|
+
const char *path,
|
157
|
+
git_filter_mode_t mode,
|
158
|
+
git_filter_options *opts);
|
159
|
+
|
106
160
|
/**
|
107
161
|
* Query the filter list to see if a given filter (by name) will run.
|
108
162
|
* The built-in filters "crlf" and "ident" can be queried, otherwise this
|
@@ -122,27 +176,17 @@ GIT_EXTERN(int) git_filter_list_contains(
|
|
122
176
|
/**
|
123
177
|
* Apply filter list to a data buffer.
|
124
178
|
*
|
125
|
-
* See `git2/buffer.h` for background on `git_buf` objects.
|
126
|
-
*
|
127
|
-
* If the `in` buffer holds data allocated by libgit2 (i.e. `in->asize` is
|
128
|
-
* not zero), then it will be overwritten when applying the filters. If
|
129
|
-
* not, then it will be left untouched.
|
130
|
-
*
|
131
|
-
* If there are no filters to apply (or `filters` is NULL), then the `out`
|
132
|
-
* buffer will reference the `in` buffer data (with `asize` set to zero)
|
133
|
-
* instead of allocating data. This keeps allocations to a minimum, but
|
134
|
-
* it means you have to be careful about freeing the `in` data since `out`
|
135
|
-
* may be pointing to it!
|
136
|
-
*
|
137
179
|
* @param out Buffer to store the result of the filtering
|
138
180
|
* @param filters A loaded git_filter_list (or NULL)
|
139
181
|
* @param in Buffer containing the data to filter
|
182
|
+
* @param in_len The length of the input buffer
|
140
183
|
* @return 0 on success, an error code otherwise
|
141
184
|
*/
|
142
|
-
GIT_EXTERN(int)
|
185
|
+
GIT_EXTERN(int) git_filter_list_apply_to_buffer(
|
143
186
|
git_buf *out,
|
144
187
|
git_filter_list *filters,
|
145
|
-
|
188
|
+
const char *in,
|
189
|
+
size_t in_len);
|
146
190
|
|
147
191
|
/**
|
148
192
|
* Apply a filter list to the contents of a file on disk
|
@@ -152,6 +196,7 @@ GIT_EXTERN(int) git_filter_list_apply_to_data(
|
|
152
196
|
* @param repo the repository in which to perform the filtering
|
153
197
|
* @param path the path of the file to filter, a relative path will be
|
154
198
|
* taken as relative to the workdir
|
199
|
+
* @return 0 or an error code.
|
155
200
|
*/
|
156
201
|
GIT_EXTERN(int) git_filter_list_apply_to_file(
|
157
202
|
git_buf *out,
|
@@ -165,6 +210,7 @@ GIT_EXTERN(int) git_filter_list_apply_to_file(
|
|
165
210
|
* @param out buffer into which to store the filtered file
|
166
211
|
* @param filters the list of filters to apply
|
167
212
|
* @param blob the blob to filter
|
213
|
+
* @return 0 or an error code.
|
168
214
|
*/
|
169
215
|
GIT_EXTERN(int) git_filter_list_apply_to_blob(
|
170
216
|
git_buf *out,
|
@@ -175,12 +221,15 @@ GIT_EXTERN(int) git_filter_list_apply_to_blob(
|
|
175
221
|
* Apply a filter list to an arbitrary buffer as a stream
|
176
222
|
*
|
177
223
|
* @param filters the list of filters to apply
|
178
|
-
* @param
|
224
|
+
* @param buffer the buffer to filter
|
225
|
+
* @param len the size of the buffer
|
179
226
|
* @param target the stream into which the data will be written
|
227
|
+
* @return 0 or an error code.
|
180
228
|
*/
|
181
|
-
GIT_EXTERN(int)
|
229
|
+
GIT_EXTERN(int) git_filter_list_stream_buffer(
|
182
230
|
git_filter_list *filters,
|
183
|
-
|
231
|
+
const char *buffer,
|
232
|
+
size_t len,
|
184
233
|
git_writestream *target);
|
185
234
|
|
186
235
|
/**
|
@@ -191,6 +240,7 @@ GIT_EXTERN(int) git_filter_list_stream_data(
|
|
191
240
|
* @param path the path of the file to filter, a relative path will be
|
192
241
|
* taken as relative to the workdir
|
193
242
|
* @param target the stream into which the data will be written
|
243
|
+
* @return 0 or an error code.
|
194
244
|
*/
|
195
245
|
GIT_EXTERN(int) git_filter_list_stream_file(
|
196
246
|
git_filter_list *filters,
|
@@ -204,6 +254,7 @@ GIT_EXTERN(int) git_filter_list_stream_file(
|
|
204
254
|
* @param filters the list of filters to apply
|
205
255
|
* @param blob the blob to filter
|
206
256
|
* @param target the stream into which the data will be written
|
257
|
+
* @return 0 or an error code.
|
207
258
|
*/
|
208
259
|
GIT_EXTERN(int) git_filter_list_stream_blob(
|
209
260
|
git_filter_list *filters,
|
@@ -33,6 +33,7 @@ GIT_BEGIN_DECL
|
|
33
33
|
* @param repo the repository where the commits exist
|
34
34
|
* @param local the commit for local
|
35
35
|
* @param upstream the commit for upstream
|
36
|
+
* @return 0 or an error code.
|
36
37
|
*/
|
37
38
|
GIT_EXTERN(int) git_graph_ahead_behind(size_t *ahead, size_t *behind, git_repository *repo, const git_oid *local, const git_oid *upstream);
|
38
39
|
|
@@ -43,8 +44,9 @@ GIT_EXTERN(int) git_graph_ahead_behind(size_t *ahead, size_t *behind, git_reposi
|
|
43
44
|
* Note that a commit is not considered a descendant of itself, in contrast
|
44
45
|
* to `git merge-base --is-ancestor`.
|
45
46
|
*
|
46
|
-
* @param
|
47
|
-
* @param
|
47
|
+
* @param repo the repository where the commits exist
|
48
|
+
* @param commit a previously loaded commit
|
49
|
+
* @param ancestor a potential ancestor commit
|
48
50
|
* @return 1 if the given commit is a descendant of the potential ancestor,
|
49
51
|
* 0 if not, error code otherwise.
|
50
52
|
*/
|
@@ -53,6 +55,23 @@ GIT_EXTERN(int) git_graph_descendant_of(
|
|
53
55
|
const git_oid *commit,
|
54
56
|
const git_oid *ancestor);
|
55
57
|
|
58
|
+
/**
|
59
|
+
* Determine if a commit is reachable from any of a list of commits by
|
60
|
+
* following parent edges.
|
61
|
+
*
|
62
|
+
* @param repo the repository where the commits exist
|
63
|
+
* @param commit a previously loaded commit
|
64
|
+
* @param length the number of commits in the provided `descendant_array`
|
65
|
+
* @param descendant_array oids of the commits
|
66
|
+
* @return 1 if the given commit is an ancestor of any of the given potential
|
67
|
+
* descendants, 0 if not, error code otherwise.
|
68
|
+
*/
|
69
|
+
GIT_EXTERN(int) git_graph_reachable_from_any(
|
70
|
+
git_repository *repo,
|
71
|
+
const git_oid *commit,
|
72
|
+
const git_oid descendant_array[],
|
73
|
+
size_t length);
|
74
|
+
|
56
75
|
/** @} */
|
57
76
|
GIT_END_DECL
|
58
77
|
#endif
|
@@ -29,7 +29,7 @@ GIT_BEGIN_DECL
|
|
29
29
|
* This would add three rules to the ignores.
|
30
30
|
*
|
31
31
|
* @param repo The repository to add ignore rules to.
|
32
|
-
* @param rules Text of rules,
|
32
|
+
* @param rules Text of rules, the contents to add on a .gitignore file.
|
33
33
|
* It is okay to have multiple rules in the text; if so,
|
34
34
|
* each rule should be terminated with a newline.
|
35
35
|
* @return 0 on success
|