rugged 0.27.10 → 0.27.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
@@ -6,7 +6,6 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
#include "diff_xdiff.h"
|
9
|
-
#include "util.h"
|
10
9
|
|
11
10
|
#include "git2/errors.h"
|
12
11
|
#include "diff.h"
|
@@ -52,7 +51,7 @@ static int git_xdiff_parse_hunk(git_diff_hunk *hunk, const char *header)
|
|
52
51
|
return 0;
|
53
52
|
|
54
53
|
fail:
|
55
|
-
|
54
|
+
giterr_set(GITERR_INVALID, "malformed hunk header from xdiff");
|
56
55
|
return -1;
|
57
56
|
}
|
58
57
|
|
@@ -101,7 +100,7 @@ static int diff_update_lines(
|
|
101
100
|
info->new_lineno += (int)line->num_lines;
|
102
101
|
break;
|
103
102
|
default:
|
104
|
-
|
103
|
+
giterr_set(GITERR_INVALID, "unknown diff line origin %02x",
|
105
104
|
(unsigned int)line->origin);
|
106
105
|
return -1;
|
107
106
|
}
|
@@ -116,7 +115,6 @@ static int git_xdiff_cb(void *priv, mmbuffer_t *bufs, int len)
|
|
116
115
|
const git_diff_delta *delta = patch->base.delta;
|
117
116
|
git_patch_generated_output *output = &info->xo->output;
|
118
117
|
git_diff_line line;
|
119
|
-
size_t buffer_len;
|
120
118
|
|
121
119
|
if (len == 1) {
|
122
120
|
output->error = git_xdiff_parse_hunk(&info->hunk, bufs[0].ptr);
|
@@ -126,16 +124,6 @@ static int git_xdiff_cb(void *priv, mmbuffer_t *bufs, int len)
|
|
126
124
|
info->hunk.header_len = bufs[0].size;
|
127
125
|
if (info->hunk.header_len >= sizeof(info->hunk.header))
|
128
126
|
info->hunk.header_len = sizeof(info->hunk.header) - 1;
|
129
|
-
|
130
|
-
/* Sanitize the hunk header in case there is invalid Unicode */
|
131
|
-
buffer_len = git__utf8_valid_buf_length((const uint8_t *) bufs[0].ptr, info->hunk.header_len);
|
132
|
-
/* Sanitizing the hunk header may delete the newline, so add it back again if there is room */
|
133
|
-
if (buffer_len < info->hunk.header_len) {
|
134
|
-
bufs[0].ptr[buffer_len] = '\n';
|
135
|
-
buffer_len += 1;
|
136
|
-
info->hunk.header_len = buffer_len;
|
137
|
-
}
|
138
|
-
|
139
127
|
memcpy(info->hunk.header, bufs[0].ptr, info->hunk.header_len);
|
140
128
|
info->hunk.header[info->hunk.header_len] = '\0';
|
141
129
|
|
@@ -224,7 +212,7 @@ static int git_xdiff(git_patch_generated_output *output, git_patch_generated *pa
|
|
224
212
|
|
225
213
|
if (info.xd_old_data.size > GIT_XDIFF_MAX_SIZE ||
|
226
214
|
info.xd_new_data.size > GIT_XDIFF_MAX_SIZE) {
|
227
|
-
|
215
|
+
giterr_set(GITERR_INVALID, "files too large for diff");
|
228
216
|
return -1;
|
229
217
|
}
|
230
218
|
|
data/vendor/libgit2/src/errors.c
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
|
18
18
|
static git_error g_git_oom_error = {
|
19
19
|
"Out of memory",
|
20
|
-
|
20
|
+
GITERR_NOMEMORY
|
21
21
|
};
|
22
22
|
|
23
23
|
static void set_error_from_buffer(int error_class)
|
@@ -44,36 +44,31 @@ static void set_error(int error_class, char *string)
|
|
44
44
|
set_error_from_buffer(error_class);
|
45
45
|
}
|
46
46
|
|
47
|
-
void
|
47
|
+
void giterr_set_oom(void)
|
48
48
|
{
|
49
49
|
GIT_GLOBAL->last_error = &g_git_oom_error;
|
50
50
|
}
|
51
51
|
|
52
|
-
void
|
53
|
-
{
|
54
|
-
va_list ap;
|
55
|
-
|
56
|
-
va_start(ap, fmt);
|
57
|
-
git_error_vset(error_class, fmt, ap);
|
58
|
-
va_end(ap);
|
59
|
-
}
|
60
|
-
|
61
|
-
void git_error_vset(int error_class, const char *fmt, va_list ap)
|
52
|
+
void giterr_set(int error_class, const char *string, ...)
|
62
53
|
{
|
54
|
+
va_list arglist;
|
63
55
|
#ifdef GIT_WIN32
|
64
|
-
DWORD win32_error_code = (error_class ==
|
56
|
+
DWORD win32_error_code = (error_class == GITERR_OS) ? GetLastError() : 0;
|
65
57
|
#endif
|
66
|
-
int error_code = (error_class ==
|
58
|
+
int error_code = (error_class == GITERR_OS) ? errno : 0;
|
67
59
|
git_buf *buf = &GIT_GLOBAL->error_buf;
|
68
60
|
|
69
61
|
git_buf_clear(buf);
|
70
|
-
if (
|
71
|
-
|
72
|
-
|
62
|
+
if (string) {
|
63
|
+
va_start(arglist, string);
|
64
|
+
git_buf_vprintf(buf, string, arglist);
|
65
|
+
va_end(arglist);
|
66
|
+
|
67
|
+
if (error_class == GITERR_OS)
|
73
68
|
git_buf_PUTS(buf, ": ");
|
74
69
|
}
|
75
70
|
|
76
|
-
if (error_class ==
|
71
|
+
if (error_class == GITERR_OS) {
|
77
72
|
#ifdef GIT_WIN32
|
78
73
|
char * win32_error = git_win32_get_error_message(win32_error_code);
|
79
74
|
if (win32_error) {
|
@@ -95,7 +90,7 @@ void git_error_vset(int error_class, const char *fmt, va_list ap)
|
|
95
90
|
set_error_from_buffer(error_class);
|
96
91
|
}
|
97
92
|
|
98
|
-
void
|
93
|
+
void giterr_set_str(int error_class, const char *string)
|
99
94
|
{
|
100
95
|
git_buf *buf = &GIT_GLOBAL->error_buf;
|
101
96
|
|
@@ -110,7 +105,22 @@ void git_error_set_str(int error_class, const char *string)
|
|
110
105
|
set_error_from_buffer(error_class);
|
111
106
|
}
|
112
107
|
|
113
|
-
|
108
|
+
int giterr_set_regex(const regex_t *regex, int error_code)
|
109
|
+
{
|
110
|
+
char error_buf[1024];
|
111
|
+
|
112
|
+
assert(error_code);
|
113
|
+
|
114
|
+
regerror(error_code, regex, error_buf, sizeof(error_buf));
|
115
|
+
giterr_set_str(GITERR_REGEX, error_buf);
|
116
|
+
|
117
|
+
if (error_code == REG_NOMATCH)
|
118
|
+
return GIT_ENOTFOUND;
|
119
|
+
|
120
|
+
return GIT_EINVALIDSPEC;
|
121
|
+
}
|
122
|
+
|
123
|
+
void giterr_clear(void)
|
114
124
|
{
|
115
125
|
if (GIT_GLOBAL->last_error != NULL) {
|
116
126
|
set_error(0, NULL);
|
@@ -123,12 +133,12 @@ void git_error_clear(void)
|
|
123
133
|
#endif
|
124
134
|
}
|
125
135
|
|
126
|
-
const git_error *
|
136
|
+
const git_error *giterr_last(void)
|
127
137
|
{
|
128
138
|
return GIT_GLOBAL->last_error;
|
129
139
|
}
|
130
140
|
|
131
|
-
int
|
141
|
+
int giterr_state_capture(git_error_state *state, int error_code)
|
132
142
|
{
|
133
143
|
git_error *error = GIT_GLOBAL->last_error;
|
134
144
|
git_buf *error_buf = &GIT_GLOBAL->error_buf;
|
@@ -150,19 +160,19 @@ int git_error_state_capture(git_error_state *state, int error_code)
|
|
150
160
|
state->error_msg.message = git_buf_detach(error_buf);
|
151
161
|
}
|
152
162
|
|
153
|
-
|
163
|
+
giterr_clear();
|
154
164
|
return error_code;
|
155
165
|
}
|
156
166
|
|
157
|
-
int
|
167
|
+
int giterr_state_restore(git_error_state *state)
|
158
168
|
{
|
159
169
|
int ret = 0;
|
160
170
|
|
161
|
-
|
171
|
+
giterr_clear();
|
162
172
|
|
163
173
|
if (state && state->error_msg.message) {
|
164
174
|
if (state->oom)
|
165
|
-
|
175
|
+
giterr_set_oom();
|
166
176
|
else
|
167
177
|
set_error(state->error_msg.klass, state->error_msg.message);
|
168
178
|
|
@@ -173,7 +183,7 @@ int git_error_state_restore(git_error_state *state)
|
|
173
183
|
return ret;
|
174
184
|
}
|
175
185
|
|
176
|
-
void
|
186
|
+
void giterr_state_free(git_error_state *state)
|
177
187
|
{
|
178
188
|
if (!state)
|
179
189
|
return;
|
@@ -184,7 +194,7 @@ void git_error_state_free(git_error_state *state)
|
|
184
194
|
memset(state, 0, sizeof(git_error_state));
|
185
195
|
}
|
186
196
|
|
187
|
-
int
|
197
|
+
int giterr_system_last(void)
|
188
198
|
{
|
189
199
|
#ifdef GIT_WIN32
|
190
200
|
return GetLastError();
|
@@ -193,7 +203,7 @@ int git_error_system_last(void)
|
|
193
203
|
#endif
|
194
204
|
}
|
195
205
|
|
196
|
-
void
|
206
|
+
void giterr_system_set(int code)
|
197
207
|
{
|
198
208
|
#ifdef GIT_WIN32
|
199
209
|
SetLastError(code);
|
@@ -201,25 +211,3 @@ void git_error_system_set(int code)
|
|
201
211
|
errno = code;
|
202
212
|
#endif
|
203
213
|
}
|
204
|
-
|
205
|
-
/* Deprecated error values and functions */
|
206
|
-
|
207
|
-
const git_error *giterr_last(void)
|
208
|
-
{
|
209
|
-
return git_error_last();
|
210
|
-
}
|
211
|
-
|
212
|
-
void giterr_clear(void)
|
213
|
-
{
|
214
|
-
git_error_clear();
|
215
|
-
}
|
216
|
-
|
217
|
-
void giterr_set_str(int error_class, const char *string)
|
218
|
-
{
|
219
|
-
git_error_set_str(error_class, string);
|
220
|
-
}
|
221
|
-
|
222
|
-
void giterr_set_oom(void)
|
223
|
-
{
|
224
|
-
git_error_set_oom();
|
225
|
-
}
|
@@ -15,30 +15,22 @@
|
|
15
15
|
#cmakedefine GIT_USE_STAT_MTIMESPEC 1
|
16
16
|
#cmakedefine GIT_USE_STAT_MTIME_NSEC 1
|
17
17
|
#cmakedefine GIT_USE_FUTIMENS 1
|
18
|
-
|
19
|
-
#cmakedefine GIT_REGEX_REGCOMP_L
|
20
|
-
#cmakedefine GIT_REGEX_REGCOMP
|
21
|
-
#cmakedefine GIT_REGEX_PCRE
|
22
|
-
#cmakedefine GIT_REGEX_PCRE2
|
23
|
-
#cmakedefine GIT_REGEX_BUILTIN 1
|
18
|
+
#cmakedefine GIT_USE_REGCOMP_L 1
|
24
19
|
|
25
20
|
#cmakedefine GIT_SSH 1
|
26
21
|
#cmakedefine GIT_SSH_MEMORY_CREDENTIALS 1
|
27
22
|
|
28
|
-
#cmakedefine GIT_NTLM 1
|
29
23
|
#cmakedefine GIT_GSSAPI 1
|
30
|
-
#cmakedefine GIT_GSSFRAMEWORK 1
|
31
|
-
|
32
24
|
#cmakedefine GIT_WINHTTP 1
|
25
|
+
#cmakedefine GIT_CURL 1
|
26
|
+
|
33
27
|
#cmakedefine GIT_HTTPS 1
|
34
28
|
#cmakedefine GIT_OPENSSL 1
|
35
29
|
#cmakedefine GIT_SECURE_TRANSPORT 1
|
36
|
-
#cmakedefine GIT_MBEDTLS 1
|
37
30
|
|
38
31
|
#cmakedefine GIT_SHA1_COLLISIONDETECT 1
|
39
32
|
#cmakedefine GIT_SHA1_WIN32 1
|
40
33
|
#cmakedefine GIT_SHA1_COMMON_CRYPTO 1
|
41
34
|
#cmakedefine GIT_SHA1_OPENSSL 1
|
42
|
-
#cmakedefine GIT_SHA1_MBEDTLS 1
|
43
35
|
|
44
36
|
#endif
|
data/vendor/libgit2/src/fetch.c
CHANGED
@@ -78,7 +78,7 @@ static int filter_wants(git_remote *remote, const git_fetch_options *opts)
|
|
78
78
|
goto cleanup;
|
79
79
|
|
80
80
|
error = git_refspec__dwim_one(&remote->active_refspecs, &head, &remote->refs);
|
81
|
-
|
81
|
+
git_refspec__free(&head);
|
82
82
|
|
83
83
|
if (error < 0)
|
84
84
|
goto cleanup;
|
@@ -96,7 +96,7 @@ static int filter_wants(git_remote *remote, const git_fetch_options *opts)
|
|
96
96
|
}
|
97
97
|
|
98
98
|
cleanup:
|
99
|
-
|
99
|
+
git_refspec__free(&tagspec);
|
100
100
|
|
101
101
|
return error;
|
102
102
|
}
|
@@ -113,7 +113,7 @@ int git_fetch_negotiate(git_remote *remote, const git_fetch_options *opts)
|
|
113
113
|
remote->need_pack = 0;
|
114
114
|
|
115
115
|
if (filter_wants(remote, opts) < 0) {
|
116
|
-
|
116
|
+
giterr_set(GITERR_NET, "failed to filter the reference list for wants");
|
117
117
|
return -1;
|
118
118
|
}
|
119
119
|
|
@@ -134,7 +134,7 @@ int git_fetch_negotiate(git_remote *remote, const git_fetch_options *opts)
|
|
134
134
|
int git_fetch_download_pack(git_remote *remote, const git_remote_callbacks *callbacks)
|
135
135
|
{
|
136
136
|
git_transport *t = remote->transport;
|
137
|
-
|
137
|
+
git_transfer_progress_cb progress = NULL;
|
138
138
|
void *payload = NULL;
|
139
139
|
|
140
140
|
if (!remote->need_pack)
|
@@ -148,14 +148,9 @@ int git_fetch_download_pack(git_remote *remote, const git_remote_callbacks *call
|
|
148
148
|
return t->download_pack(t, remote->repo, &remote->stats, progress, payload);
|
149
149
|
}
|
150
150
|
|
151
|
-
int
|
151
|
+
int git_fetch_init_options(git_fetch_options *opts, unsigned int version)
|
152
152
|
{
|
153
153
|
GIT_INIT_STRUCTURE_FROM_TEMPLATE(
|
154
154
|
opts, version, git_fetch_options, GIT_FETCH_OPTIONS_INIT);
|
155
155
|
return 0;
|
156
156
|
}
|
157
|
-
|
158
|
-
int git_fetch_init_options(git_fetch_options *opts, unsigned int version)
|
159
|
-
{
|
160
|
-
return git_fetch_options_init(opts, version);
|
161
|
-
}
|
@@ -11,7 +11,7 @@
|
|
11
11
|
#include "git2/oid.h"
|
12
12
|
|
13
13
|
#include "buffer.h"
|
14
|
-
#include "
|
14
|
+
#include "fileops.h"
|
15
15
|
#include "filebuf.h"
|
16
16
|
#include "refs.h"
|
17
17
|
#include "repository.h"
|
@@ -50,7 +50,7 @@ int git_fetchhead_ref_create(
|
|
50
50
|
*out = NULL;
|
51
51
|
|
52
52
|
fetchhead_ref = git__malloc(sizeof(git_fetchhead_ref));
|
53
|
-
|
53
|
+
GITERR_CHECK_ALLOC(fetchhead_ref);
|
54
54
|
|
55
55
|
memset(fetchhead_ref, 0x0, sizeof(git_fetchhead_ref));
|
56
56
|
|
@@ -119,11 +119,11 @@ int git_fetchhead_write(git_repository *repo, git_vector *fetchhead_refs)
|
|
119
119
|
return -1;
|
120
120
|
|
121
121
|
if (git_filebuf_open(&file, path.ptr, GIT_FILEBUF_APPEND, GIT_REFS_FILE_MODE) < 0) {
|
122
|
-
|
122
|
+
git_buf_free(&path);
|
123
123
|
return -1;
|
124
124
|
}
|
125
125
|
|
126
|
-
|
126
|
+
git_buf_free(&path);
|
127
127
|
|
128
128
|
git_vector_sort(fetchhead_refs);
|
129
129
|
|
@@ -148,7 +148,7 @@ static int fetchhead_ref_parse(
|
|
148
148
|
*remote_url = NULL;
|
149
149
|
|
150
150
|
if (!*line) {
|
151
|
-
|
151
|
+
giterr_set(GITERR_FETCHHEAD,
|
152
152
|
"empty line in FETCH_HEAD line %"PRIuZ, line_num);
|
153
153
|
return -1;
|
154
154
|
}
|
@@ -162,16 +162,16 @@ static int fetchhead_ref_parse(
|
|
162
162
|
}
|
163
163
|
|
164
164
|
if (strlen(oid_str) != GIT_OID_HEXSZ) {
|
165
|
-
|
165
|
+
giterr_set(GITERR_FETCHHEAD,
|
166
166
|
"invalid object ID in FETCH_HEAD line %"PRIuZ, line_num);
|
167
167
|
return -1;
|
168
168
|
}
|
169
169
|
|
170
170
|
if (git_oid_fromstr(oid, oid_str) < 0) {
|
171
|
-
const git_error *oid_err =
|
171
|
+
const git_error *oid_err = giterr_last();
|
172
172
|
const char *err_msg = oid_err ? oid_err->message : "invalid object ID";
|
173
173
|
|
174
|
-
|
174
|
+
giterr_set(GITERR_FETCHHEAD, "%s in FETCH_HEAD line %"PRIuZ,
|
175
175
|
err_msg, line_num);
|
176
176
|
return -1;
|
177
177
|
}
|
@@ -179,7 +179,7 @@ static int fetchhead_ref_parse(
|
|
179
179
|
/* Parse new data from newer git clients */
|
180
180
|
if (*line) {
|
181
181
|
if ((is_merge_str = git__strsep(&line, "\t")) == NULL) {
|
182
|
-
|
182
|
+
giterr_set(GITERR_FETCHHEAD,
|
183
183
|
"invalid description data in FETCH_HEAD line %"PRIuZ, line_num);
|
184
184
|
return -1;
|
185
185
|
}
|
@@ -189,13 +189,13 @@ static int fetchhead_ref_parse(
|
|
189
189
|
else if (strcmp(is_merge_str, "not-for-merge") == 0)
|
190
190
|
*is_merge = 0;
|
191
191
|
else {
|
192
|
-
|
192
|
+
giterr_set(GITERR_FETCHHEAD,
|
193
193
|
"invalid for-merge entry in FETCH_HEAD line %"PRIuZ, line_num);
|
194
194
|
return -1;
|
195
195
|
}
|
196
196
|
|
197
197
|
if ((desc = line) == NULL) {
|
198
|
-
|
198
|
+
giterr_set(GITERR_FETCHHEAD,
|
199
199
|
"invalid description in FETCH_HEAD line %"PRIuZ, line_num);
|
200
200
|
return -1;
|
201
201
|
}
|
@@ -212,7 +212,7 @@ static int fetchhead_ref_parse(
|
|
212
212
|
if (name) {
|
213
213
|
if ((desc = strstr(name, "' ")) == NULL ||
|
214
214
|
git__prefixcmp(desc, "' of ") != 0) {
|
215
|
-
|
215
|
+
giterr_set(GITERR_FETCHHEAD,
|
216
216
|
"invalid description in FETCH_HEAD line %"PRIuZ, line_num);
|
217
217
|
return -1;
|
218
218
|
}
|
@@ -271,21 +271,21 @@ int git_repository_fetchhead_foreach(git_repository *repo,
|
|
271
271
|
|
272
272
|
error = cb(ref_name, remote_url, &oid, is_merge, payload);
|
273
273
|
if (error) {
|
274
|
-
|
274
|
+
giterr_set_after_callback(error);
|
275
275
|
goto done;
|
276
276
|
}
|
277
277
|
}
|
278
278
|
|
279
279
|
if (*buffer) {
|
280
|
-
|
280
|
+
giterr_set(GITERR_FETCHHEAD, "no EOL at line %"PRIuZ, line_num+1);
|
281
281
|
error = -1;
|
282
282
|
goto done;
|
283
283
|
}
|
284
284
|
|
285
285
|
done:
|
286
|
-
|
287
|
-
|
288
|
-
|
286
|
+
git_buf_free(&file);
|
287
|
+
git_buf_free(&path);
|
288
|
+
git_buf_free(&name);
|
289
289
|
|
290
290
|
return error;
|
291
291
|
}
|
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
#include "filebuf.h"
|
9
9
|
|
10
|
-
#include "
|
10
|
+
#include "fileops.h"
|
11
11
|
|
12
12
|
static const size_t WRITE_BUFFER_SIZE = (4096 * 2);
|
13
13
|
|
@@ -24,15 +24,15 @@ static int verify_last_error(git_filebuf *file)
|
|
24
24
|
{
|
25
25
|
switch (file->last_error) {
|
26
26
|
case BUFERR_WRITE:
|
27
|
-
|
27
|
+
giterr_set(GITERR_OS, "failed to write out file");
|
28
28
|
return -1;
|
29
29
|
|
30
30
|
case BUFERR_MEM:
|
31
|
-
|
31
|
+
giterr_set_oom();
|
32
32
|
return -1;
|
33
33
|
|
34
34
|
case BUFERR_ZLIB:
|
35
|
-
|
35
|
+
giterr_set(GITERR_ZLIB,
|
36
36
|
"Buffer error when writing out ZLib data");
|
37
37
|
return -1;
|
38
38
|
|
@@ -44,14 +44,18 @@ static int verify_last_error(git_filebuf *file)
|
|
44
44
|
static int lock_file(git_filebuf *file, int flags, mode_t mode)
|
45
45
|
{
|
46
46
|
if (git_path_exists(file->path_lock) == true) {
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
47
|
+
if (flags & GIT_FILEBUF_FORCE)
|
48
|
+
p_unlink(file->path_lock);
|
49
|
+
else {
|
50
|
+
giterr_clear(); /* actual OS error code just confuses */
|
51
|
+
giterr_set(GITERR_OS,
|
52
|
+
"failed to lock file '%s' for writing", file->path_lock);
|
53
|
+
return GIT_ELOCKED;
|
54
|
+
}
|
51
55
|
}
|
52
56
|
|
53
57
|
/* create path to the file buffer is required */
|
54
|
-
if (flags &
|
58
|
+
if (flags & GIT_FILEBUF_FORCE) {
|
55
59
|
/* XXX: Should dirmode here be configurable? Or is 0777 always fine? */
|
56
60
|
file->fd = git_futils_creat_locked_withpath(file->path_lock, 0777, mode);
|
57
61
|
} else {
|
@@ -71,7 +75,7 @@ static int lock_file(git_filebuf *file, int flags, mode_t mode)
|
|
71
75
|
|
72
76
|
source = p_open(file->path_original, O_RDONLY);
|
73
77
|
if (source < 0) {
|
74
|
-
|
78
|
+
giterr_set(GITERR_OS,
|
75
79
|
"failed to open file '%s' for reading",
|
76
80
|
file->path_original);
|
77
81
|
return -1;
|
@@ -87,10 +91,10 @@ static int lock_file(git_filebuf *file, int flags, mode_t mode)
|
|
87
91
|
p_close(source);
|
88
92
|
|
89
93
|
if (read_bytes < 0) {
|
90
|
-
|
94
|
+
giterr_set(GITERR_OS, "failed to read file '%s'", file->path_original);
|
91
95
|
return -1;
|
92
96
|
} else if (error < 0) {
|
93
|
-
|
97
|
+
giterr_set(GITERR_OS, "failed to write file '%s'", file->path_lock);
|
94
98
|
return -1;
|
95
99
|
}
|
96
100
|
}
|
@@ -214,7 +218,7 @@ static int resolve_symlink(git_buf *out, const char *path)
|
|
214
218
|
}
|
215
219
|
|
216
220
|
if (error < 0) {
|
217
|
-
|
221
|
+
giterr_set(GITERR_OS, "failed to stat '%s'", curpath.ptr);
|
218
222
|
error = -1;
|
219
223
|
goto cleanup;
|
220
224
|
}
|
@@ -226,13 +230,13 @@ static int resolve_symlink(git_buf *out, const char *path)
|
|
226
230
|
|
227
231
|
ret = p_readlink(curpath.ptr, target.ptr, GIT_PATH_MAX);
|
228
232
|
if (ret < 0) {
|
229
|
-
|
233
|
+
giterr_set(GITERR_OS, "failed to read symlink '%s'", curpath.ptr);
|
230
234
|
error = -1;
|
231
235
|
goto cleanup;
|
232
236
|
}
|
233
237
|
|
234
238
|
if (ret == GIT_PATH_MAX) {
|
235
|
-
|
239
|
+
giterr_set(GITERR_INVALID, "symlink target too long");
|
236
240
|
error = -1;
|
237
241
|
goto cleanup;
|
238
242
|
}
|
@@ -252,19 +256,19 @@ static int resolve_symlink(git_buf *out, const char *path)
|
|
252
256
|
goto cleanup;
|
253
257
|
|
254
258
|
git_buf_swap(&curpath, &dir);
|
255
|
-
|
259
|
+
git_buf_free(&dir);
|
256
260
|
|
257
261
|
if ((error = git_path_apply_relative(&curpath, target.ptr)) < 0)
|
258
262
|
goto cleanup;
|
259
263
|
}
|
260
264
|
}
|
261
265
|
|
262
|
-
|
266
|
+
giterr_set(GITERR_INVALID, "maximum symlink depth reached");
|
263
267
|
error = -1;
|
264
268
|
|
265
269
|
cleanup:
|
266
|
-
|
267
|
-
|
270
|
+
git_buf_free(&curpath);
|
271
|
+
git_buf_free(&target);
|
268
272
|
return error;
|
269
273
|
}
|
270
274
|
|
@@ -299,7 +303,7 @@ int git_filebuf_open_withsize(git_filebuf *file, const char *path, int flags, mo
|
|
299
303
|
/* Allocate the main cache buffer */
|
300
304
|
if (!file->do_not_buffer) {
|
301
305
|
file->buffer = git__malloc(file->buf_size);
|
302
|
-
|
306
|
+
GITERR_CHECK_ALLOC(file->buffer);
|
303
307
|
}
|
304
308
|
|
305
309
|
/* If we are hashing on-write, allocate a new hash context */
|
@@ -316,13 +320,13 @@ int git_filebuf_open_withsize(git_filebuf *file, const char *path, int flags, mo
|
|
316
320
|
if (compression != 0) {
|
317
321
|
/* Initialize the ZLib stream */
|
318
322
|
if (deflateInit(&file->zs, compression) != Z_OK) {
|
319
|
-
|
323
|
+
giterr_set(GITERR_ZLIB, "failed to initialize zlib");
|
320
324
|
goto cleanup;
|
321
325
|
}
|
322
326
|
|
323
327
|
/* Allocate the Zlib cache buffer */
|
324
328
|
file->z_buf = git__malloc(file->buf_size);
|
325
|
-
|
329
|
+
GITERR_CHECK_ALLOC(file->z_buf);
|
326
330
|
|
327
331
|
/* Never flush */
|
328
332
|
file->flush_mode = Z_NO_FLUSH;
|
@@ -339,7 +343,7 @@ int git_filebuf_open_withsize(git_filebuf *file, const char *path, int flags, mo
|
|
339
343
|
file->fd = git_futils_mktmp(&tmp_path, path, mode);
|
340
344
|
|
341
345
|
if (file->fd < 0) {
|
342
|
-
|
346
|
+
git_buf_free(&tmp_path);
|
343
347
|
goto cleanup;
|
344
348
|
}
|
345
349
|
file->fd_is_open = true;
|
@@ -348,7 +352,7 @@ int git_filebuf_open_withsize(git_filebuf *file, const char *path, int flags, mo
|
|
348
352
|
/* No original path */
|
349
353
|
file->path_original = NULL;
|
350
354
|
file->path_lock = git_buf_detach(&tmp_path);
|
351
|
-
|
355
|
+
GITERR_CHECK_ALLOC(file->path_lock);
|
352
356
|
} else {
|
353
357
|
git_buf resolved_path = GIT_BUF_INIT;
|
354
358
|
|
@@ -360,15 +364,15 @@ int git_filebuf_open_withsize(git_filebuf *file, const char *path, int flags, mo
|
|
360
364
|
file->path_original = git_buf_detach(&resolved_path);
|
361
365
|
|
362
366
|
/* create the locking path by appending ".lock" to the original */
|
363
|
-
|
367
|
+
GITERR_CHECK_ALLOC_ADD(&alloc_len, path_len, GIT_FILELOCK_EXTLENGTH);
|
364
368
|
file->path_lock = git__malloc(alloc_len);
|
365
|
-
|
369
|
+
GITERR_CHECK_ALLOC(file->path_lock);
|
366
370
|
|
367
371
|
memcpy(file->path_lock, file->path_original, path_len);
|
368
372
|
memcpy(file->path_lock + path_len, GIT_FILELOCK_EXTENSION, GIT_FILELOCK_EXTLENGTH);
|
369
373
|
|
370
374
|
if (git_path_isdir(file->path_original)) {
|
371
|
-
|
375
|
+
giterr_set(GITERR_FILESYSTEM, "path '%s' is a directory", file->path_original);
|
372
376
|
error = GIT_EDIRECTORY;
|
373
377
|
goto cleanup;
|
374
378
|
}
|
@@ -407,7 +411,7 @@ int git_filebuf_commit_at(git_filebuf *file, const char *path)
|
|
407
411
|
{
|
408
412
|
git__free(file->path_original);
|
409
413
|
file->path_original = git__strdup(path);
|
410
|
-
|
414
|
+
GITERR_CHECK_ALLOC(file->path_original);
|
411
415
|
|
412
416
|
return git_filebuf_commit(file);
|
413
417
|
}
|
@@ -426,19 +430,19 @@ int git_filebuf_commit(git_filebuf *file)
|
|
426
430
|
file->fd_is_open = false;
|
427
431
|
|
428
432
|
if (file->do_fsync && p_fsync(file->fd) < 0) {
|
429
|
-
|
433
|
+
giterr_set(GITERR_OS, "failed to fsync '%s'", file->path_lock);
|
430
434
|
goto on_error;
|
431
435
|
}
|
432
436
|
|
433
437
|
if (p_close(file->fd) < 0) {
|
434
|
-
|
438
|
+
giterr_set(GITERR_OS, "failed to close file at '%s'", file->path_lock);
|
435
439
|
goto on_error;
|
436
440
|
}
|
437
441
|
|
438
442
|
file->fd = -1;
|
439
443
|
|
440
444
|
if (p_rename(file->path_lock, file->path_original) < 0) {
|
441
|
-
|
445
|
+
giterr_set(GITERR_OS, "failed to rename lockfile to '%s'", file->path_original);
|
442
446
|
goto on_error;
|
443
447
|
}
|
444
448
|
|
@@ -579,7 +583,7 @@ int git_filebuf_stats(time_t *mtime, size_t *size, git_filebuf *file)
|
|
579
583
|
res = p_stat(file->path_original, &st);
|
580
584
|
|
581
585
|
if (res < 0) {
|
582
|
-
|
586
|
+
giterr_set(GITERR_OS, "could not get stat info for '%s'",
|
583
587
|
file->path_original);
|
584
588
|
return res;
|
585
589
|
}
|