rugged 0.27.10 → 0.27.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/AUTHORS +0 -1
- data/vendor/libgit2/CMakeLists.txt +54 -98
- data/vendor/libgit2/COPYING +0 -28
- data/vendor/libgit2/cmake/Modules/AddCFlagIfSupported.cmake +1 -15
- data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +8 -9
- data/vendor/libgit2/cmake/Modules/FindCoreFoundation.cmake +2 -2
- data/vendor/libgit2/cmake/Modules/FindGSSAPI.cmake +1 -1
- data/vendor/libgit2/cmake/Modules/FindSecurity.cmake +2 -2
- data/vendor/libgit2/cmake/Modules/FindStatNsec.cmake +0 -6
- data/vendor/libgit2/deps/http-parser/CMakeLists.txt +0 -2
- data/vendor/libgit2/deps/http-parser/{COPYING → LICENSE-MIT} +0 -0
- data/vendor/libgit2/deps/http-parser/http_parser.c +6 -11
- data/vendor/libgit2/deps/regex/CMakeLists.txt +2 -0
- data/vendor/libgit2/deps/regex/config.h +7 -0
- data/vendor/libgit2/deps/regex/regcomp.c +3857 -0
- data/vendor/libgit2/deps/regex/regex.c +92 -0
- data/vendor/libgit2/deps/regex/regex.h +582 -0
- data/vendor/libgit2/deps/regex/regex_internal.c +1744 -0
- data/vendor/libgit2/deps/regex/regex_internal.h +819 -0
- data/vendor/libgit2/deps/regex/regexec.c +4369 -0
- data/vendor/libgit2/deps/zlib/CMakeLists.txt +0 -1
- data/vendor/libgit2/deps/zlib/adler32.c +7 -0
- data/vendor/libgit2/deps/zlib/crc32.c +7 -0
- data/vendor/libgit2/include/git2.h +0 -5
- data/vendor/libgit2/include/git2/annotated_commit.h +0 -9
- data/vendor/libgit2/include/git2/attr.h +20 -38
- data/vendor/libgit2/include/git2/blame.h +25 -42
- data/vendor/libgit2/include/git2/blob.h +13 -45
- data/vendor/libgit2/include/git2/branch.h +1 -1
- data/vendor/libgit2/include/git2/buffer.h +16 -22
- data/vendor/libgit2/include/git2/checkout.h +32 -65
- data/vendor/libgit2/include/git2/cherrypick.h +7 -9
- data/vendor/libgit2/include/git2/clone.h +10 -12
- data/vendor/libgit2/include/git2/commit.h +3 -53
- data/vendor/libgit2/include/git2/common.h +8 -60
- data/vendor/libgit2/include/git2/config.h +19 -30
- data/vendor/libgit2/include/git2/describe.h +9 -32
- data/vendor/libgit2/include/git2/diff.h +156 -208
- data/vendor/libgit2/include/git2/errors.h +46 -54
- data/vendor/libgit2/include/git2/filter.h +0 -8
- data/vendor/libgit2/include/git2/ignore.h +2 -2
- data/vendor/libgit2/include/git2/index.h +52 -74
- data/vendor/libgit2/include/git2/indexer.h +6 -76
- data/vendor/libgit2/include/git2/inttypes.h +309 -0
- data/vendor/libgit2/include/git2/merge.h +18 -35
- data/vendor/libgit2/include/git2/net.h +5 -0
- data/vendor/libgit2/include/git2/notes.h +1 -1
- data/vendor/libgit2/include/git2/object.h +29 -17
- data/vendor/libgit2/include/git2/odb.h +11 -12
- data/vendor/libgit2/include/git2/odb_backend.h +9 -10
- data/vendor/libgit2/include/git2/oid.h +2 -2
- data/vendor/libgit2/include/git2/pack.h +3 -14
- data/vendor/libgit2/include/git2/proxy.h +8 -14
- data/vendor/libgit2/include/git2/rebase.h +6 -53
- data/vendor/libgit2/include/git2/refs.h +15 -33
- data/vendor/libgit2/include/git2/refspec.h +0 -17
- data/vendor/libgit2/include/git2/remote.h +24 -123
- data/vendor/libgit2/include/git2/repository.h +39 -76
- data/vendor/libgit2/include/git2/revert.h +4 -6
- data/vendor/libgit2/include/git2/revwalk.h +7 -7
- data/vendor/libgit2/include/git2/signature.h +2 -2
- data/vendor/libgit2/include/git2/stash.h +12 -15
- data/vendor/libgit2/include/git2/status.h +20 -33
- data/vendor/libgit2/include/git2/submodule.h +12 -30
- data/vendor/libgit2/include/git2/sys/commit.h +1 -1
- data/vendor/libgit2/include/git2/sys/config.h +13 -13
- data/vendor/libgit2/include/git2/sys/filter.h +6 -6
- data/vendor/libgit2/include/git2/sys/index.h +0 -3
- data/vendor/libgit2/include/git2/sys/mempack.h +35 -35
- data/vendor/libgit2/include/git2/sys/merge.h +4 -9
- data/vendor/libgit2/include/git2/sys/odb_backend.h +22 -66
- data/vendor/libgit2/include/git2/sys/refdb_backend.h +40 -76
- data/vendor/libgit2/include/git2/sys/repository.h +1 -5
- data/vendor/libgit2/include/git2/sys/stream.h +12 -92
- data/vendor/libgit2/include/git2/sys/time.h +31 -0
- data/vendor/libgit2/include/git2/sys/transport.h +83 -129
- data/vendor/libgit2/include/git2/tag.h +4 -13
- data/vendor/libgit2/include/git2/trace.h +2 -2
- data/vendor/libgit2/include/git2/transaction.h +0 -1
- data/vendor/libgit2/include/git2/transport.h +311 -11
- data/vendor/libgit2/include/git2/tree.h +4 -4
- data/vendor/libgit2/include/git2/types.h +111 -33
- data/vendor/libgit2/include/git2/version.h +4 -4
- data/vendor/libgit2/include/git2/worktree.h +13 -48
- data/vendor/libgit2/libgit2.pc.in +13 -0
- data/vendor/libgit2/src/CMakeLists.txt +164 -96
- data/vendor/libgit2/src/annotated_commit.c +8 -15
- data/vendor/libgit2/src/apply.c +31 -537
- data/vendor/libgit2/src/apply.h +1 -3
- data/vendor/libgit2/src/array.h +2 -2
- data/vendor/libgit2/src/attr.c +75 -81
- data/vendor/libgit2/src/attr_file.c +121 -207
- data/vendor/libgit2/src/attr_file.h +9 -9
- data/vendor/libgit2/src/attrcache.c +53 -51
- data/vendor/libgit2/src/attrcache.h +1 -2
- data/vendor/libgit2/src/blame.c +20 -47
- data/vendor/libgit2/src/blame.h +1 -2
- data/vendor/libgit2/src/blame_git.c +20 -37
- data/vendor/libgit2/src/blob.c +42 -128
- data/vendor/libgit2/src/blob.h +2 -19
- data/vendor/libgit2/src/branch.c +43 -67
- data/vendor/libgit2/src/buf_text.c +6 -7
- data/vendor/libgit2/src/buffer.c +57 -69
- data/vendor/libgit2/src/buffer.h +1 -1
- data/vendor/libgit2/src/cache.c +45 -38
- data/vendor/libgit2/src/cache.h +3 -3
- data/vendor/libgit2/src/cc-compat.h +3 -20
- data/vendor/libgit2/src/checkout.c +90 -109
- data/vendor/libgit2/src/cherrypick.c +9 -15
- data/vendor/libgit2/src/clone.c +27 -49
- data/vendor/libgit2/src/clone.h +0 -4
- data/vendor/libgit2/src/commit.c +49 -117
- data/vendor/libgit2/src/commit.h +0 -7
- data/vendor/libgit2/src/commit_list.c +78 -30
- data/vendor/libgit2/src/commit_list.h +2 -2
- data/vendor/libgit2/src/common.h +91 -27
- data/vendor/libgit2/src/config.c +176 -194
- data/vendor/libgit2/src/config.h +20 -8
- data/vendor/libgit2/src/config_cache.c +35 -41
- data/vendor/libgit2/src/config_file.c +753 -439
- data/vendor/libgit2/src/config_file.h +73 -0
- data/vendor/libgit2/src/config_parse.c +63 -114
- data/vendor/libgit2/src/config_parse.h +16 -17
- data/vendor/libgit2/src/crlf.c +190 -219
- data/vendor/libgit2/src/delta.c +18 -25
- data/vendor/libgit2/src/describe.c +41 -42
- data/vendor/libgit2/src/diff.c +68 -53
- data/vendor/libgit2/src/diff.h +1 -2
- data/vendor/libgit2/src/diff_driver.c +49 -47
- data/vendor/libgit2/src/diff_file.c +17 -19
- data/vendor/libgit2/src/diff_file.h +1 -1
- data/vendor/libgit2/src/diff_generate.c +106 -162
- data/vendor/libgit2/src/diff_generate.h +3 -3
- data/vendor/libgit2/src/diff_parse.c +4 -4
- data/vendor/libgit2/src/diff_print.c +30 -42
- data/vendor/libgit2/src/diff_stats.c +7 -22
- data/vendor/libgit2/src/diff_tform.c +16 -16
- data/vendor/libgit2/src/diff_xdiff.c +3 -15
- data/vendor/libgit2/src/errors.c +39 -51
- data/vendor/libgit2/src/features.h.in +3 -11
- data/vendor/libgit2/src/fetch.c +5 -10
- data/vendor/libgit2/src/fetchhead.c +17 -17
- data/vendor/libgit2/src/filebuf.c +36 -32
- data/vendor/libgit2/src/filebuf.h +2 -2
- data/vendor/libgit2/src/{futils.c → fileops.c} +73 -80
- data/vendor/libgit2/src/{futils.h → fileops.h} +6 -6
- data/vendor/libgit2/src/filter.c +38 -46
- data/vendor/libgit2/src/filter.h +10 -0
- data/vendor/libgit2/src/fnmatch.c +248 -0
- data/vendor/libgit2/src/fnmatch.h +48 -0
- data/vendor/libgit2/src/global.c +63 -48
- data/vendor/libgit2/src/global.h +2 -0
- data/vendor/libgit2/src/hash.c +0 -61
- data/vendor/libgit2/src/hash.h +19 -20
- data/vendor/libgit2/src/hash/hash_collisiondetect.h +47 -0
- data/vendor/libgit2/src/hash/{sha1/common_crypto.c → hash_common_crypto.h} +17 -17
- data/vendor/libgit2/src/hash/{sha1/generic.c → hash_generic.c} +10 -22
- data/vendor/libgit2/src/hash/{sha1/generic.h → hash_generic.h} +10 -4
- data/vendor/libgit2/src/hash/hash_openssl.h +59 -0
- data/vendor/libgit2/src/hash/{sha1/win32.c → hash_win32.c} +37 -47
- data/vendor/libgit2/src/hash/{sha1/win32.h → hash_win32.h} +19 -6
- data/vendor/libgit2/src/hash/{sha1/sha1dc → sha1dc}/sha1.c +3 -14
- data/vendor/libgit2/src/hash/{sha1/sha1dc → sha1dc}/sha1.h +0 -0
- data/vendor/libgit2/src/hash/{sha1/sha1dc → sha1dc}/ubc_check.c +0 -0
- data/vendor/libgit2/src/hash/{sha1/sha1dc → sha1dc}/ubc_check.h +0 -0
- data/vendor/libgit2/src/hashsig.c +5 -5
- data/vendor/libgit2/src/idxmap.c +61 -107
- data/vendor/libgit2/src/idxmap.h +31 -153
- data/vendor/libgit2/src/ignore.c +47 -43
- data/vendor/libgit2/src/index.c +232 -337
- data/vendor/libgit2/src/index.h +1 -17
- data/vendor/libgit2/src/indexer.c +175 -346
- data/vendor/libgit2/src/integer.h +26 -71
- data/vendor/libgit2/src/iterator.c +70 -142
- data/vendor/libgit2/src/iterator.h +0 -15
- data/vendor/libgit2/src/khash.h +1 -3
- data/vendor/libgit2/src/map.h +1 -1
- data/vendor/libgit2/src/merge.c +100 -144
- data/vendor/libgit2/src/merge_driver.c +11 -11
- data/vendor/libgit2/src/merge_file.c +2 -2
- data/vendor/libgit2/src/mwindow.c +29 -24
- data/vendor/libgit2/src/mwindow.h +4 -4
- data/vendor/libgit2/src/netops.c +156 -55
- data/vendor/libgit2/src/netops.h +23 -3
- data/vendor/libgit2/src/notes.c +11 -16
- data/vendor/libgit2/src/object.c +69 -120
- data/vendor/libgit2/src/object.h +9 -22
- data/vendor/libgit2/src/object_api.c +8 -8
- data/vendor/libgit2/src/odb.c +93 -116
- data/vendor/libgit2/src/odb.h +7 -8
- data/vendor/libgit2/src/odb_loose.c +55 -62
- data/vendor/libgit2/src/odb_mempack.c +34 -21
- data/vendor/libgit2/src/odb_pack.c +14 -18
- data/vendor/libgit2/src/offmap.c +35 -53
- data/vendor/libgit2/src/offmap.h +21 -108
- data/vendor/libgit2/src/oid.c +7 -12
- data/vendor/libgit2/src/oidmap.c +47 -49
- data/vendor/libgit2/src/oidmap.h +24 -101
- data/vendor/libgit2/src/pack-objects.c +87 -88
- data/vendor/libgit2/src/pack-objects.h +8 -2
- data/vendor/libgit2/src/pack.c +101 -99
- data/vendor/libgit2/src/pack.h +19 -17
- data/vendor/libgit2/src/parse.c +0 -10
- data/vendor/libgit2/src/parse.h +3 -3
- data/vendor/libgit2/src/patch.c +4 -4
- data/vendor/libgit2/src/patch_generate.c +20 -20
- data/vendor/libgit2/src/patch_parse.c +63 -151
- data/vendor/libgit2/src/path.c +104 -117
- data/vendor/libgit2/src/path.h +71 -3
- data/vendor/libgit2/src/pathspec.c +19 -19
- data/vendor/libgit2/src/pool.c +22 -26
- data/vendor/libgit2/src/pool.h +7 -7
- data/vendor/libgit2/src/posix.c +10 -10
- data/vendor/libgit2/src/posix.h +1 -12
- data/vendor/libgit2/src/proxy.c +3 -8
- data/vendor/libgit2/src/push.c +31 -37
- data/vendor/libgit2/src/push.h +1 -2
- data/vendor/libgit2/src/rebase.c +59 -115
- data/vendor/libgit2/src/refdb.c +3 -15
- data/vendor/libgit2/src/refdb_fs.c +254 -381
- data/vendor/libgit2/src/reflog.c +15 -13
- data/vendor/libgit2/src/refs.c +88 -118
- data/vendor/libgit2/src/refs.h +3 -5
- data/vendor/libgit2/src/refspec.c +37 -56
- data/vendor/libgit2/src/refspec.h +1 -1
- data/vendor/libgit2/src/remote.c +215 -266
- data/vendor/libgit2/src/remote.h +2 -11
- data/vendor/libgit2/src/repository.c +225 -280
- data/vendor/libgit2/src/repository.h +40 -52
- data/vendor/libgit2/src/reset.c +8 -8
- data/vendor/libgit2/src/revert.c +9 -14
- data/vendor/libgit2/src/revparse.c +48 -47
- data/vendor/libgit2/src/revwalk.c +57 -120
- data/vendor/libgit2/src/revwalk.h +1 -22
- data/vendor/libgit2/src/settings.c +10 -47
- data/vendor/libgit2/src/signature.c +11 -11
- data/vendor/libgit2/src/sortedcache.c +36 -22
- data/vendor/libgit2/src/sortedcache.h +1 -1
- data/vendor/libgit2/src/stash.c +99 -125
- data/vendor/libgit2/src/status.c +22 -28
- data/vendor/libgit2/src/stream.h +2 -17
- data/vendor/libgit2/src/streams/curl.c +385 -0
- data/vendor/libgit2/src/{allocators/stdalloc.h → streams/curl.h} +5 -5
- data/vendor/libgit2/src/streams/openssl.c +114 -224
- data/vendor/libgit2/src/streams/openssl.h +108 -4
- data/vendor/libgit2/src/streams/socket.c +30 -55
- data/vendor/libgit2/src/streams/stransport.c +32 -57
- data/vendor/libgit2/src/streams/stransport.h +0 -5
- data/vendor/libgit2/src/streams/tls.c +19 -50
- data/vendor/libgit2/src/streams/tls.h +4 -12
- data/vendor/libgit2/src/strmap.c +74 -47
- data/vendor/libgit2/src/strmap.h +33 -108
- data/vendor/libgit2/src/submodule.c +216 -272
- data/vendor/libgit2/src/submodule.h +1 -1
- data/vendor/libgit2/src/sysdir.c +19 -29
- data/vendor/libgit2/src/tag.c +28 -41
- data/vendor/libgit2/src/tag.h +1 -2
- data/vendor/libgit2/src/trace.c +2 -2
- data/vendor/libgit2/src/trace.h +3 -3
- data/vendor/libgit2/src/trailer.c +38 -52
- data/vendor/libgit2/src/transaction.c +29 -30
- data/vendor/libgit2/src/transport.c +5 -5
- data/vendor/libgit2/src/transports/auth.c +11 -15
- data/vendor/libgit2/src/transports/auth.h +3 -10
- data/vendor/libgit2/src/transports/auth_negotiate.c +18 -33
- data/vendor/libgit2/src/transports/auth_negotiate.h +2 -2
- data/vendor/libgit2/src/transports/cred.c +24 -24
- data/vendor/libgit2/src/{allocators/win32_crtdbg.h → transports/cred.h} +4 -5
- data/vendor/libgit2/src/transports/git.c +31 -26
- data/vendor/libgit2/src/transports/http.c +348 -881
- data/vendor/libgit2/src/transports/http.h +0 -2
- data/vendor/libgit2/src/transports/local.c +35 -35
- data/vendor/libgit2/src/transports/smart.c +47 -70
- data/vendor/libgit2/src/transports/smart.h +4 -3
- data/vendor/libgit2/src/transports/smart_pkt.c +40 -43
- data/vendor/libgit2/src/transports/smart_protocol.c +116 -96
- data/vendor/libgit2/src/transports/ssh.c +66 -77
- data/vendor/libgit2/src/transports/winhttp.c +314 -318
- data/vendor/libgit2/src/tree-cache.c +12 -19
- data/vendor/libgit2/src/tree.c +142 -103
- data/vendor/libgit2/src/tree.h +12 -1
- data/vendor/libgit2/src/unix/map.c +3 -3
- data/vendor/libgit2/src/unix/posix.h +11 -1
- data/vendor/libgit2/src/userdiff.h +1 -3
- data/vendor/libgit2/src/util.c +56 -70
- data/vendor/libgit2/src/util.h +156 -28
- data/vendor/libgit2/src/vector.c +4 -4
- data/vendor/libgit2/src/win32/dir.c +3 -3
- data/vendor/libgit2/src/win32/findfile.c +3 -3
- data/vendor/libgit2/src/win32/map.c +11 -9
- data/vendor/libgit2/src/win32/msvc-compat.h +0 -6
- data/vendor/libgit2/src/win32/path_w32.c +9 -113
- data/vendor/libgit2/src/win32/path_w32.h +29 -18
- data/vendor/libgit2/src/win32/posix.h +4 -1
- data/vendor/libgit2/src/win32/posix_w32.c +45 -70
- data/vendor/libgit2/src/win32/precompiled.h +2 -0
- data/vendor/libgit2/src/win32/thread.c +10 -5
- data/vendor/libgit2/src/win32/w32_buffer.c +5 -9
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +2 -3
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +75 -26
- data/vendor/libgit2/src/win32/w32_stack.c +11 -6
- data/vendor/libgit2/src/win32/w32_stack.h +3 -3
- data/vendor/libgit2/src/win32/w32_util.c +64 -27
- data/vendor/libgit2/src/win32/w32_util.h +49 -5
- data/vendor/libgit2/src/worktree.c +60 -95
- data/vendor/libgit2/src/worktree.h +0 -2
- data/vendor/libgit2/src/xdiff/xdiffi.c +5 -7
- data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
- data/vendor/libgit2/src/xdiff/xmerge.c +15 -27
- data/vendor/libgit2/src/xdiff/xpatience.c +0 -3
- data/vendor/libgit2/src/zstream.c +4 -4
- metadata +33 -122
- data/vendor/libgit2/cmake/Modules/FindGSSFramework.cmake +0 -28
- data/vendor/libgit2/cmake/Modules/FindPCRE.cmake +0 -38
- data/vendor/libgit2/cmake/Modules/FindPCRE2.cmake +0 -37
- data/vendor/libgit2/cmake/Modules/FindmbedTLS.cmake +0 -93
- data/vendor/libgit2/cmake/Modules/PkgBuildConfig.cmake +0 -110
- data/vendor/libgit2/cmake/Modules/SelectGSSAPI.cmake +0 -53
- data/vendor/libgit2/cmake/Modules/SelectHTTPSBackend.cmake +0 -124
- data/vendor/libgit2/cmake/Modules/SelectHashes.cmake +0 -66
- data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +0 -21
- data/vendor/libgit2/deps/ntlmclient/compat.h +0 -33
- data/vendor/libgit2/deps/ntlmclient/crypt.h +0 -64
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.c +0 -120
- data/vendor/libgit2/deps/ntlmclient/crypt_commoncrypto.h +0 -18
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.c +0 -145
- data/vendor/libgit2/deps/ntlmclient/crypt_mbedtls.h +0 -18
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +0 -130
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.h +0 -21
- data/vendor/libgit2/deps/ntlmclient/ntlm.c +0 -1420
- data/vendor/libgit2/deps/ntlmclient/ntlm.h +0 -174
- data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +0 -320
- data/vendor/libgit2/deps/ntlmclient/unicode.h +0 -36
- data/vendor/libgit2/deps/ntlmclient/unicode_builtin.c +0 -445
- data/vendor/libgit2/deps/ntlmclient/unicode_iconv.c +0 -201
- data/vendor/libgit2/deps/ntlmclient/utf8.h +0 -1257
- data/vendor/libgit2/deps/ntlmclient/util.c +0 -21
- data/vendor/libgit2/deps/ntlmclient/util.h +0 -14
- data/vendor/libgit2/deps/pcre/CMakeLists.txt +0 -140
- data/vendor/libgit2/deps/pcre/COPYING +0 -5
- data/vendor/libgit2/deps/pcre/cmake/COPYING-CMAKE-SCRIPTS +0 -22
- data/vendor/libgit2/deps/pcre/cmake/FindEditline.cmake +0 -17
- data/vendor/libgit2/deps/pcre/cmake/FindPackageHandleStandardArgs.cmake +0 -58
- data/vendor/libgit2/deps/pcre/cmake/FindReadline.cmake +0 -29
- data/vendor/libgit2/deps/pcre/config.h.in +0 -57
- data/vendor/libgit2/deps/pcre/pcre.h +0 -641
- data/vendor/libgit2/deps/pcre/pcre_byte_order.c +0 -319
- data/vendor/libgit2/deps/pcre/pcre_chartables.c +0 -198
- data/vendor/libgit2/deps/pcre/pcre_compile.c +0 -9800
- data/vendor/libgit2/deps/pcre/pcre_config.c +0 -190
- data/vendor/libgit2/deps/pcre/pcre_dfa_exec.c +0 -3676
- data/vendor/libgit2/deps/pcre/pcre_exec.c +0 -7173
- data/vendor/libgit2/deps/pcre/pcre_fullinfo.c +0 -245
- data/vendor/libgit2/deps/pcre/pcre_get.c +0 -669
- data/vendor/libgit2/deps/pcre/pcre_globals.c +0 -86
- data/vendor/libgit2/deps/pcre/pcre_internal.h +0 -2787
- data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +0 -11913
- data/vendor/libgit2/deps/pcre/pcre_maketables.c +0 -156
- data/vendor/libgit2/deps/pcre/pcre_newline.c +0 -210
- data/vendor/libgit2/deps/pcre/pcre_ord2utf8.c +0 -94
- data/vendor/libgit2/deps/pcre/pcre_printint.c +0 -834
- data/vendor/libgit2/deps/pcre/pcre_refcount.c +0 -92
- data/vendor/libgit2/deps/pcre/pcre_string_utils.c +0 -211
- data/vendor/libgit2/deps/pcre/pcre_study.c +0 -1686
- data/vendor/libgit2/deps/pcre/pcre_tables.c +0 -727
- data/vendor/libgit2/deps/pcre/pcre_ucd.c +0 -3644
- data/vendor/libgit2/deps/pcre/pcre_valid_utf8.c +0 -301
- data/vendor/libgit2/deps/pcre/pcre_version.c +0 -98
- data/vendor/libgit2/deps/pcre/pcre_xclass.c +0 -268
- data/vendor/libgit2/deps/pcre/pcreposix.c +0 -421
- data/vendor/libgit2/deps/pcre/pcreposix.h +0 -117
- data/vendor/libgit2/deps/pcre/ucp.h +0 -224
- data/vendor/libgit2/deps/winhttp/COPYING.GPL +0 -993
- data/vendor/libgit2/deps/winhttp/COPYING.LGPL +0 -502
- data/vendor/libgit2/deps/zlib/COPYING +0 -27
- data/vendor/libgit2/include/git2/apply.h +0 -149
- data/vendor/libgit2/include/git2/cert.h +0 -135
- data/vendor/libgit2/include/git2/cred.h +0 -308
- data/vendor/libgit2/include/git2/deprecated.h +0 -493
- data/vendor/libgit2/include/git2/mailmap.h +0 -115
- data/vendor/libgit2/include/git2/sys/alloc.h +0 -101
- data/vendor/libgit2/include/git2/sys/cred.h +0 -90
- data/vendor/libgit2/include/git2/sys/path.h +0 -64
- data/vendor/libgit2/src/alloc.c +0 -43
- data/vendor/libgit2/src/alloc.h +0 -40
- data/vendor/libgit2/src/allocators/stdalloc.c +0 -119
- data/vendor/libgit2/src/allocators/win32_crtdbg.c +0 -118
- data/vendor/libgit2/src/config_backend.h +0 -96
- data/vendor/libgit2/src/config_entries.c +0 -229
- data/vendor/libgit2/src/config_entries.h +0 -24
- data/vendor/libgit2/src/config_mem.c +0 -220
- data/vendor/libgit2/src/config_snapshot.c +0 -206
- data/vendor/libgit2/src/errors.h +0 -81
- data/vendor/libgit2/src/hash/sha1.h +0 -38
- data/vendor/libgit2/src/hash/sha1/collisiondetect.c +0 -48
- data/vendor/libgit2/src/hash/sha1/collisiondetect.h +0 -19
- data/vendor/libgit2/src/hash/sha1/common_crypto.h +0 -19
- data/vendor/libgit2/src/hash/sha1/mbedtls.c +0 -46
- data/vendor/libgit2/src/hash/sha1/mbedtls.h +0 -19
- data/vendor/libgit2/src/hash/sha1/openssl.c +0 -59
- data/vendor/libgit2/src/hash/sha1/openssl.h +0 -19
- data/vendor/libgit2/src/mailmap.c +0 -485
- data/vendor/libgit2/src/mailmap.h +0 -35
- data/vendor/libgit2/src/net.c +0 -184
- data/vendor/libgit2/src/net.h +0 -36
- data/vendor/libgit2/src/reader.c +0 -265
- data/vendor/libgit2/src/reader.h +0 -107
- data/vendor/libgit2/src/regexp.c +0 -221
- data/vendor/libgit2/src/regexp.h +0 -97
- data/vendor/libgit2/src/streams/mbedtls.c +0 -483
- data/vendor/libgit2/src/streams/mbedtls.h +0 -23
- data/vendor/libgit2/src/streams/registry.c +0 -118
- data/vendor/libgit2/src/streams/registry.h +0 -19
- data/vendor/libgit2/src/transports/auth_ntlm.c +0 -223
- data/vendor/libgit2/src/transports/auth_ntlm.h +0 -35
- data/vendor/libgit2/src/wildmatch.c +0 -320
- data/vendor/libgit2/src/wildmatch.h +0 -23
- data/vendor/libgit2/src/win32/w32_common.h +0 -39
data/vendor/libgit2/src/delta.c
CHANGED
@@ -124,21 +124,21 @@ static int lookup_index_alloc(
|
|
124
124
|
{
|
125
125
|
size_t entries_len, hash_len, index_len;
|
126
126
|
|
127
|
-
|
128
|
-
|
127
|
+
GITERR_CHECK_ALLOC_MULTIPLY(&entries_len, entries, sizeof(struct index_entry));
|
128
|
+
GITERR_CHECK_ALLOC_MULTIPLY(&hash_len, hash_count, sizeof(struct index_entry *));
|
129
129
|
|
130
|
-
|
131
|
-
|
130
|
+
GITERR_CHECK_ALLOC_ADD(&index_len, sizeof(struct git_delta_index), entries_len);
|
131
|
+
GITERR_CHECK_ALLOC_ADD(&index_len, index_len, hash_len);
|
132
132
|
|
133
133
|
if (!git__is_ulong(index_len)) {
|
134
|
-
|
134
|
+
giterr_set(GITERR_NOMEMORY, "overly large delta");
|
135
135
|
return -1;
|
136
136
|
}
|
137
137
|
|
138
138
|
*out = git__malloc(index_len);
|
139
|
-
|
139
|
+
GITERR_CHECK_ALLOC(*out);
|
140
140
|
|
141
|
-
*out_len =
|
141
|
+
*out_len = index_len;
|
142
142
|
return 0;
|
143
143
|
}
|
144
144
|
|
@@ -286,22 +286,15 @@ int git_delta_create_from_index(
|
|
286
286
|
if (!trg_buf || !trg_size)
|
287
287
|
return 0;
|
288
288
|
|
289
|
-
if (index->src_size > UINT_MAX ||
|
290
|
-
trg_size > UINT_MAX ||
|
291
|
-
max_size > (UINT_MAX - MAX_OP_SIZE - 1)) {
|
292
|
-
git_error_set(GIT_ERROR_INVALID, "buffer sizes too large for delta processing");
|
293
|
-
return -1;
|
294
|
-
}
|
295
|
-
|
296
289
|
bufpos = 0;
|
297
290
|
bufsize = 8192;
|
298
291
|
if (max_size && bufsize >= max_size)
|
299
292
|
bufsize = (unsigned int)(max_size + MAX_OP_SIZE + 1);
|
300
293
|
buf = git__malloc(bufsize);
|
301
|
-
|
294
|
+
GITERR_CHECK_ALLOC(buf);
|
302
295
|
|
303
296
|
/* store reference buffer size */
|
304
|
-
i =
|
297
|
+
i = index->src_size;
|
305
298
|
while (i >= 0x80) {
|
306
299
|
buf[bufpos++] = i | 0x80;
|
307
300
|
i >>= 7;
|
@@ -309,7 +302,7 @@ int git_delta_create_from_index(
|
|
309
302
|
buf[bufpos++] = i;
|
310
303
|
|
311
304
|
/* store target buffer size */
|
312
|
-
i =
|
305
|
+
i = trg_size;
|
313
306
|
while (i >= 0x80) {
|
314
307
|
buf[bufpos++] = i | 0x80;
|
315
308
|
i >>= 7;
|
@@ -430,7 +423,7 @@ int git_delta_create_from_index(
|
|
430
423
|
void *tmp = buf;
|
431
424
|
bufsize = bufsize * 3 / 2;
|
432
425
|
if (max_size && bufsize >= max_size)
|
433
|
-
bufsize =
|
426
|
+
bufsize = max_size + MAX_OP_SIZE + 1;
|
434
427
|
if (max_size && bufpos > max_size)
|
435
428
|
break;
|
436
429
|
buf = git__realloc(buf, bufsize);
|
@@ -445,7 +438,7 @@ int git_delta_create_from_index(
|
|
445
438
|
buf[bufpos - inscnt - 1] = inscnt;
|
446
439
|
|
447
440
|
if (max_size && bufpos > max_size) {
|
448
|
-
|
441
|
+
giterr_set(GITERR_NOMEMORY, "delta would be larger than maximum size");
|
449
442
|
git__free(buf);
|
450
443
|
return GIT_EBUFS;
|
451
444
|
}
|
@@ -473,7 +466,7 @@ static int hdr_sz(
|
|
473
466
|
|
474
467
|
do {
|
475
468
|
if (d == end) {
|
476
|
-
|
469
|
+
giterr_set(GITERR_INVALID, "truncated delta");
|
477
470
|
return -1;
|
478
471
|
}
|
479
472
|
|
@@ -552,18 +545,18 @@ int git_delta_apply(
|
|
552
545
|
* base object, resulting in data corruption or segfault.
|
553
546
|
*/
|
554
547
|
if ((hdr_sz(&base_sz, &delta, delta_end) < 0) || (base_sz != base_len)) {
|
555
|
-
|
548
|
+
giterr_set(GITERR_INVALID, "failed to apply delta: base size does not match given data");
|
556
549
|
return -1;
|
557
550
|
}
|
558
551
|
|
559
552
|
if (hdr_sz(&res_sz, &delta, delta_end) < 0) {
|
560
|
-
|
553
|
+
giterr_set(GITERR_INVALID, "failed to apply delta: base size does not match given data");
|
561
554
|
return -1;
|
562
555
|
}
|
563
556
|
|
564
|
-
|
557
|
+
GITERR_CHECK_ALLOC_ADD(&alloc_sz, res_sz, 1);
|
565
558
|
res_dp = git__malloc(alloc_sz);
|
566
|
-
|
559
|
+
GITERR_CHECK_ALLOC(res_dp);
|
567
560
|
|
568
561
|
res_dp[res_sz] = '\0';
|
569
562
|
*out = res_dp;
|
@@ -623,6 +616,6 @@ fail:
|
|
623
616
|
*out = NULL;
|
624
617
|
*out_len = 0;
|
625
618
|
|
626
|
-
|
619
|
+
giterr_set(GITERR_INVALID, "failed to apply delta");
|
627
620
|
return -1;
|
628
621
|
}
|
@@ -16,11 +16,10 @@
|
|
16
16
|
#include "commit_list.h"
|
17
17
|
#include "oidmap.h"
|
18
18
|
#include "refs.h"
|
19
|
-
#include "repository.h"
|
20
19
|
#include "revwalk.h"
|
21
20
|
#include "tag.h"
|
22
21
|
#include "vector.h"
|
23
|
-
#include "
|
22
|
+
#include "repository.h"
|
24
23
|
|
25
24
|
/* Ported from https://github.com/git/git/blob/89dde7882f71f846ccd0359756d27bebc31108de/builtin/describe.c */
|
26
25
|
|
@@ -37,7 +36,12 @@ struct commit_name {
|
|
37
36
|
|
38
37
|
static void *oidmap_value_bykey(git_oidmap *map, const git_oid *key)
|
39
38
|
{
|
40
|
-
|
39
|
+
khint_t pos = git_oidmap_lookup_index(map, key);
|
40
|
+
|
41
|
+
if (!git_oidmap_valid_index(map, pos))
|
42
|
+
return NULL;
|
43
|
+
|
44
|
+
return git_oidmap_value_at(map, pos);
|
41
45
|
}
|
42
46
|
|
43
47
|
static struct commit_name *find_commit_name(
|
@@ -104,7 +108,7 @@ static int add_to_known_names(
|
|
104
108
|
if (replace_name(&tag, repo, e, prio, sha1)) {
|
105
109
|
if (!found) {
|
106
110
|
e = git__malloc(sizeof(struct commit_name));
|
107
|
-
|
111
|
+
GITERR_CHECK_ALLOC(e);
|
108
112
|
|
109
113
|
e->path = NULL;
|
110
114
|
e->tag = NULL;
|
@@ -120,8 +124,13 @@ static int add_to_known_names(
|
|
120
124
|
e->path = git__strdup(path);
|
121
125
|
git_oid_cpy(&e->peeled, peeled);
|
122
126
|
|
123
|
-
if (!found
|
124
|
-
|
127
|
+
if (!found) {
|
128
|
+
int ret;
|
129
|
+
|
130
|
+
git_oidmap_insert(names, &e->peeled, e, &ret);
|
131
|
+
if (ret < 0)
|
132
|
+
return -1;
|
133
|
+
}
|
125
134
|
}
|
126
135
|
else
|
127
136
|
git_tag_free(tag);
|
@@ -142,7 +151,7 @@ static int retrieve_peeled_tag_or_object_oid(
|
|
142
151
|
if ((error = git_reference_lookup_resolved(&ref, repo, refname, -1)) < 0)
|
143
152
|
return error;
|
144
153
|
|
145
|
-
if ((error = git_reference_peel(&peeled, ref,
|
154
|
+
if ((error = git_reference_peel(&peeled, ref, GIT_OBJ_ANY)) < 0)
|
146
155
|
goto cleanup;
|
147
156
|
|
148
157
|
git_oid_cpy(ref_target_out, git_reference_target(ref));
|
@@ -182,7 +191,7 @@ static int commit_name_dup(struct commit_name **out, struct commit_name *in)
|
|
182
191
|
struct commit_name *name;
|
183
192
|
|
184
193
|
name = git__malloc(sizeof(struct commit_name));
|
185
|
-
|
194
|
+
GITERR_CHECK_ALLOC(name);
|
186
195
|
|
187
196
|
memcpy(name, in, sizeof(struct commit_name));
|
188
197
|
name->tag = NULL;
|
@@ -192,7 +201,7 @@ static int commit_name_dup(struct commit_name **out, struct commit_name *in)
|
|
192
201
|
return -1;
|
193
202
|
|
194
203
|
name->path = git__strdup(in->path);
|
195
|
-
|
204
|
+
GITERR_CHECK_ALLOC(name->path);
|
196
205
|
|
197
206
|
*out = name;
|
198
207
|
return 0;
|
@@ -215,7 +224,7 @@ static int get_name(const char *refname, void *payload)
|
|
215
224
|
return 0;
|
216
225
|
|
217
226
|
/* Accept only tags that match the pattern, if given */
|
218
|
-
if (data->opts->pattern && (!is_tag ||
|
227
|
+
if (data->opts->pattern && (!is_tag || p_fnmatch(data->opts->pattern,
|
219
228
|
refname + strlen(GIT_REFS_TAGS_DIR), 0)))
|
220
229
|
return 0;
|
221
230
|
|
@@ -258,7 +267,7 @@ static int possible_tag_dup(struct possible_tag **out, struct possible_tag *in)
|
|
258
267
|
int error;
|
259
268
|
|
260
269
|
tag = git__malloc(sizeof(struct possible_tag));
|
261
|
-
|
270
|
+
GITERR_CHECK_ALLOC(tag);
|
262
271
|
|
263
272
|
memcpy(tag, in, sizeof(struct possible_tag));
|
264
273
|
tag->name = NULL;
|
@@ -326,14 +335,14 @@ static int display_name(git_buf *buf, git_repository *repo, struct commit_name *
|
|
326
335
|
{
|
327
336
|
if (n->prio == 2 && !n->tag) {
|
328
337
|
if (git_tag_lookup(&n->tag, repo, &n->sha1) < 0) {
|
329
|
-
|
338
|
+
giterr_set(GITERR_TAG, "annotated tag '%s' not available", n->path);
|
330
339
|
return -1;
|
331
340
|
}
|
332
341
|
}
|
333
342
|
|
334
343
|
if (n->tag && !n->name_checked) {
|
335
344
|
if (!git_tag_name(n->tag)) {
|
336
|
-
|
345
|
+
giterr_set(GITERR_TAG, "annotated tag '%s' has no embedded name", n->path);
|
337
346
|
return -1;
|
338
347
|
}
|
339
348
|
|
@@ -357,7 +366,7 @@ static int find_unique_abbrev_size(
|
|
357
366
|
int *out,
|
358
367
|
git_repository *repo,
|
359
368
|
const git_oid *oid_in,
|
360
|
-
|
369
|
+
int abbreviated_size)
|
361
370
|
{
|
362
371
|
size_t size = abbreviated_size;
|
363
372
|
git_odb *odb;
|
@@ -383,7 +392,7 @@ static int find_unique_abbrev_size(
|
|
383
392
|
|
384
393
|
/* If we didn't find any shorter prefix, we have to do the whole thing */
|
385
394
|
*out = GIT_OID_HEXSZ;
|
386
|
-
|
395
|
+
|
387
396
|
return 0;
|
388
397
|
}
|
389
398
|
|
@@ -392,7 +401,7 @@ static int show_suffix(
|
|
392
401
|
int depth,
|
393
402
|
git_repository *repo,
|
394
403
|
const git_oid* id,
|
395
|
-
|
404
|
+
size_t abbrev_size)
|
396
405
|
{
|
397
406
|
int error, size = 0;
|
398
407
|
|
@@ -416,7 +425,7 @@ static int describe_not_found(const git_oid *oid, const char *message_format) {
|
|
416
425
|
char oid_str[GIT_OID_HEXSZ + 1];
|
417
426
|
git_oid_tostr(oid_str, sizeof(oid_str), oid);
|
418
427
|
|
419
|
-
|
428
|
+
giterr_set(GITERR_DESCRIBE, message_format, oid_str);
|
420
429
|
return GIT_ENOTFOUND;
|
421
430
|
}
|
422
431
|
|
@@ -495,7 +504,7 @@ static int describe(
|
|
495
504
|
unannotated_cnt++;
|
496
505
|
} else if (match_cnt < data->opts->max_candidates_tags) {
|
497
506
|
struct possible_tag *t = git__malloc(sizeof(struct commit_name));
|
498
|
-
|
507
|
+
GITERR_CHECK_ALLOC(t);
|
499
508
|
if ((error = git_vector_insert(&all_matches, t)) < 0)
|
500
509
|
goto cleanup;
|
501
510
|
|
@@ -554,14 +563,14 @@ static int describe(
|
|
554
563
|
goto cleanup;
|
555
564
|
}
|
556
565
|
if (unannotated_cnt) {
|
557
|
-
error = describe_not_found(git_commit_id(commit),
|
566
|
+
error = describe_not_found(git_commit_id(commit),
|
558
567
|
"cannot describe - "
|
559
568
|
"no annotated tags can describe '%s'; "
|
560
569
|
"however, there were unannotated tags.");
|
561
570
|
goto cleanup;
|
562
571
|
}
|
563
572
|
else {
|
564
|
-
error = describe_not_found(git_commit_id(commit),
|
573
|
+
error = describe_not_found(git_commit_id(commit),
|
565
574
|
"cannot describe - "
|
566
575
|
"no tags can describe '%s'.");
|
567
576
|
goto cleanup;
|
@@ -658,7 +667,7 @@ int git_describe_commit(
|
|
658
667
|
assert(committish);
|
659
668
|
|
660
669
|
data.result = git__calloc(1, sizeof(git_describe_result));
|
661
|
-
|
670
|
+
GITERR_CHECK_ALLOC(data.result);
|
662
671
|
data.result->repo = git_object_owner(committish);
|
663
672
|
|
664
673
|
data.repo = git_object_owner(committish);
|
@@ -666,18 +675,18 @@ int git_describe_commit(
|
|
666
675
|
if ((error = normalize_options(&normalized, opts)) < 0)
|
667
676
|
return error;
|
668
677
|
|
669
|
-
|
678
|
+
GITERR_CHECK_VERSION(
|
670
679
|
&normalized,
|
671
680
|
GIT_DESCRIBE_OPTIONS_VERSION,
|
672
681
|
"git_describe_options");
|
673
682
|
data.opts = &normalized;
|
674
683
|
|
675
|
-
|
676
|
-
|
684
|
+
data.names = git_oidmap_alloc();
|
685
|
+
GITERR_CHECK_ALLOC(data.names);
|
677
686
|
|
678
687
|
/** TODO: contains to be implemented */
|
679
688
|
|
680
|
-
if ((error = git_object_peel((git_object **)(&commit), committish,
|
689
|
+
if ((error = git_object_peel((git_object **)(&commit), committish, GIT_OBJ_COMMIT)) < 0)
|
681
690
|
goto cleanup;
|
682
691
|
|
683
692
|
if ((error = git_reference_foreach_name(
|
@@ -686,7 +695,7 @@ int git_describe_commit(
|
|
686
695
|
goto cleanup;
|
687
696
|
|
688
697
|
if (git_oidmap_size(data.names) == 0 && !opts->show_commit_oid_as_fallback) {
|
689
|
-
|
698
|
+
giterr_set(GITERR_DESCRIBE, "cannot describe - "
|
690
699
|
"no reference found, cannot describe anything.");
|
691
700
|
error = -1;
|
692
701
|
goto cleanup;
|
@@ -729,7 +738,7 @@ int git_describe_workdir(
|
|
729
738
|
if ((error = git_reference_name_to_id(¤t_id, repo, GIT_HEAD_FILE)) < 0)
|
730
739
|
return error;
|
731
740
|
|
732
|
-
if ((error = git_object_lookup(&commit, repo, ¤t_id,
|
741
|
+
if ((error = git_object_lookup(&commit, repo, ¤t_id, GIT_OBJ_COMMIT)) < 0)
|
733
742
|
return error;
|
734
743
|
|
735
744
|
/* The first step is to perform a describe of HEAD, so we can leverage this */
|
@@ -760,7 +769,7 @@ static int normalize_format_options(
|
|
760
769
|
const git_describe_format_options *src)
|
761
770
|
{
|
762
771
|
if (!src) {
|
763
|
-
|
772
|
+
git_describe_init_format_options(dst, GIT_DESCRIBE_FORMAT_OPTIONS_VERSION);
|
764
773
|
return 0;
|
765
774
|
}
|
766
775
|
|
@@ -777,14 +786,14 @@ int git_describe_format(git_buf *out, const git_describe_result *result, const g
|
|
777
786
|
|
778
787
|
assert(out && result);
|
779
788
|
|
780
|
-
|
789
|
+
GITERR_CHECK_VERSION(given, GIT_DESCRIBE_FORMAT_OPTIONS_VERSION, "git_describe_format_options");
|
781
790
|
normalize_format_options(&opts, given);
|
782
791
|
|
783
792
|
git_buf_sanitize(out);
|
784
793
|
|
785
794
|
|
786
795
|
if (opts.always_use_long_format && opts.abbreviated_size == 0) {
|
787
|
-
|
796
|
+
giterr_set(GITERR_DESCRIBE, "cannot describe - "
|
788
797
|
"'always_use_long_format' is incompatible with a zero"
|
789
798
|
"'abbreviated_size'");
|
790
799
|
return -1;
|
@@ -869,26 +878,16 @@ void git_describe_result_free(git_describe_result *result)
|
|
869
878
|
git__free(result);
|
870
879
|
}
|
871
880
|
|
872
|
-
int
|
881
|
+
int git_describe_init_options(git_describe_options *opts, unsigned int version)
|
873
882
|
{
|
874
883
|
GIT_INIT_STRUCTURE_FROM_TEMPLATE(
|
875
884
|
opts, version, git_describe_options, GIT_DESCRIBE_OPTIONS_INIT);
|
876
885
|
return 0;
|
877
886
|
}
|
878
887
|
|
879
|
-
int
|
880
|
-
{
|
881
|
-
return git_describe_options_init(opts, version);
|
882
|
-
}
|
883
|
-
|
884
|
-
int git_describe_format_options_init(git_describe_format_options *opts, unsigned int version)
|
888
|
+
int git_describe_init_format_options(git_describe_format_options *opts, unsigned int version)
|
885
889
|
{
|
886
890
|
GIT_INIT_STRUCTURE_FROM_TEMPLATE(
|
887
891
|
opts, version, git_describe_format_options, GIT_DESCRIBE_FORMAT_OPTIONS_INIT);
|
888
892
|
return 0;
|
889
893
|
}
|
890
|
-
|
891
|
-
int git_describe_init_format_options(git_describe_format_options *opts, unsigned int version)
|
892
|
-
{
|
893
|
-
return git_describe_format_options_init(opts, version);
|
894
|
-
}
|
data/vendor/libgit2/src/diff.c
CHANGED
@@ -114,7 +114,7 @@ int git_diff_is_sorted_icase(const git_diff *diff)
|
|
114
114
|
int git_diff_get_perfdata(git_diff_perfdata *out, const git_diff *diff)
|
115
115
|
{
|
116
116
|
assert(out);
|
117
|
-
|
117
|
+
GITERR_CHECK_VERSION(out, GIT_DIFF_PERFDATA_VERSION, "git_diff_perfdata");
|
118
118
|
out->stat_calls = diff->perf.stat_calls;
|
119
119
|
out->oid_calculations = diff->perf.oid_calculations;
|
120
120
|
return 0;
|
@@ -251,7 +251,7 @@ int git_diff_format_email(
|
|
251
251
|
assert(out && diff && opts);
|
252
252
|
assert(opts->summary && opts->id && opts->author);
|
253
253
|
|
254
|
-
|
254
|
+
GITERR_CHECK_VERSION(opts,
|
255
255
|
GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION,
|
256
256
|
"git_format_email_options");
|
257
257
|
|
@@ -260,14 +260,14 @@ int git_diff_format_email(
|
|
260
260
|
|
261
261
|
if (!ignore_marker) {
|
262
262
|
if (opts->patch_no > opts->total_patches) {
|
263
|
-
|
263
|
+
giterr_set(GITERR_INVALID,
|
264
264
|
"patch %"PRIuZ" out of range. max %"PRIuZ,
|
265
265
|
opts->patch_no, opts->total_patches);
|
266
266
|
return -1;
|
267
267
|
}
|
268
268
|
|
269
269
|
if (opts->patch_no == 0) {
|
270
|
-
|
270
|
+
giterr_set(GITERR_INVALID,
|
271
271
|
"invalid patch no %"PRIuZ". should be >0", opts->patch_no);
|
272
272
|
return -1;
|
273
273
|
}
|
@@ -280,14 +280,14 @@ int git_diff_format_email(
|
|
280
280
|
size_t offset = 0;
|
281
281
|
|
282
282
|
if ((offset = (loc - opts->summary)) == 0) {
|
283
|
-
|
283
|
+
giterr_set(GITERR_INVALID, "summary is empty");
|
284
284
|
error = -1;
|
285
285
|
goto on_error;
|
286
286
|
}
|
287
287
|
|
288
|
-
|
288
|
+
GITERR_CHECK_ALLOC_ADD(&allocsize, offset, 1);
|
289
289
|
summary = git__calloc(allocsize, sizeof(char));
|
290
|
-
|
290
|
+
GITERR_CHECK_ALLOC(summary);
|
291
291
|
|
292
292
|
strncpy(summary, opts->summary, offset);
|
293
293
|
}
|
@@ -323,7 +323,7 @@ int git_diff_commit_as_email(
|
|
323
323
|
git_commit *commit,
|
324
324
|
size_t patch_no,
|
325
325
|
size_t total_patches,
|
326
|
-
|
326
|
+
git_diff_format_email_flags_t flags,
|
327
327
|
const git_diff_options *diff_opts)
|
328
328
|
{
|
329
329
|
git_diff *diff = NULL;
|
@@ -350,19 +350,14 @@ int git_diff_commit_as_email(
|
|
350
350
|
return error;
|
351
351
|
}
|
352
352
|
|
353
|
-
int
|
353
|
+
int git_diff_init_options(git_diff_options *opts, unsigned int version)
|
354
354
|
{
|
355
355
|
GIT_INIT_STRUCTURE_FROM_TEMPLATE(
|
356
356
|
opts, version, git_diff_options, GIT_DIFF_OPTIONS_INIT);
|
357
357
|
return 0;
|
358
358
|
}
|
359
359
|
|
360
|
-
int
|
361
|
-
{
|
362
|
-
return git_diff_options_init(opts, version);
|
363
|
-
}
|
364
|
-
|
365
|
-
int git_diff_find_options_init(
|
360
|
+
int git_diff_find_init_options(
|
366
361
|
git_diff_find_options *opts, unsigned int version)
|
367
362
|
{
|
368
363
|
GIT_INIT_STRUCTURE_FROM_TEMPLATE(
|
@@ -370,13 +365,7 @@ int git_diff_find_options_init(
|
|
370
365
|
return 0;
|
371
366
|
}
|
372
367
|
|
373
|
-
int
|
374
|
-
git_diff_find_options *opts, unsigned int version)
|
375
|
-
{
|
376
|
-
return git_diff_find_options_init(opts, version);
|
377
|
-
}
|
378
|
-
|
379
|
-
int git_diff_format_email_options_init(
|
368
|
+
int git_diff_format_email_init_options(
|
380
369
|
git_diff_format_email_options *opts, unsigned int version)
|
381
370
|
{
|
382
371
|
GIT_INIT_STRUCTURE_FROM_TEMPLATE(
|
@@ -385,12 +374,6 @@ int git_diff_format_email_options_init(
|
|
385
374
|
return 0;
|
386
375
|
}
|
387
376
|
|
388
|
-
int git_diff_format_email_init_options(
|
389
|
-
git_diff_format_email_options *opts, unsigned int version)
|
390
|
-
{
|
391
|
-
return git_diff_format_email_options_init(opts, version);
|
392
|
-
}
|
393
|
-
|
394
377
|
static int flush_hunk(git_oid *result, git_hash_ctx *ctx)
|
395
378
|
{
|
396
379
|
git_oid hash;
|
@@ -403,7 +386,7 @@ static int flush_hunk(git_oid *result, git_hash_ctx *ctx)
|
|
403
386
|
|
404
387
|
for (i = 0; i < GIT_OID_RAWSZ; i++) {
|
405
388
|
carry += result->id[i] + hash.id[i];
|
406
|
-
result->id[i] =
|
389
|
+
result->id[i] = carry;
|
407
390
|
carry >>= 8;
|
408
391
|
}
|
409
392
|
|
@@ -426,44 +409,79 @@ static void strip_spaces(git_buf *buf)
|
|
426
409
|
git_buf_truncate(buf, len);
|
427
410
|
}
|
428
411
|
|
429
|
-
int
|
412
|
+
static int file_cb(
|
430
413
|
const git_diff_delta *delta,
|
431
|
-
|
432
|
-
const git_diff_line *line,
|
414
|
+
float progress,
|
433
415
|
void *payload)
|
434
416
|
{
|
435
417
|
struct patch_id_args *args = (struct patch_id_args *) payload;
|
436
418
|
git_buf buf = GIT_BUF_INIT;
|
437
|
-
int error
|
419
|
+
int error;
|
438
420
|
|
439
|
-
|
440
|
-
line->origin == GIT_DIFF_LINE_ADD_EOFNL ||
|
441
|
-
line->origin == GIT_DIFF_LINE_DEL_EOFNL)
|
442
|
-
goto out;
|
421
|
+
GIT_UNUSED(progress);
|
443
422
|
|
444
|
-
if (
|
445
|
-
|
423
|
+
if (!args->first_file &&
|
424
|
+
(error = flush_hunk(&args->result, &args->ctx)) < 0)
|
425
|
+
goto out;
|
426
|
+
args->first_file = 0;
|
427
|
+
|
428
|
+
if ((error = git_buf_printf(&buf,
|
429
|
+
"diff--gita/%sb/%s---a/%s+++b/%s",
|
430
|
+
delta->old_file.path,
|
431
|
+
delta->new_file.path,
|
432
|
+
delta->old_file.path,
|
433
|
+
delta->new_file.path)) < 0)
|
446
434
|
goto out;
|
447
435
|
|
448
436
|
strip_spaces(&buf);
|
449
437
|
|
450
|
-
if (line->origin == GIT_DIFF_LINE_FILE_HDR &&
|
451
|
-
!args->first_file &&
|
452
|
-
(error = flush_hunk(&args->result, &args->ctx) < 0))
|
453
|
-
goto out;
|
454
|
-
|
455
438
|
if ((error = git_hash_update(&args->ctx, buf.ptr, buf.size)) < 0)
|
456
439
|
goto out;
|
457
440
|
|
458
|
-
|
459
|
-
|
441
|
+
out:
|
442
|
+
git_buf_free(&buf);
|
443
|
+
return error;
|
444
|
+
}
|
445
|
+
|
446
|
+
static int line_cb(
|
447
|
+
const git_diff_delta *delta,
|
448
|
+
const git_diff_hunk *hunk,
|
449
|
+
const git_diff_line *line,
|
450
|
+
void *payload)
|
451
|
+
{
|
452
|
+
struct patch_id_args *args = (struct patch_id_args *) payload;
|
453
|
+
git_buf buf = GIT_BUF_INIT;
|
454
|
+
int error;
|
455
|
+
|
456
|
+
GIT_UNUSED(delta);
|
457
|
+
GIT_UNUSED(hunk);
|
458
|
+
|
459
|
+
switch (line->origin) {
|
460
|
+
case GIT_DIFF_LINE_ADDITION:
|
461
|
+
git_buf_putc(&buf, '+');
|
462
|
+
break;
|
463
|
+
case GIT_DIFF_LINE_DELETION:
|
464
|
+
git_buf_putc(&buf, '-');
|
465
|
+
break;
|
466
|
+
case GIT_DIFF_LINE_CONTEXT:
|
467
|
+
break;
|
468
|
+
default:
|
469
|
+
giterr_set(GITERR_PATCH, "invalid line origin for patch");
|
470
|
+
return -1;
|
471
|
+
}
|
472
|
+
|
473
|
+
git_buf_put(&buf, line->content, line->content_len);
|
474
|
+
strip_spaces(&buf);
|
475
|
+
|
476
|
+
if ((error = git_hash_update(&args->ctx, buf.ptr, buf.size)) < 0)
|
477
|
+
goto out;
|
460
478
|
|
461
479
|
out:
|
462
|
-
|
480
|
+
git_buf_free(&buf);
|
463
481
|
return error;
|
464
482
|
}
|
465
483
|
|
466
|
-
int
|
484
|
+
int git_diff_patchid_init_options(git_diff_patchid_options *opts, unsigned int version)
|
467
485
|
{
|
468
486
|
GIT_INIT_STRUCTURE_FROM_TEMPLATE(
|
469
487
|
opts, version, git_diff_patchid_options, GIT_DIFF_PATCHID_OPTIONS_INIT);
|
@@ -475,7 +493,7 @@ int git_diff_patchid(git_oid *out, git_diff *diff, git_diff_patchid_options *opt
|
|
475
493
|
struct patch_id_args args;
|
476
494
|
int error;
|
477
495
|
|
478
|
-
|
496
|
+
GITERR_CHECK_VERSION(
|
479
497
|
opts, GIT_DIFF_PATCHID_OPTIONS_VERSION, "git_diff_patchid_options");
|
480
498
|
|
481
499
|
memset(&args, 0, sizeof(args));
|
@@ -483,10 +501,7 @@ int git_diff_patchid(git_oid *out, git_diff *diff, git_diff_patchid_options *opt
|
|
483
501
|
if ((error = git_hash_ctx_init(&args.ctx)) < 0)
|
484
502
|
goto out;
|
485
503
|
|
486
|
-
if ((error =
|
487
|
-
GIT_DIFF_FORMAT_PATCH_ID,
|
488
|
-
git_diff_patchid_print_callback__to_buf,
|
489
|
-
&args)) < 0)
|
504
|
+
if ((error = git_diff_foreach(diff, file_cb, NULL, NULL, line_cb, &args)) < 0)
|
490
505
|
goto out;
|
491
506
|
|
492
507
|
if ((error = (flush_hunk(&args.result, &args.ctx))) < 0)
|