rugged 1.3.2.3 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/vendor/libgit2/src/notes.c
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
#include "notes.h"
|
9
9
|
|
10
|
-
#include "
|
10
|
+
#include "buf.h"
|
11
11
|
#include "refs.h"
|
12
12
|
#include "config.h"
|
13
13
|
#include "iterator.h"
|
@@ -407,7 +407,7 @@ cleanup:
|
|
407
407
|
return error;
|
408
408
|
}
|
409
409
|
|
410
|
-
static int note_get_default_ref(
|
410
|
+
static int note_get_default_ref(git_str *out, git_repository *repo)
|
411
411
|
{
|
412
412
|
git_config *cfg;
|
413
413
|
int error;
|
@@ -415,25 +415,25 @@ static int note_get_default_ref(git_buf *out, git_repository *repo)
|
|
415
415
|
if ((error = git_repository_config__weakptr(&cfg, repo)) < 0)
|
416
416
|
return error;
|
417
417
|
|
418
|
-
error =
|
418
|
+
error = git_config__get_string_buf(out, cfg, "core.notesref");
|
419
419
|
|
420
420
|
if (error == GIT_ENOTFOUND)
|
421
|
-
error =
|
421
|
+
error = git_str_puts(out, GIT_NOTES_DEFAULT_REF);
|
422
422
|
|
423
423
|
return error;
|
424
424
|
}
|
425
425
|
|
426
|
-
static int normalize_namespace(
|
426
|
+
static int normalize_namespace(git_str *out, git_repository *repo, const char *notes_ref)
|
427
427
|
{
|
428
428
|
if (notes_ref)
|
429
|
-
return
|
429
|
+
return git_str_puts(out, notes_ref);
|
430
430
|
|
431
431
|
return note_get_default_ref(out, repo);
|
432
432
|
}
|
433
433
|
|
434
434
|
static int retrieve_note_commit(
|
435
435
|
git_commit **commit_out,
|
436
|
-
|
436
|
+
git_str *notes_ref_out,
|
437
437
|
git_repository *repo,
|
438
438
|
const char *notes_ref)
|
439
439
|
{
|
@@ -478,7 +478,7 @@ int git_note_read(git_note **out, git_repository *repo,
|
|
478
478
|
const char *notes_ref_in, const git_oid *oid)
|
479
479
|
{
|
480
480
|
int error;
|
481
|
-
|
481
|
+
git_str notes_ref = GIT_STR_INIT;
|
482
482
|
git_commit *commit = NULL;
|
483
483
|
|
484
484
|
error = retrieve_note_commit(&commit, ¬es_ref, repo, notes_ref_in);
|
@@ -489,7 +489,7 @@ int git_note_read(git_note **out, git_repository *repo,
|
|
489
489
|
error = git_note_commit_read(out, repo, commit, oid);
|
490
490
|
|
491
491
|
cleanup:
|
492
|
-
|
492
|
+
git_str_dispose(¬es_ref);
|
493
493
|
git_commit_free(commit);
|
494
494
|
return error;
|
495
495
|
}
|
@@ -536,7 +536,7 @@ int git_note_create(
|
|
536
536
|
int allow_note_overwrite)
|
537
537
|
{
|
538
538
|
int error;
|
539
|
-
|
539
|
+
git_str notes_ref = GIT_STR_INIT;
|
540
540
|
git_commit *existing_notes_commit = NULL;
|
541
541
|
git_reference *ref = NULL;
|
542
542
|
git_oid notes_blob_oid, notes_commit_oid;
|
@@ -562,7 +562,7 @@ int git_note_create(
|
|
562
562
|
git_oid_cpy(out, ¬es_blob_oid);
|
563
563
|
|
564
564
|
cleanup:
|
565
|
-
|
565
|
+
git_str_dispose(¬es_ref);
|
566
566
|
git_commit_free(existing_notes_commit);
|
567
567
|
git_reference_free(ref);
|
568
568
|
return error;
|
@@ -598,7 +598,7 @@ int git_note_remove(git_repository *repo, const char *notes_ref_in,
|
|
598
598
|
const git_oid *oid)
|
599
599
|
{
|
600
600
|
int error;
|
601
|
-
|
601
|
+
git_str notes_ref_target = GIT_STR_INIT;
|
602
602
|
git_commit *existing_notes_commit = NULL;
|
603
603
|
git_oid new_notes_commit;
|
604
604
|
git_reference *notes_ref = NULL;
|
@@ -618,7 +618,7 @@ int git_note_remove(git_repository *repo, const char *notes_ref_in,
|
|
618
618
|
&new_notes_commit, 1, NULL);
|
619
619
|
|
620
620
|
cleanup:
|
621
|
-
|
621
|
+
git_str_dispose(¬es_ref_target);
|
622
622
|
git_reference_free(notes_ref);
|
623
623
|
git_commit_free(existing_notes_commit);
|
624
624
|
return error;
|
@@ -626,16 +626,7 @@ cleanup:
|
|
626
626
|
|
627
627
|
int git_note_default_ref(git_buf *out, git_repository *repo)
|
628
628
|
{
|
629
|
-
|
630
|
-
|
631
|
-
GIT_ASSERT_ARG(out);
|
632
|
-
GIT_ASSERT_ARG(repo);
|
633
|
-
|
634
|
-
if ((error = git_buf_sanitize(out)) < 0 ||
|
635
|
-
(error = note_get_default_ref(out, repo)) < 0)
|
636
|
-
git_buf_dispose(out);
|
637
|
-
|
638
|
-
return error;
|
629
|
+
GIT_BUF_WRAP_PRIVATE(out, note_get_default_ref, repo);
|
639
630
|
}
|
640
631
|
|
641
632
|
const git_signature *git_note_committer(const git_note *note)
|
@@ -679,12 +670,12 @@ static int process_entry_path(
|
|
679
670
|
{
|
680
671
|
int error = 0;
|
681
672
|
size_t i = 0, j = 0, len;
|
682
|
-
|
673
|
+
git_str buf = GIT_STR_INIT;
|
683
674
|
|
684
|
-
if ((error =
|
675
|
+
if ((error = git_str_puts(&buf, entry_path)) < 0)
|
685
676
|
goto cleanup;
|
686
677
|
|
687
|
-
len =
|
678
|
+
len = git_str_len(&buf);
|
688
679
|
|
689
680
|
while (i < len) {
|
690
681
|
if (buf.ptr[i] == '/') {
|
@@ -715,7 +706,7 @@ static int process_entry_path(
|
|
715
706
|
error = git_oid_fromstr(annotated_object_id, buf.ptr);
|
716
707
|
|
717
708
|
cleanup:
|
718
|
-
|
709
|
+
git_str_dispose(&buf);
|
719
710
|
return error;
|
720
711
|
}
|
721
712
|
|
@@ -780,7 +771,7 @@ int git_note_iterator_new(
|
|
780
771
|
{
|
781
772
|
int error;
|
782
773
|
git_commit *commit = NULL;
|
783
|
-
|
774
|
+
git_str notes_ref = GIT_STR_INIT;
|
784
775
|
|
785
776
|
error = retrieve_note_commit(&commit, ¬es_ref, repo, notes_ref_in);
|
786
777
|
if (error < 0)
|
@@ -789,7 +780,7 @@ int git_note_iterator_new(
|
|
789
780
|
error = git_note_commit_iterator_new(it, commit);
|
790
781
|
|
791
782
|
cleanup:
|
792
|
-
|
783
|
+
git_str_dispose(¬es_ref);
|
793
784
|
git_commit_free(commit);
|
794
785
|
|
795
786
|
return error;
|
data/vendor/libgit2/src/object.c
CHANGED
@@ -11,6 +11,7 @@
|
|
11
11
|
|
12
12
|
#include "repository.h"
|
13
13
|
|
14
|
+
#include "buf.h"
|
14
15
|
#include "commit.h"
|
15
16
|
#include "hash.h"
|
16
17
|
#include "tree.h"
|
@@ -143,12 +144,17 @@ int git_object__from_odb_object(
|
|
143
144
|
def = &git_objects_table[odb_obj->cached.type];
|
144
145
|
GIT_ASSERT(def->free && def->parse);
|
145
146
|
|
146
|
-
if ((error = def->parse(object, odb_obj)) < 0)
|
147
|
+
if ((error = def->parse(object, odb_obj)) < 0) {
|
148
|
+
/*
|
149
|
+
* parse returns EINVALID on invalid data; downgrade
|
150
|
+
* that to a normal -1 error code.
|
151
|
+
*/
|
147
152
|
def->free(object);
|
148
|
-
|
149
|
-
|
153
|
+
return -1;
|
154
|
+
}
|
150
155
|
|
151
|
-
|
156
|
+
*object_out = git_cache_store_parsed(&repo->objects, object);
|
157
|
+
return 0;
|
152
158
|
}
|
153
159
|
|
154
160
|
void git_object__free(void *obj)
|
@@ -491,7 +497,7 @@ cleanup:
|
|
491
497
|
return error;
|
492
498
|
}
|
493
499
|
|
494
|
-
int
|
500
|
+
static int git_object__short_id(git_str *out, const git_object *obj)
|
495
501
|
{
|
496
502
|
git_repository *repo;
|
497
503
|
int len = GIT_ABBREV_DEFAULT, error;
|
@@ -501,9 +507,6 @@ int git_object_short_id(git_buf *out, const git_object *obj)
|
|
501
507
|
GIT_ASSERT_ARG(out);
|
502
508
|
GIT_ASSERT_ARG(obj);
|
503
509
|
|
504
|
-
if ((error = git_buf_sanitize(out)) < 0)
|
505
|
-
return error;
|
506
|
-
|
507
510
|
repo = git_object_owner(obj);
|
508
511
|
|
509
512
|
if ((error = git_repository__configmap_lookup(&len, repo, GIT_CONFIGMAP_ABBREV)) < 0)
|
@@ -526,7 +529,7 @@ int git_object_short_id(git_buf *out, const git_object *obj)
|
|
526
529
|
len++;
|
527
530
|
}
|
528
531
|
|
529
|
-
if (!error && !(error =
|
532
|
+
if (!error && !(error = git_str_grow(out, len + 1))) {
|
530
533
|
git_oid_tostr(out->ptr, len + 1, &id);
|
531
534
|
out->size = len;
|
532
535
|
}
|
@@ -536,6 +539,11 @@ int git_object_short_id(git_buf *out, const git_object *obj)
|
|
536
539
|
return error;
|
537
540
|
}
|
538
541
|
|
542
|
+
int git_object_short_id(git_buf *out, const git_object *obj)
|
543
|
+
{
|
544
|
+
GIT_BUF_WRAP_PRIVATE(out, git_object__short_id, obj);
|
545
|
+
}
|
546
|
+
|
539
547
|
bool git_object__is_valid(
|
540
548
|
git_repository *repo, const git_oid *id, git_object_t expected_type)
|
541
549
|
{
|
@@ -559,3 +567,35 @@ bool git_object__is_valid(
|
|
559
567
|
|
560
568
|
return true;
|
561
569
|
}
|
570
|
+
|
571
|
+
int git_object_rawcontent_is_valid(
|
572
|
+
int *valid,
|
573
|
+
const char *buf,
|
574
|
+
size_t len,
|
575
|
+
git_object_t type)
|
576
|
+
{
|
577
|
+
git_object *obj = NULL;
|
578
|
+
int error;
|
579
|
+
|
580
|
+
GIT_ASSERT_ARG(valid);
|
581
|
+
GIT_ASSERT_ARG(buf);
|
582
|
+
|
583
|
+
/* Blobs are always valid; don't bother parsing. */
|
584
|
+
if (type == GIT_OBJECT_BLOB) {
|
585
|
+
*valid = 1;
|
586
|
+
return 0;
|
587
|
+
}
|
588
|
+
|
589
|
+
error = git_object__from_raw(&obj, buf, len, type);
|
590
|
+
git_object_free(obj);
|
591
|
+
|
592
|
+
if (error == 0) {
|
593
|
+
*valid = 1;
|
594
|
+
return 0;
|
595
|
+
} else if (error == GIT_EINVALID) {
|
596
|
+
*valid = 0;
|
597
|
+
return 0;
|
598
|
+
}
|
599
|
+
|
600
|
+
return error;
|
601
|
+
}
|
data/vendor/libgit2/src/object.h
CHANGED
@@ -47,7 +47,7 @@ git_object_t git_object_stringn2type(const char *str, size_t len);
|
|
47
47
|
|
48
48
|
int git_oid__parse(git_oid *oid, const char **buffer_out, const char *buffer_end, const char *header);
|
49
49
|
|
50
|
-
void git_oid__writebuf(
|
50
|
+
void git_oid__writebuf(git_str *buf, const char *header, const git_oid *oid);
|
51
51
|
|
52
52
|
bool git_object__is_valid(
|
53
53
|
git_repository *repo, const git_oid *id, git_object_t expected_type);
|
data/vendor/libgit2/src/odb.c
CHANGED
@@ -16,6 +16,7 @@
|
|
16
16
|
#include "filter.h"
|
17
17
|
#include "repository.h"
|
18
18
|
#include "blob.h"
|
19
|
+
#include "oid.h"
|
19
20
|
|
20
21
|
#include "git2/odb_backend.h"
|
21
22
|
#include "git2/oid.h"
|
@@ -58,10 +59,7 @@ static int error_null_oid(int error, const char *message);
|
|
58
59
|
|
59
60
|
static git_object_t odb_hardcoded_type(const git_oid *id)
|
60
61
|
{
|
61
|
-
|
62
|
-
0xe5, 0x4b, 0xf8, 0xd6, 0x92, 0x88, 0xfb, 0xee, 0x49, 0x04 }};
|
63
|
-
|
64
|
-
if (!git_oid_cmp(id, &empty_tree))
|
62
|
+
if (!git_oid_cmp(id, &git_oid__empty_tree_sha1))
|
65
63
|
return GIT_OBJECT_TREE;
|
66
64
|
|
67
65
|
return GIT_OBJECT_INVALID;
|
@@ -109,7 +107,7 @@ int git_odb__format_object_header(
|
|
109
107
|
|
110
108
|
int git_odb__hashobj(git_oid *id, git_rawobj *obj)
|
111
109
|
{
|
112
|
-
|
110
|
+
git_str_vec vec[2];
|
113
111
|
char header[64];
|
114
112
|
size_t hdrlen;
|
115
113
|
int error;
|
@@ -136,7 +134,7 @@ int git_odb__hashobj(git_oid *id, git_rawobj *obj)
|
|
136
134
|
vec[1].data = obj->data;
|
137
135
|
vec[1].len = obj->len;
|
138
136
|
|
139
|
-
return git_hash_vec(id, vec, 2);
|
137
|
+
return git_hash_vec(id->id, vec, 2, GIT_HASH_ALGORITHM_SHA1);
|
140
138
|
}
|
141
139
|
|
142
140
|
|
@@ -210,7 +208,7 @@ int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_object_t type)
|
|
210
208
|
return -1;
|
211
209
|
}
|
212
210
|
|
213
|
-
if ((error = git_hash_ctx_init(&ctx)) < 0)
|
211
|
+
if ((error = git_hash_ctx_init(&ctx, GIT_HASH_ALGORITHM_SHA1)) < 0)
|
214
212
|
return error;
|
215
213
|
|
216
214
|
if ((error = git_odb__format_object_header(&hdr_len, hdr,
|
@@ -237,7 +235,7 @@ int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_object_t type)
|
|
237
235
|
goto done;
|
238
236
|
}
|
239
237
|
|
240
|
-
error = git_hash_final(out, &ctx);
|
238
|
+
error = git_hash_final(out->id, &ctx);
|
241
239
|
|
242
240
|
done:
|
243
241
|
git_hash_ctx_cleanup(&ctx);
|
@@ -248,7 +246,7 @@ int git_odb__hashfd_filtered(
|
|
248
246
|
git_oid *out, git_file fd, size_t size, git_object_t type, git_filter_list *fl)
|
249
247
|
{
|
250
248
|
int error;
|
251
|
-
|
249
|
+
git_str raw = GIT_STR_INIT;
|
252
250
|
|
253
251
|
if (!fl)
|
254
252
|
return git_odb__hashfd(out, fd, size, type);
|
@@ -258,14 +256,14 @@ int git_odb__hashfd_filtered(
|
|
258
256
|
*/
|
259
257
|
|
260
258
|
if (!(error = git_futils_readbuffer_fd(&raw, fd, size))) {
|
261
|
-
|
259
|
+
git_str post = GIT_STR_INIT;
|
262
260
|
|
263
261
|
error = git_filter_list__convert_buf(&post, fl, &raw);
|
264
262
|
|
265
263
|
if (!error)
|
266
264
|
error = git_odb_hash(out, post.ptr, post.size, type);
|
267
265
|
|
268
|
-
|
266
|
+
git_str_dispose(&post);
|
269
267
|
}
|
270
268
|
|
271
269
|
return error;
|
@@ -277,7 +275,7 @@ int git_odb__hashlink(git_oid *out, const char *path)
|
|
277
275
|
int size;
|
278
276
|
int result;
|
279
277
|
|
280
|
-
if (
|
278
|
+
if (git_fs_path_lstat(path, &st) < 0)
|
281
279
|
return -1;
|
282
280
|
|
283
281
|
if (!git__is_int(st.st_size) || (int)st.st_size < 0) {
|
@@ -636,8 +634,8 @@ int git_odb__add_default_backends(
|
|
636
634
|
|
637
635
|
static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_depth)
|
638
636
|
{
|
639
|
-
|
640
|
-
|
637
|
+
git_str alternates_path = GIT_STR_INIT;
|
638
|
+
git_str alternates_buf = GIT_STR_INIT;
|
641
639
|
char *buffer;
|
642
640
|
const char *alternate;
|
643
641
|
int result = 0;
|
@@ -646,16 +644,16 @@ static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_
|
|
646
644
|
if (alternate_depth > GIT_ALTERNATES_MAX_DEPTH)
|
647
645
|
return 0;
|
648
646
|
|
649
|
-
if (
|
647
|
+
if (git_str_joinpath(&alternates_path, objects_dir, GIT_ALTERNATES_FILE) < 0)
|
650
648
|
return -1;
|
651
649
|
|
652
|
-
if (
|
653
|
-
|
650
|
+
if (git_fs_path_exists(alternates_path.ptr) == false) {
|
651
|
+
git_str_dispose(&alternates_path);
|
654
652
|
return 0;
|
655
653
|
}
|
656
654
|
|
657
655
|
if (git_futils_readbuffer(&alternates_buf, alternates_path.ptr) < 0) {
|
658
|
-
|
656
|
+
git_str_dispose(&alternates_path);
|
659
657
|
return -1;
|
660
658
|
}
|
661
659
|
|
@@ -672,17 +670,17 @@ static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_
|
|
672
670
|
* the current repository.
|
673
671
|
*/
|
674
672
|
if (*alternate == '.' && !alternate_depth) {
|
675
|
-
if ((result =
|
673
|
+
if ((result = git_str_joinpath(&alternates_path, objects_dir, alternate)) < 0)
|
676
674
|
break;
|
677
|
-
alternate =
|
675
|
+
alternate = git_str_cstr(&alternates_path);
|
678
676
|
}
|
679
677
|
|
680
678
|
if ((result = git_odb__add_default_backends(odb, alternate, true, alternate_depth + 1)) < 0)
|
681
679
|
break;
|
682
680
|
}
|
683
681
|
|
684
|
-
|
685
|
-
|
682
|
+
git_str_dispose(&alternates_path);
|
683
|
+
git_str_dispose(&alternates_buf);
|
686
684
|
|
687
685
|
return result;
|
688
686
|
}
|
@@ -882,6 +880,11 @@ int git_odb__freshen(git_odb *db, const git_oid *id)
|
|
882
880
|
}
|
883
881
|
|
884
882
|
int git_odb_exists(git_odb *db, const git_oid *id)
|
883
|
+
{
|
884
|
+
return git_odb_exists_ext(db, id, 0);
|
885
|
+
}
|
886
|
+
|
887
|
+
int git_odb_exists_ext(git_odb *db, const git_oid *id, unsigned int flags)
|
885
888
|
{
|
886
889
|
git_odb_object *object;
|
887
890
|
|
@@ -899,7 +902,7 @@ int git_odb_exists(git_odb *db, const git_oid *id)
|
|
899
902
|
if (odb_exists_1(db, id, false))
|
900
903
|
return 1;
|
901
904
|
|
902
|
-
if (!git_odb_refresh(db))
|
905
|
+
if (!(flags & GIT_ODB_LOOKUP_NO_REFRESH) && !git_odb_refresh(db))
|
903
906
|
return odb_exists_1(db, id, true);
|
904
907
|
|
905
908
|
/* Failed to refresh, hence not found */
|
@@ -1337,15 +1340,15 @@ static int read_prefix_1(git_odb_object **out, git_odb *db,
|
|
1337
1340
|
data = raw.data;
|
1338
1341
|
|
1339
1342
|
if (found && git_oid__cmp(&full_oid, &found_full_oid)) {
|
1340
|
-
|
1343
|
+
git_str buf = GIT_STR_INIT;
|
1341
1344
|
|
1342
|
-
|
1345
|
+
git_str_printf(&buf, "multiple matches for prefix: %s",
|
1343
1346
|
git_oid_tostr_s(&full_oid));
|
1344
|
-
|
1347
|
+
git_str_printf(&buf, " %s",
|
1345
1348
|
git_oid_tostr_s(&found_full_oid));
|
1346
1349
|
|
1347
1350
|
error = git_odb__error_ambiguous(buf.ptr);
|
1348
|
-
|
1351
|
+
git_str_dispose(&buf);
|
1349
1352
|
git_mutex_unlock(&db->lock);
|
1350
1353
|
goto out;
|
1351
1354
|
}
|
@@ -1496,10 +1499,10 @@ int git_odb_write(
|
|
1496
1499
|
if ((error = git_odb_open_wstream(&stream, db, len, type)) != 0)
|
1497
1500
|
return error;
|
1498
1501
|
|
1499
|
-
stream->write(stream, data, len)
|
1500
|
-
|
1501
|
-
git_odb_stream_free(stream);
|
1502
|
+
if ((error = stream->write(stream, data, len)) == 0)
|
1503
|
+
error = stream->finalize_write(stream, oid);
|
1502
1504
|
|
1505
|
+
git_odb_stream_free(stream);
|
1503
1506
|
return error;
|
1504
1507
|
}
|
1505
1508
|
|
@@ -1561,7 +1564,7 @@ int git_odb_open_wstream(
|
|
1561
1564
|
ctx = git__malloc(sizeof(git_hash_ctx));
|
1562
1565
|
GIT_ERROR_CHECK_ALLOC(ctx);
|
1563
1566
|
|
1564
|
-
if ((error = git_hash_ctx_init(ctx)) < 0 ||
|
1567
|
+
if ((error = git_hash_ctx_init(ctx, GIT_HASH_ALGORITHM_SHA1)) < 0 ||
|
1565
1568
|
(error = hash_header(ctx, size, type)) < 0)
|
1566
1569
|
goto done;
|
1567
1570
|
|
@@ -1607,7 +1610,7 @@ int git_odb_stream_finalize_write(git_oid *out, git_odb_stream *stream)
|
|
1607
1610
|
return git_odb_stream__invalid_length(stream,
|
1608
1611
|
"stream_finalize_write()");
|
1609
1612
|
|
1610
|
-
git_hash_final(out, stream->hash_ctx);
|
1613
|
+
git_hash_final(out->id, stream->hash_ctx);
|
1611
1614
|
|
1612
1615
|
if (git_odb__freshen(stream->backend->odb, out))
|
1613
1616
|
return 0;
|