rugged 1.3.2.3 → 1.4.2
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/ext/rugged/extconf.rb +1 -1
- data/ext/rugged/rugged_config.c +7 -2
- data/ext/rugged/rugged_remote.c +17 -0
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/CMakeLists.txt +103 -276
- data/vendor/libgit2/COPYING +36 -19
- 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 +5 -5
- 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 +8 -8
- 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 -100
- data/vendor/libgit2/cmake/SelectHashes.cmake +39 -49
- 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 +6 -6
- data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +31 -31
- data/vendor/libgit2/deps/ntlmclient/crypt_openssl.c +1 -1
- data/vendor/libgit2/deps/ntlmclient/ntlm.c +4 -4
- data/vendor/libgit2/deps/ntlmclient/ntlm.h +4 -4
- data/vendor/libgit2/deps/ntlmclient/ntlmclient.h +2 -2
- data/vendor/libgit2/deps/pcre/CMakeLists.txt +88 -88
- data/vendor/libgit2/deps/winhttp/CMakeLists.txt +14 -16
- data/vendor/libgit2/deps/zlib/adler32.c +0 -7
- data/vendor/libgit2/deps/zlib/crc32.c +288 -975
- data/vendor/libgit2/deps/zlib/crc32.h +436 -9441
- data/vendor/libgit2/deps/zlib/deflate.c +31 -83
- data/vendor/libgit2/deps/zlib/deflate.h +15 -12
- data/vendor/libgit2/deps/zlib/gzguts.h +2 -3
- data/vendor/libgit2/deps/zlib/infback.c +1 -2
- data/vendor/libgit2/deps/zlib/inffast.c +14 -14
- data/vendor/libgit2/deps/zlib/inflate.c +8 -39
- data/vendor/libgit2/deps/zlib/inflate.h +2 -3
- data/vendor/libgit2/deps/zlib/inftrees.c +3 -3
- data/vendor/libgit2/deps/zlib/trees.c +48 -27
- data/vendor/libgit2/deps/zlib/zlib.h +100 -126
- data/vendor/libgit2/deps/zlib/zutil.c +2 -2
- data/vendor/libgit2/deps/zlib/zutil.h +9 -12
- data/vendor/libgit2/include/git2/apply.h +16 -2
- data/vendor/libgit2/include/git2/attr.h +11 -2
- data/vendor/libgit2/include/git2/blame.h +4 -1
- data/vendor/libgit2/include/git2/blob.h +14 -1
- data/vendor/libgit2/include/git2/branch.h +2 -0
- data/vendor/libgit2/include/git2/buffer.h +18 -78
- data/vendor/libgit2/include/git2/cert.h +2 -2
- data/vendor/libgit2/include/git2/checkout.h +5 -2
- data/vendor/libgit2/include/git2/clone.h +3 -3
- data/vendor/libgit2/include/git2/commit.h +2 -0
- data/vendor/libgit2/include/git2/common.h +5 -12
- 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 +1 -1
- data/vendor/libgit2/include/git2/describe.h +7 -2
- data/vendor/libgit2/include/git2/diff.h +17 -9
- data/vendor/libgit2/include/git2/email.h +1 -1
- data/vendor/libgit2/include/git2/errors.h +1 -2
- data/vendor/libgit2/include/git2/filter.h +7 -2
- data/vendor/libgit2/include/git2/graph.h +1 -0
- data/vendor/libgit2/include/git2/ignore.h +1 -1
- data/vendor/libgit2/include/git2/index.h +11 -5
- 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/object.h +23 -0
- data/vendor/libgit2/include/git2/odb.h +37 -7
- data/vendor/libgit2/include/git2/odb_backend.h +1 -1
- data/vendor/libgit2/include/git2/pack.h +24 -8
- data/vendor/libgit2/include/git2/patch.h +8 -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 +9 -1
- 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 +2 -2
- data/vendor/libgit2/include/git2/remote.h +184 -37
- data/vendor/libgit2/include/git2/repository.h +14 -9
- data/vendor/libgit2/include/git2/reset.h +2 -2
- data/vendor/libgit2/include/git2/revparse.h +1 -1
- 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 +3 -3
- data/vendor/libgit2/include/git2/status.h +9 -3
- data/vendor/libgit2/include/git2/submodule.h +7 -2
- data/vendor/libgit2/include/git2/sys/commit_graph.h +1 -1
- data/vendor/libgit2/include/git2/sys/odb_backend.h +2 -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 +25 -34
- data/vendor/libgit2/include/git2/tag.h +1 -0
- data/vendor/libgit2/include/git2/tree.h +4 -3
- data/vendor/libgit2/include/git2/types.h +7 -7
- data/vendor/libgit2/include/git2/version.h +3 -3
- data/vendor/libgit2/include/git2/worktree.h +12 -2
- data/vendor/libgit2/src/CMakeLists.txt +189 -315
- data/vendor/libgit2/src/annotated_commit.h +1 -1
- data/vendor/libgit2/src/apply.c +18 -18
- data/vendor/libgit2/src/apply.h +2 -2
- data/vendor/libgit2/src/attr.c +18 -18
- data/vendor/libgit2/src/attr_file.c +17 -17
- data/vendor/libgit2/src/attr_file.h +4 -4
- data/vendor/libgit2/src/attrcache.c +17 -12
- data/vendor/libgit2/src/blame_git.c +1 -1
- data/vendor/libgit2/src/blob.c +33 -26
- data/vendor/libgit2/src/blob.h +1 -1
- data/vendor/libgit2/src/branch.c +150 -109
- 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/cc-compat.h +1 -1
- data/vendor/libgit2/src/checkout.c +74 -68
- data/vendor/libgit2/src/cherrypick.c +10 -10
- data/vendor/libgit2/src/clone.c +66 -66
- data/vendor/libgit2/src/commit.c +128 -58
- data/vendor/libgit2/src/commit.h +24 -1
- data/vendor/libgit2/src/commit_graph.c +68 -53
- data/vendor/libgit2/src/commit_graph.h +10 -3
- data/vendor/libgit2/src/commit_list.c +2 -3
- data/vendor/libgit2/src/common.h +10 -3
- data/vendor/libgit2/src/config.c +99 -77
- data/vendor/libgit2/src/config.h +15 -2
- data/vendor/libgit2/src/config_file.c +103 -91
- data/vendor/libgit2/src/config_mem.c +9 -9
- data/vendor/libgit2/src/config_parse.c +27 -23
- data/vendor/libgit2/src/crlf.c +24 -21
- data/vendor/libgit2/src/date.c +10 -17
- data/vendor/libgit2/src/date.h +33 -0
- data/vendor/libgit2/src/describe.c +27 -19
- data/vendor/libgit2/src/diff.c +25 -8
- data/vendor/libgit2/src/diff.h +2 -4
- data/vendor/libgit2/src/diff_driver.c +34 -36
- data/vendor/libgit2/src/diff_driver.h +3 -3
- data/vendor/libgit2/src/diff_file.c +29 -20
- data/vendor/libgit2/src/diff_generate.c +30 -6
- data/vendor/libgit2/src/diff_generate.h +5 -3
- data/vendor/libgit2/src/diff_print.c +102 -95
- data/vendor/libgit2/src/diff_stats.c +40 -29
- data/vendor/libgit2/src/{message.h → diff_stats.h} +7 -6
- data/vendor/libgit2/src/diff_tform.c +9 -8
- data/vendor/libgit2/src/diff_xdiff.c +3 -8
- data/vendor/libgit2/src/email.c +54 -38
- data/vendor/libgit2/src/email.h +1 -1
- data/vendor/libgit2/src/errors.c +18 -18
- data/vendor/libgit2/src/features.h.in +6 -1
- data/vendor/libgit2/src/fetch.c +69 -24
- data/vendor/libgit2/src/fetch.h +1 -1
- data/vendor/libgit2/src/fetchhead.c +19 -19
- data/vendor/libgit2/src/filebuf.c +28 -28
- data/vendor/libgit2/src/filebuf.h +1 -1
- data/vendor/libgit2/src/filter.c +96 -52
- data/vendor/libgit2/src/filter.h +26 -5
- data/vendor/libgit2/src/fs_path.c +1912 -0
- data/vendor/libgit2/src/fs_path.h +752 -0
- data/vendor/libgit2/src/futils.c +91 -85
- data/vendor/libgit2/src/futils.h +26 -14
- data/vendor/libgit2/src/hash/sha1/collisiondetect.c +2 -2
- data/vendor/libgit2/src/hash/sha1/common_crypto.c +2 -2
- data/vendor/libgit2/src/hash/sha1/generic.c +2 -2
- data/vendor/libgit2/src/hash/sha1/mbedtls.c +2 -2
- data/vendor/libgit2/src/hash/sha1/openssl.c +2 -2
- data/vendor/libgit2/src/hash/sha1/sha1dc/sha1.c +1 -1
- data/vendor/libgit2/src/hash/sha1/win32.c +6 -6
- data/vendor/libgit2/src/hash/sha1.h +3 -1
- data/vendor/libgit2/src/hash.c +67 -35
- data/vendor/libgit2/src/hash.h +12 -12
- data/vendor/libgit2/src/ident.c +18 -18
- data/vendor/libgit2/src/ignore.c +35 -34
- data/vendor/libgit2/src/ignore.h +2 -2
- data/vendor/libgit2/src/index.c +79 -80
- data/vendor/libgit2/src/index.h +6 -3
- data/vendor/libgit2/src/indexer.c +75 -57
- data/vendor/libgit2/src/iterator.c +64 -56
- data/vendor/libgit2/src/iterator.h +5 -5
- data/vendor/libgit2/src/khash.h +1 -1
- data/vendor/libgit2/src/libgit2.c +22 -19
- data/vendor/libgit2/src/mailmap.c +38 -36
- data/vendor/libgit2/src/merge.c +27 -27
- data/vendor/libgit2/src/merge.h +1 -14
- data/vendor/libgit2/src/merge_driver.c +2 -2
- data/vendor/libgit2/src/merge_file.c +13 -3
- data/vendor/libgit2/src/message.c +21 -10
- data/vendor/libgit2/src/midx.c +83 -66
- data/vendor/libgit2/src/midx.h +3 -3
- data/vendor/libgit2/src/mwindow.c +1 -1
- data/vendor/libgit2/src/net.c +278 -68
- data/vendor/libgit2/src/net.h +10 -3
- data/vendor/libgit2/src/netops.c +1 -1
- data/vendor/libgit2/src/netops.h +1 -1
- data/vendor/libgit2/src/notes.c +20 -29
- data/vendor/libgit2/src/object.c +49 -9
- data/vendor/libgit2/src/object.h +1 -1
- data/vendor/libgit2/src/odb.c +35 -32
- data/vendor/libgit2/src/odb.h +1 -1
- data/vendor/libgit2/src/odb_loose.c +68 -68
- data/vendor/libgit2/src/odb_mempack.c +18 -5
- data/vendor/libgit2/src/odb_pack.c +43 -43
- data/vendor/libgit2/src/oid.c +11 -4
- data/vendor/libgit2/src/oid.h +15 -0
- data/vendor/libgit2/src/pack-objects.c +41 -26
- data/vendor/libgit2/src/pack-objects.h +11 -6
- data/vendor/libgit2/src/pack.c +10 -10
- data/vendor/libgit2/src/patch.c +3 -3
- data/vendor/libgit2/src/patch.h +1 -0
- data/vendor/libgit2/src/patch_generate.c +27 -11
- data/vendor/libgit2/src/patch_generate.h +5 -5
- data/vendor/libgit2/src/patch_parse.c +24 -24
- data/vendor/libgit2/src/path.c +76 -1951
- data/vendor/libgit2/src/path.h +34 -741
- data/vendor/libgit2/src/pathspec.c +6 -6
- data/vendor/libgit2/src/pathspec.h +2 -2
- data/vendor/libgit2/src/posix.c +3 -3
- 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 +8 -8
- data/vendor/libgit2/src/reader.h +2 -2
- data/vendor/libgit2/src/rebase.c +89 -88
- data/vendor/libgit2/src/refdb_fs.c +447 -173
- data/vendor/libgit2/src/refs.c +32 -32
- data/vendor/libgit2/src/refs.h +2 -2
- data/vendor/libgit2/src/refspec.c +32 -37
- data/vendor/libgit2/src/refspec.h +5 -2
- data/vendor/libgit2/src/regexp.c +1 -1
- data/vendor/libgit2/src/remote.c +713 -419
- data/vendor/libgit2/src/remote.h +15 -10
- data/vendor/libgit2/src/repository.c +350 -467
- data/vendor/libgit2/src/repository.h +11 -10
- data/vendor/libgit2/src/reset.c +8 -5
- data/vendor/libgit2/src/revert.c +10 -10
- data/vendor/libgit2/src/revparse.c +48 -35
- data/vendor/libgit2/src/revwalk.c +7 -7
- data/vendor/libgit2/src/signature.c +12 -6
- data/vendor/libgit2/src/signature.h +1 -1
- data/vendor/libgit2/src/sortedcache.c +1 -1
- data/vendor/libgit2/src/sortedcache.h +1 -1
- data/vendor/libgit2/src/stash.c +36 -37
- data/vendor/libgit2/src/status.c +4 -1
- data/vendor/libgit2/src/{buffer.c → str.c} +157 -151
- data/vendor/libgit2/src/str.h +357 -0
- data/vendor/libgit2/src/streams/mbedtls.c +8 -6
- data/vendor/libgit2/src/streams/openssl_dynamic.h +3 -3
- data/vendor/libgit2/src/submodule.c +171 -159
- data/vendor/libgit2/src/submodule.h +1 -1
- data/vendor/libgit2/src/sysdir.c +68 -52
- data/vendor/libgit2/src/sysdir.h +15 -10
- data/vendor/libgit2/src/tag.c +29 -27
- data/vendor/libgit2/src/thread.h +3 -3
- data/vendor/libgit2/src/threadstate.c +3 -3
- data/vendor/libgit2/src/threadstate.h +1 -1
- data/vendor/libgit2/src/trace.c +1 -14
- data/vendor/libgit2/src/trace.h +5 -22
- data/vendor/libgit2/src/trailer.c +1 -1
- data/vendor/libgit2/src/transaction.c +1 -1
- data/vendor/libgit2/src/transport.c +10 -10
- data/vendor/libgit2/src/transports/auth.c +7 -9
- data/vendor/libgit2/src/transports/auth.h +2 -3
- data/vendor/libgit2/src/transports/auth_negotiate.c +12 -13
- data/vendor/libgit2/src/transports/auth_ntlm.c +10 -10
- data/vendor/libgit2/src/transports/auth_ntlm.h +0 -1
- data/vendor/libgit2/src/transports/git.c +9 -11
- data/vendor/libgit2/src/transports/http.c +37 -17
- data/vendor/libgit2/src/transports/http.h +2 -3
- data/vendor/libgit2/src/transports/httpclient.c +65 -65
- data/vendor/libgit2/src/transports/local.c +124 -116
- data/vendor/libgit2/src/transports/smart.c +51 -139
- data/vendor/libgit2/src/transports/smart.h +25 -31
- data/vendor/libgit2/src/transports/smart_pkt.c +33 -33
- data/vendor/libgit2/src/transports/smart_protocol.c +57 -39
- data/vendor/libgit2/src/transports/ssh.c +47 -112
- data/vendor/libgit2/src/transports/winhttp.c +50 -56
- data/vendor/libgit2/src/tree-cache.c +5 -5
- data/vendor/libgit2/src/tree-cache.h +2 -2
- data/vendor/libgit2/src/tree.c +59 -48
- data/vendor/libgit2/src/tree.h +1 -1
- data/vendor/libgit2/src/unix/map.c +0 -2
- data/vendor/libgit2/src/unix/posix.h +1 -4
- data/vendor/libgit2/src/unix/realpath.c +0 -2
- data/vendor/libgit2/src/util.c +14 -14
- data/vendor/libgit2/src/util.h +2 -28
- data/vendor/libgit2/src/vector.h +1 -1
- data/vendor/libgit2/src/win32/findfile.c +172 -116
- data/vendor/libgit2/src/win32/findfile.h +7 -4
- data/vendor/libgit2/src/win32/path_w32.c +140 -9
- data/vendor/libgit2/src/win32/path_w32.h +2 -0
- data/vendor/libgit2/src/win32/posix.h +0 -1
- data/vendor/libgit2/src/win32/posix_w32.c +11 -27
- data/vendor/libgit2/src/win32/w32_buffer.c +2 -3
- data/vendor/libgit2/src/win32/w32_buffer.h +2 -3
- data/vendor/libgit2/src/win32/w32_leakcheck.c +1 -1
- data/vendor/libgit2/src/worktree.c +116 -94
- 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 +5 -5
- data/vendor/libgit2/src/zstream.h +4 -4
- metadata +25 -10
- data/vendor/libgit2/src/buffer.h +0 -374
|
@@ -278,7 +278,7 @@ int git_hash_sha1_update(git_hash_sha1_ctx *ctx, const void *data, size_t len)
|
|
|
278
278
|
return 0;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
int git_hash_sha1_final(
|
|
281
|
+
int git_hash_sha1_final(unsigned char *out, git_hash_sha1_ctx *ctx)
|
|
282
282
|
{
|
|
283
283
|
static const unsigned char pad[64] = { 0x80 };
|
|
284
284
|
unsigned int padlen[2];
|
|
@@ -294,7 +294,7 @@ int git_hash_sha1_final(git_oid *out, git_hash_sha1_ctx *ctx)
|
|
|
294
294
|
|
|
295
295
|
/* Output hash */
|
|
296
296
|
for (i = 0; i < 5; i++)
|
|
297
|
-
put_be32(out
|
|
297
|
+
put_be32(out + i*4, ctx->H[i]);
|
|
298
298
|
|
|
299
299
|
return 0;
|
|
300
300
|
}
|
|
@@ -38,9 +38,9 @@ int git_hash_sha1_update(git_hash_sha1_ctx *ctx, const void *data, size_t len)
|
|
|
38
38
|
return 0;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
int git_hash_sha1_final(
|
|
41
|
+
int git_hash_sha1_final(unsigned char *out, git_hash_sha1_ctx *ctx)
|
|
42
42
|
{
|
|
43
43
|
GIT_ASSERT_ARG(ctx);
|
|
44
|
-
mbedtls_sha1_finish(&ctx->c, out
|
|
44
|
+
mbedtls_sha1_finish(&ctx->c, out);
|
|
45
45
|
return 0;
|
|
46
46
|
}
|
|
@@ -46,11 +46,11 @@ int git_hash_sha1_update(git_hash_sha1_ctx *ctx, const void *data, size_t len)
|
|
|
46
46
|
return 0;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
int git_hash_sha1_final(
|
|
49
|
+
int git_hash_sha1_final(unsigned char *out, git_hash_sha1_ctx *ctx)
|
|
50
50
|
{
|
|
51
51
|
GIT_ASSERT_ARG(ctx);
|
|
52
52
|
|
|
53
|
-
if (SHA1_Final(out
|
|
53
|
+
if (SHA1_Final(out, &ctx->c) != 1) {
|
|
54
54
|
git_error_set(GIT_ERROR_SHA1, "hash_openssl: failed to finalize hash");
|
|
55
55
|
return -1;
|
|
56
56
|
}
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
/* Not under GCC-alike or glibc */
|
|
71
71
|
#elif defined(_BYTE_ORDER) && defined(_BIG_ENDIAN) && defined(_LITTLE_ENDIAN)
|
|
72
72
|
/*
|
|
73
|
-
* *BSD and newlib (
|
|
73
|
+
* *BSD and newlib (embedded linux, cygwin, etc).
|
|
74
74
|
* the defined(_BIG_ENDIAN) && defined(_LITTLE_ENDIAN) part prevents
|
|
75
75
|
* this condition from matching with Solaris/sparc.
|
|
76
76
|
* (Solaris defines only one endian macro)
|
|
@@ -181,14 +181,14 @@ GIT_INLINE(int) hash_cryptoapi_update(git_hash_sha1_ctx *ctx, const void *_data,
|
|
|
181
181
|
return 0;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
GIT_INLINE(int) hash_cryptoapi_final(
|
|
184
|
+
GIT_INLINE(int) hash_cryptoapi_final(unsigned char *out, git_hash_sha1_ctx *ctx)
|
|
185
185
|
{
|
|
186
|
-
DWORD len =
|
|
186
|
+
DWORD len = GIT_HASH_SHA1_SIZE;
|
|
187
187
|
int error = 0;
|
|
188
188
|
|
|
189
189
|
GIT_ASSERT(ctx->ctx.cryptoapi.valid);
|
|
190
190
|
|
|
191
|
-
if (!CryptGetHashParam(ctx->ctx.cryptoapi.hash_handle, HP_HASHVAL, out
|
|
191
|
+
if (!CryptGetHashParam(ctx->ctx.cryptoapi.hash_handle, HP_HASHVAL, out, &len, 0)) {
|
|
192
192
|
git_error_set(GIT_ERROR_OS, "legacy hash data could not be finished");
|
|
193
193
|
error = -1;
|
|
194
194
|
}
|
|
@@ -262,9 +262,9 @@ GIT_INLINE(int) hash_cng_update(git_hash_sha1_ctx *ctx, const void *_data, size_
|
|
|
262
262
|
return 0;
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
GIT_INLINE(int) hash_cng_final(
|
|
265
|
+
GIT_INLINE(int) hash_cng_final(unsigned char *out, git_hash_sha1_ctx *ctx)
|
|
266
266
|
{
|
|
267
|
-
if (ctx->prov->prov.cng.finish_hash(ctx->ctx.cng.hash_handle, out
|
|
267
|
+
if (ctx->prov->prov.cng.finish_hash(ctx->ctx.cng.hash_handle, out, GIT_HASH_SHA1_SIZE, 0) < 0) {
|
|
268
268
|
git_error_set(GIT_ERROR_OS, "hash could not be finished");
|
|
269
269
|
return -1;
|
|
270
270
|
}
|
|
@@ -315,7 +315,7 @@ int git_hash_sha1_update(git_hash_sha1_ctx *ctx, const void *data, size_t len)
|
|
|
315
315
|
return (ctx->type == CNG) ? hash_cng_update(ctx, data, len) : hash_cryptoapi_update(ctx, data, len);
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
-
int git_hash_sha1_final(
|
|
318
|
+
int git_hash_sha1_final(unsigned char *out, git_hash_sha1_ctx *ctx)
|
|
319
319
|
{
|
|
320
320
|
GIT_ASSERT_ARG(ctx);
|
|
321
321
|
GIT_ASSERT_ARG(ctx->type);
|
|
@@ -26,6 +26,8 @@ typedef struct git_hash_sha1_ctx git_hash_sha1_ctx;
|
|
|
26
26
|
# include "sha1/generic.h"
|
|
27
27
|
#endif
|
|
28
28
|
|
|
29
|
+
#define GIT_HASH_SHA1_SIZE 20
|
|
30
|
+
|
|
29
31
|
int git_hash_sha1_global_init(void);
|
|
30
32
|
|
|
31
33
|
int git_hash_sha1_ctx_init(git_hash_sha1_ctx *ctx);
|
|
@@ -33,6 +35,6 @@ void git_hash_sha1_ctx_cleanup(git_hash_sha1_ctx *ctx);
|
|
|
33
35
|
|
|
34
36
|
int git_hash_sha1_init(git_hash_sha1_ctx *c);
|
|
35
37
|
int git_hash_sha1_update(git_hash_sha1_ctx *c, const void *data, size_t len);
|
|
36
|
-
int git_hash_sha1_final(
|
|
38
|
+
int git_hash_sha1_final(unsigned char *out, git_hash_sha1_ctx *c);
|
|
37
39
|
|
|
38
40
|
#endif
|
data/vendor/libgit2/src/hash.c
CHANGED
|
@@ -12,71 +12,83 @@ int git_hash_global_init(void)
|
|
|
12
12
|
return git_hash_sha1_global_init();
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
int git_hash_ctx_init(git_hash_ctx *ctx)
|
|
15
|
+
int git_hash_ctx_init(git_hash_ctx *ctx, git_hash_algorithm_t algorithm)
|
|
16
16
|
{
|
|
17
17
|
int error;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
switch (algorithm) {
|
|
20
|
+
case GIT_HASH_ALGORITHM_SHA1:
|
|
21
|
+
error = git_hash_sha1_ctx_init(&ctx->ctx.sha1);
|
|
22
|
+
break;
|
|
23
|
+
default:
|
|
24
|
+
git_error_set(GIT_ERROR_INTERNAL, "unknown hash algorithm");
|
|
25
|
+
error = -1;
|
|
26
|
+
}
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
ctx->algorithm = algorithm;
|
|
29
|
+
return error;
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
void git_hash_ctx_cleanup(git_hash_ctx *ctx)
|
|
28
33
|
{
|
|
29
|
-
switch (ctx->
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
switch (ctx->algorithm) {
|
|
35
|
+
case GIT_HASH_ALGORITHM_SHA1:
|
|
36
|
+
git_hash_sha1_ctx_cleanup(&ctx->ctx.sha1);
|
|
37
|
+
return;
|
|
38
|
+
default:
|
|
39
|
+
/* unreachable */ ;
|
|
35
40
|
}
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
int git_hash_init(git_hash_ctx *ctx)
|
|
39
44
|
{
|
|
40
|
-
switch (ctx->
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
switch (ctx->algorithm) {
|
|
46
|
+
case GIT_HASH_ALGORITHM_SHA1:
|
|
47
|
+
return git_hash_sha1_init(&ctx->ctx.sha1);
|
|
48
|
+
default:
|
|
49
|
+
/* unreachable */ ;
|
|
45
50
|
}
|
|
46
|
-
|
|
51
|
+
|
|
52
|
+
git_error_set(GIT_ERROR_INTERNAL, "unknown hash algorithm");
|
|
47
53
|
return -1;
|
|
48
54
|
}
|
|
49
55
|
|
|
50
56
|
int git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
|
|
51
57
|
{
|
|
52
|
-
switch (ctx->
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
switch (ctx->algorithm) {
|
|
59
|
+
case GIT_HASH_ALGORITHM_SHA1:
|
|
60
|
+
return git_hash_sha1_update(&ctx->ctx.sha1, data, len);
|
|
61
|
+
default:
|
|
62
|
+
/* unreachable */ ;
|
|
57
63
|
}
|
|
58
|
-
|
|
64
|
+
|
|
65
|
+
git_error_set(GIT_ERROR_INTERNAL, "unknown hash algorithm");
|
|
59
66
|
return -1;
|
|
60
67
|
}
|
|
61
68
|
|
|
62
|
-
int git_hash_final(
|
|
69
|
+
int git_hash_final(unsigned char *out, git_hash_ctx *ctx)
|
|
63
70
|
{
|
|
64
|
-
switch (ctx->
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
switch (ctx->algorithm) {
|
|
72
|
+
case GIT_HASH_ALGORITHM_SHA1:
|
|
73
|
+
return git_hash_sha1_final(out, &ctx->ctx.sha1);
|
|
74
|
+
default:
|
|
75
|
+
/* unreachable */ ;
|
|
69
76
|
}
|
|
70
|
-
|
|
77
|
+
|
|
78
|
+
git_error_set(GIT_ERROR_INTERNAL, "unknown hash algorithm");
|
|
71
79
|
return -1;
|
|
72
80
|
}
|
|
73
81
|
|
|
74
|
-
int git_hash_buf(
|
|
82
|
+
int git_hash_buf(
|
|
83
|
+
unsigned char *out,
|
|
84
|
+
const void *data,
|
|
85
|
+
size_t len,
|
|
86
|
+
git_hash_algorithm_t algorithm)
|
|
75
87
|
{
|
|
76
88
|
git_hash_ctx ctx;
|
|
77
89
|
int error = 0;
|
|
78
90
|
|
|
79
|
-
if (git_hash_ctx_init(&ctx) < 0)
|
|
91
|
+
if (git_hash_ctx_init(&ctx, algorithm) < 0)
|
|
80
92
|
return -1;
|
|
81
93
|
|
|
82
94
|
if ((error = git_hash_update(&ctx, data, len)) >= 0)
|
|
@@ -87,13 +99,17 @@ int git_hash_buf(git_oid *out, const void *data, size_t len)
|
|
|
87
99
|
return error;
|
|
88
100
|
}
|
|
89
101
|
|
|
90
|
-
int git_hash_vec(
|
|
102
|
+
int git_hash_vec(
|
|
103
|
+
unsigned char *out,
|
|
104
|
+
git_str_vec *vec,
|
|
105
|
+
size_t n,
|
|
106
|
+
git_hash_algorithm_t algorithm)
|
|
91
107
|
{
|
|
92
108
|
git_hash_ctx ctx;
|
|
93
109
|
size_t i;
|
|
94
110
|
int error = 0;
|
|
95
111
|
|
|
96
|
-
if (git_hash_ctx_init(&ctx) < 0)
|
|
112
|
+
if (git_hash_ctx_init(&ctx, algorithm) < 0)
|
|
97
113
|
return -1;
|
|
98
114
|
|
|
99
115
|
for (i = 0; i < n; i++) {
|
|
@@ -108,3 +124,19 @@ done:
|
|
|
108
124
|
|
|
109
125
|
return error;
|
|
110
126
|
}
|
|
127
|
+
|
|
128
|
+
int git_hash_fmt(char *out, unsigned char *hash, size_t hash_len)
|
|
129
|
+
{
|
|
130
|
+
static char hex[] = "0123456789abcdef";
|
|
131
|
+
char *str = out;
|
|
132
|
+
size_t i;
|
|
133
|
+
|
|
134
|
+
for (i = 0; i < hash_len; i++) {
|
|
135
|
+
*str++ = hex[hash[i] >> 4];
|
|
136
|
+
*str++ = hex[hash[i] & 0x0f];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
*str++ = '\0';
|
|
140
|
+
|
|
141
|
+
return 0;
|
|
142
|
+
}
|
data/vendor/libgit2/src/hash.h
CHANGED
|
@@ -10,37 +10,37 @@
|
|
|
10
10
|
|
|
11
11
|
#include "common.h"
|
|
12
12
|
|
|
13
|
-
#include "
|
|
13
|
+
#include "hash/sha1.h"
|
|
14
14
|
|
|
15
15
|
typedef struct {
|
|
16
16
|
void *data;
|
|
17
17
|
size_t len;
|
|
18
|
-
}
|
|
18
|
+
} git_str_vec;
|
|
19
19
|
|
|
20
20
|
typedef enum {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
#include "hash/sha1.h"
|
|
21
|
+
GIT_HASH_ALGORITHM_NONE = 0,
|
|
22
|
+
GIT_HASH_ALGORITHM_SHA1
|
|
23
|
+
} git_hash_algorithm_t;
|
|
26
24
|
|
|
27
25
|
typedef struct git_hash_ctx {
|
|
28
26
|
union {
|
|
29
27
|
git_hash_sha1_ctx sha1;
|
|
30
28
|
} ctx;
|
|
31
|
-
|
|
29
|
+
git_hash_algorithm_t algorithm;
|
|
32
30
|
} git_hash_ctx;
|
|
33
31
|
|
|
34
32
|
int git_hash_global_init(void);
|
|
35
33
|
|
|
36
|
-
int git_hash_ctx_init(git_hash_ctx *ctx);
|
|
34
|
+
int git_hash_ctx_init(git_hash_ctx *ctx, git_hash_algorithm_t algorithm);
|
|
37
35
|
void git_hash_ctx_cleanup(git_hash_ctx *ctx);
|
|
38
36
|
|
|
39
37
|
int git_hash_init(git_hash_ctx *c);
|
|
40
38
|
int git_hash_update(git_hash_ctx *c, const void *data, size_t len);
|
|
41
|
-
int git_hash_final(
|
|
39
|
+
int git_hash_final(unsigned char *out, git_hash_ctx *c);
|
|
40
|
+
|
|
41
|
+
int git_hash_buf(unsigned char *out, const void *data, size_t len, git_hash_algorithm_t algorithm);
|
|
42
|
+
int git_hash_vec(unsigned char *out, git_str_vec *vec, size_t n, git_hash_algorithm_t algorithm);
|
|
42
43
|
|
|
43
|
-
int
|
|
44
|
-
int git_hash_vec(git_oid *out, git_buf_vec *vec, size_t n);
|
|
44
|
+
int git_hash_fmt(char *out, unsigned char *hash, size_t hash_len);
|
|
45
45
|
|
|
46
46
|
#endif
|
data/vendor/libgit2/src/ident.c
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
#include "git2/sys/filter.h"
|
|
11
11
|
#include "filter.h"
|
|
12
|
-
#include "
|
|
12
|
+
#include "str.h"
|
|
13
13
|
|
|
14
14
|
static int ident_find_id(
|
|
15
15
|
const char **id_start, const char **id_end, const char *start, size_t len)
|
|
@@ -40,7 +40,7 @@ static int ident_find_id(
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
static int ident_insert_id(
|
|
43
|
-
|
|
43
|
+
git_str *to, const git_str *from, const git_filter_source *src)
|
|
44
44
|
{
|
|
45
45
|
char oid[GIT_OID_HEXSZ+1];
|
|
46
46
|
const char *id_start, *id_end, *from_end = from->ptr + from->size;
|
|
@@ -60,20 +60,20 @@ static int ident_insert_id(
|
|
|
60
60
|
5 /* "$Id: " */ + GIT_OID_HEXSZ + 2 /* " $" */ +
|
|
61
61
|
(size_t)(from_end - id_end);
|
|
62
62
|
|
|
63
|
-
if (
|
|
63
|
+
if (git_str_grow(to, need_size) < 0)
|
|
64
64
|
return -1;
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
git_str_set(to, from->ptr, (size_t)(id_start - from->ptr));
|
|
67
|
+
git_str_put(to, "$Id: ", 5);
|
|
68
|
+
git_str_put(to, oid, GIT_OID_HEXSZ);
|
|
69
|
+
git_str_put(to, " $", 2);
|
|
70
|
+
git_str_put(to, id_end, (size_t)(from_end - id_end));
|
|
71
71
|
|
|
72
|
-
return
|
|
72
|
+
return git_str_oom(to) ? -1 : 0;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
static int ident_remove_id(
|
|
76
|
-
|
|
76
|
+
git_str *to, const git_str *from)
|
|
77
77
|
{
|
|
78
78
|
const char *id_start, *id_end, *from_end = from->ptr + from->size;
|
|
79
79
|
size_t need_size;
|
|
@@ -84,27 +84,27 @@ static int ident_remove_id(
|
|
|
84
84
|
need_size = (size_t)(id_start - from->ptr) +
|
|
85
85
|
4 /* "$Id$" */ + (size_t)(from_end - id_end);
|
|
86
86
|
|
|
87
|
-
if (
|
|
87
|
+
if (git_str_grow(to, need_size) < 0)
|
|
88
88
|
return -1;
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
git_str_set(to, from->ptr, (size_t)(id_start - from->ptr));
|
|
91
|
+
git_str_put(to, "$Id$", 4);
|
|
92
|
+
git_str_put(to, id_end, (size_t)(from_end - id_end));
|
|
93
93
|
|
|
94
|
-
return
|
|
94
|
+
return git_str_oom(to) ? -1 : 0;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
static int ident_apply(
|
|
98
98
|
git_filter *self,
|
|
99
99
|
void **payload,
|
|
100
|
-
|
|
101
|
-
const
|
|
100
|
+
git_str *to,
|
|
101
|
+
const git_str *from,
|
|
102
102
|
const git_filter_source *src)
|
|
103
103
|
{
|
|
104
104
|
GIT_UNUSED(self); GIT_UNUSED(payload);
|
|
105
105
|
|
|
106
106
|
/* Don't filter binary files */
|
|
107
|
-
if (
|
|
107
|
+
if (git_str_is_binary(from))
|
|
108
108
|
return GIT_PASSTHROUGH;
|
|
109
109
|
|
|
110
110
|
if (git_filter_source_mode(src) == GIT_FILTER_SMUDGE)
|
data/vendor/libgit2/src/ignore.c
CHANGED
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
#include "git2/ignore.h"
|
|
11
11
|
#include "common.h"
|
|
12
12
|
#include "attrcache.h"
|
|
13
|
-
#include "
|
|
13
|
+
#include "fs_path.h"
|
|
14
14
|
#include "config.h"
|
|
15
15
|
#include "wildmatch.h"
|
|
16
|
+
#include "path.h"
|
|
16
17
|
|
|
17
18
|
#define GIT_IGNORE_INTERNAL "[internal]exclude"
|
|
18
19
|
|
|
@@ -105,7 +106,7 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
|
|
|
105
106
|
size_t i;
|
|
106
107
|
git_attr_fnmatch *rule;
|
|
107
108
|
char *path;
|
|
108
|
-
|
|
109
|
+
git_str buf = GIT_STR_INIT;
|
|
109
110
|
|
|
110
111
|
*out = 0;
|
|
111
112
|
|
|
@@ -115,12 +116,12 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
|
|
|
115
116
|
|
|
116
117
|
/* path of the file relative to the workdir, so we match the rules in subdirs */
|
|
117
118
|
if (match->containing_dir) {
|
|
118
|
-
|
|
119
|
+
git_str_puts(&buf, match->containing_dir);
|
|
119
120
|
}
|
|
120
|
-
if (
|
|
121
|
+
if (git_str_puts(&buf, match->pattern) < 0)
|
|
121
122
|
return -1;
|
|
122
123
|
|
|
123
|
-
path =
|
|
124
|
+
path = git_str_detach(&buf);
|
|
124
125
|
|
|
125
126
|
git_vector_foreach(rules, i, rule) {
|
|
126
127
|
if (!(rule->flags & GIT_ATTR_FNMATCH_HASWILD)) {
|
|
@@ -133,12 +134,12 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
|
|
|
133
134
|
continue;
|
|
134
135
|
}
|
|
135
136
|
|
|
136
|
-
|
|
137
|
+
git_str_clear(&buf);
|
|
137
138
|
if (rule->containing_dir)
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
git_str_puts(&buf, rule->containing_dir);
|
|
140
|
+
git_str_puts(&buf, rule->pattern);
|
|
140
141
|
|
|
141
|
-
if (
|
|
142
|
+
if (git_str_oom(&buf))
|
|
142
143
|
goto out;
|
|
143
144
|
|
|
144
145
|
/*
|
|
@@ -151,7 +152,7 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
|
|
|
151
152
|
effective_flags &= ~WM_PATHNAME;
|
|
152
153
|
|
|
153
154
|
/* if we found a match, we want to keep this rule */
|
|
154
|
-
if ((wildmatch(
|
|
155
|
+
if ((wildmatch(git_str_cstr(&buf), path, effective_flags)) == WM_MATCH) {
|
|
155
156
|
*out = 1;
|
|
156
157
|
error = 0;
|
|
157
158
|
goto out;
|
|
@@ -162,7 +163,7 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
|
|
|
162
163
|
|
|
163
164
|
out:
|
|
164
165
|
git__free(path);
|
|
165
|
-
|
|
166
|
+
git_str_dispose(&buf);
|
|
166
167
|
return error;
|
|
167
168
|
}
|
|
168
169
|
|
|
@@ -181,7 +182,7 @@ static int parse_ignore_file(
|
|
|
181
182
|
|
|
182
183
|
/* if subdir file path, convert context for file paths */
|
|
183
184
|
if (attrs->entry &&
|
|
184
|
-
|
|
185
|
+
git_fs_path_root(attrs->entry->path) < 0 &&
|
|
185
186
|
!git__suffixcmp(attrs->entry->path, "/" GIT_IGNORE_FILE))
|
|
186
187
|
context = attrs->entry->path;
|
|
187
188
|
|
|
@@ -295,7 +296,7 @@ int git_ignore__for_path(
|
|
|
295
296
|
{
|
|
296
297
|
int error = 0;
|
|
297
298
|
const char *workdir = git_repository_workdir(repo);
|
|
298
|
-
|
|
299
|
+
git_str infopath = GIT_STR_INIT;
|
|
299
300
|
|
|
300
301
|
GIT_ASSERT_ARG(repo);
|
|
301
302
|
GIT_ASSERT_ARG(ignores);
|
|
@@ -313,21 +314,21 @@ int git_ignore__for_path(
|
|
|
313
314
|
goto cleanup;
|
|
314
315
|
|
|
315
316
|
/* given a unrooted path in a non-bare repo, resolve it */
|
|
316
|
-
if (workdir &&
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
if ((error =
|
|
320
|
-
(error =
|
|
321
|
-
(error =
|
|
322
|
-
(error =
|
|
323
|
-
(error =
|
|
317
|
+
if (workdir && git_fs_path_root(path) < 0) {
|
|
318
|
+
git_str local = GIT_STR_INIT;
|
|
319
|
+
|
|
320
|
+
if ((error = git_fs_path_dirname_r(&local, path)) < 0 ||
|
|
321
|
+
(error = git_fs_path_resolve_relative(&local, 0)) < 0 ||
|
|
322
|
+
(error = git_fs_path_to_dir(&local)) < 0 ||
|
|
323
|
+
(error = git_str_joinpath(&ignores->dir, workdir, local.ptr)) < 0 ||
|
|
324
|
+
(error = git_path_validate_str_length(repo, &ignores->dir)) < 0) {
|
|
324
325
|
/* Nothing, we just want to stop on the first error */
|
|
325
326
|
}
|
|
326
327
|
|
|
327
|
-
|
|
328
|
+
git_str_dispose(&local);
|
|
328
329
|
} else {
|
|
329
|
-
if (!(error =
|
|
330
|
-
error =
|
|
330
|
+
if (!(error = git_str_joinpath(&ignores->dir, path, "")))
|
|
331
|
+
error = git_path_validate_str_length(NULL, &ignores->dir);
|
|
331
332
|
}
|
|
332
333
|
|
|
333
334
|
if (error < 0)
|
|
@@ -342,14 +343,14 @@ int git_ignore__for_path(
|
|
|
342
343
|
|
|
343
344
|
/* load .gitignore up the path */
|
|
344
345
|
if (workdir != NULL) {
|
|
345
|
-
error =
|
|
346
|
+
error = git_fs_path_walk_up(
|
|
346
347
|
&ignores->dir, workdir, push_one_ignore, ignores);
|
|
347
348
|
if (error < 0)
|
|
348
349
|
goto cleanup;
|
|
349
350
|
}
|
|
350
351
|
|
|
351
352
|
/* load .git/info/exclude if possible */
|
|
352
|
-
if ((error =
|
|
353
|
+
if ((error = git_repository__item_path(&infopath, repo, GIT_REPOSITORY_ITEM_INFO)) < 0 ||
|
|
353
354
|
(error = push_ignore_file(ignores, &ignores->ign_global, infopath.ptr, GIT_IGNORE_FILE_INREPO)) < 0) {
|
|
354
355
|
if (error != GIT_ENOTFOUND)
|
|
355
356
|
goto cleanup;
|
|
@@ -363,7 +364,7 @@ int git_ignore__for_path(
|
|
|
363
364
|
git_repository_attr_cache(repo)->cfg_excl_file);
|
|
364
365
|
|
|
365
366
|
cleanup:
|
|
366
|
-
|
|
367
|
+
git_str_dispose(&infopath);
|
|
367
368
|
if (error < 0)
|
|
368
369
|
git_ignore__free(ignores);
|
|
369
370
|
|
|
@@ -372,7 +373,7 @@ cleanup:
|
|
|
372
373
|
|
|
373
374
|
int git_ignore__push_dir(git_ignores *ign, const char *dir)
|
|
374
375
|
{
|
|
375
|
-
if (
|
|
376
|
+
if (git_str_joinpath(&ign->dir, ign->dir.ptr, dir) < 0)
|
|
376
377
|
return -1;
|
|
377
378
|
|
|
378
379
|
ign->depth++;
|
|
@@ -409,8 +410,8 @@ int git_ignore__pop_dir(git_ignores *ign)
|
|
|
409
410
|
}
|
|
410
411
|
|
|
411
412
|
if (--ign->depth > 0) {
|
|
412
|
-
|
|
413
|
-
|
|
413
|
+
git_str_rtruncate_at_char(&ign->dir, '/');
|
|
414
|
+
git_fs_path_to_dir(&ign->dir);
|
|
414
415
|
}
|
|
415
416
|
|
|
416
417
|
return 0;
|
|
@@ -435,7 +436,7 @@ void git_ignore__free(git_ignores *ignores)
|
|
|
435
436
|
}
|
|
436
437
|
git_vector_free(&ignores->ign_global);
|
|
437
438
|
|
|
438
|
-
|
|
439
|
+
git_str_dispose(&ignores->dir);
|
|
439
440
|
}
|
|
440
441
|
|
|
441
442
|
static bool ignore_lookup_in_rules(
|
|
@@ -604,7 +605,7 @@ int git_ignore__check_pathspec_for_exact_ignores(
|
|
|
604
605
|
size_t i;
|
|
605
606
|
git_attr_fnmatch *match;
|
|
606
607
|
int ignored;
|
|
607
|
-
|
|
608
|
+
git_str path = GIT_STR_INIT;
|
|
608
609
|
const char *filename;
|
|
609
610
|
git_index *idx;
|
|
610
611
|
|
|
@@ -629,7 +630,7 @@ int git_ignore__check_pathspec_for_exact_ignores(
|
|
|
629
630
|
break;
|
|
630
631
|
|
|
631
632
|
/* is there a file on disk that matches this exactly? */
|
|
632
|
-
if (!
|
|
633
|
+
if (!git_fs_path_isfile(path.ptr))
|
|
633
634
|
continue;
|
|
634
635
|
|
|
635
636
|
/* is that file ignored? */
|
|
@@ -645,7 +646,7 @@ int git_ignore__check_pathspec_for_exact_ignores(
|
|
|
645
646
|
}
|
|
646
647
|
|
|
647
648
|
git_index_free(idx);
|
|
648
|
-
|
|
649
|
+
git_str_dispose(&path);
|
|
649
650
|
|
|
650
651
|
return error;
|
|
651
652
|
}
|
data/vendor/libgit2/src/ignore.h
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
*/
|
|
27
27
|
typedef struct {
|
|
28
28
|
git_repository *repo;
|
|
29
|
-
|
|
29
|
+
git_str dir; /* current directory reflected in ign_path */
|
|
30
30
|
git_attr_file *ign_internal;
|
|
31
31
|
git_vector ign_path;
|
|
32
32
|
git_vector ign_global;
|
|
@@ -48,7 +48,7 @@ enum {
|
|
|
48
48
|
GIT_IGNORE_UNCHECKED = -2,
|
|
49
49
|
GIT_IGNORE_NOTFOUND = -1,
|
|
50
50
|
GIT_IGNORE_FALSE = 0,
|
|
51
|
-
GIT_IGNORE_TRUE = 1
|
|
51
|
+
GIT_IGNORE_TRUE = 1
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
extern int git_ignore__lookup(int *out, git_ignores *ign, const char *path, git_dir_flag dir_flag);
|