rugged 0.27.10.1 → 0.28.0
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 +23 -2
- data/ext/rugged/rugged.c +48 -2
- data/ext/rugged/rugged.h +5 -0
- data/ext/rugged/rugged_allocator.c +89 -0
- data/ext/rugged/rugged_blob.c +3 -3
- data/ext/rugged/rugged_branch.c +1 -1
- data/ext/rugged/rugged_commit.c +8 -8
- data/ext/rugged/rugged_config.c +1 -1
- data/ext/rugged/rugged_diff.c +24 -4
- data/ext/rugged/rugged_note.c +1 -1
- data/ext/rugged/rugged_repo.c +10 -10
- data/ext/rugged/rugged_settings.c +1 -1
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/CMakeLists.txt +69 -47
- data/vendor/libgit2/cmake/Modules/AddCFlagIfSupported.cmake +15 -1
- data/vendor/libgit2/cmake/Modules/EnableWarnings.cmake +5 -8
- data/vendor/libgit2/cmake/Modules/FindmbedTLS.cmake +93 -0
- data/vendor/libgit2/deps/http-parser/CMakeLists.txt +2 -0
- data/vendor/libgit2/deps/http-parser/{LICENSE-MIT → COPYING} +0 -0
- data/vendor/libgit2/deps/regex/COPYING +502 -0
- data/vendor/libgit2/deps/winhttp/COPYING.GPL +993 -0
- data/vendor/libgit2/deps/winhttp/COPYING.LGPL +502 -0
- data/vendor/libgit2/deps/zlib/CMakeLists.txt +1 -0
- data/vendor/libgit2/deps/zlib/COPYING +27 -0
- data/vendor/libgit2/include/git2.h +3 -0
- data/vendor/libgit2/include/git2/annotated_commit.h +9 -0
- data/vendor/libgit2/include/git2/apply.h +129 -0
- data/vendor/libgit2/include/git2/attr.h +19 -8
- data/vendor/libgit2/include/git2/blame.h +41 -24
- data/vendor/libgit2/include/git2/blob.h +1 -1
- data/vendor/libgit2/include/git2/branch.h +1 -1
- data/vendor/libgit2/include/git2/buffer.h +2 -2
- data/vendor/libgit2/include/git2/checkout.h +20 -19
- data/vendor/libgit2/include/git2/cherrypick.h +6 -4
- data/vendor/libgit2/include/git2/clone.h +11 -9
- data/vendor/libgit2/include/git2/commit.h +30 -2
- data/vendor/libgit2/include/git2/common.h +54 -4
- data/vendor/libgit2/include/git2/config.h +18 -7
- data/vendor/libgit2/include/git2/deprecated.h +253 -0
- data/vendor/libgit2/include/git2/describe.h +30 -7
- data/vendor/libgit2/include/git2/diff.h +193 -143
- data/vendor/libgit2/include/git2/errors.h +54 -46
- data/vendor/libgit2/include/git2/ignore.h +2 -2
- data/vendor/libgit2/include/git2/index.h +72 -51
- data/vendor/libgit2/include/git2/indexer.h +30 -4
- data/vendor/libgit2/include/git2/mailmap.h +115 -0
- data/vendor/libgit2/include/git2/merge.h +29 -8
- data/vendor/libgit2/include/git2/net.h +1 -1
- data/vendor/libgit2/include/git2/notes.h +1 -1
- data/vendor/libgit2/include/git2/object.h +16 -16
- data/vendor/libgit2/include/git2/odb.h +10 -10
- data/vendor/libgit2/include/git2/odb_backend.h +7 -7
- data/vendor/libgit2/include/git2/oid.h +1 -1
- data/vendor/libgit2/include/git2/pack.h +2 -2
- data/vendor/libgit2/include/git2/proxy.h +9 -5
- data/vendor/libgit2/include/git2/rebase.h +7 -4
- data/vendor/libgit2/include/git2/refs.h +14 -15
- data/vendor/libgit2/include/git2/refspec.h +17 -0
- data/vendor/libgit2/include/git2/remote.h +92 -16
- data/vendor/libgit2/include/git2/repository.h +52 -37
- data/vendor/libgit2/include/git2/revert.h +5 -3
- 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 +13 -10
- data/vendor/libgit2/include/git2/status.h +8 -4
- data/vendor/libgit2/include/git2/submodule.h +11 -10
- data/vendor/libgit2/include/git2/sys/alloc.h +101 -0
- 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 +3 -0
- data/vendor/libgit2/include/git2/sys/mempack.h +35 -35
- data/vendor/libgit2/include/git2/sys/merge.h +9 -4
- data/vendor/libgit2/include/git2/sys/odb_backend.h +19 -19
- data/vendor/libgit2/include/git2/sys/path.h +64 -0
- data/vendor/libgit2/include/git2/sys/refdb_backend.h +19 -19
- data/vendor/libgit2/include/git2/sys/stream.h +92 -12
- data/vendor/libgit2/include/git2/sys/transport.h +127 -81
- data/vendor/libgit2/include/git2/tag.h +2 -2
- data/vendor/libgit2/include/git2/trace.h +1 -1
- data/vendor/libgit2/include/git2/transaction.h +1 -0
- data/vendor/libgit2/include/git2/transport.h +47 -18
- data/vendor/libgit2/include/git2/tree.h +3 -3
- data/vendor/libgit2/include/git2/types.h +35 -28
- data/vendor/libgit2/include/git2/version.h +4 -4
- data/vendor/libgit2/include/git2/worktree.h +47 -12
- data/vendor/libgit2/src/CMakeLists.txt +87 -26
- data/vendor/libgit2/src/alloc.c +55 -0
- data/vendor/libgit2/src/alloc.h +40 -0
- data/vendor/libgit2/src/annotated_commit.c +15 -8
- data/vendor/libgit2/src/apply.c +490 -14
- data/vendor/libgit2/src/apply.h +3 -1
- data/vendor/libgit2/src/array.h +2 -2
- data/vendor/libgit2/src/attr.c +11 -11
- data/vendor/libgit2/src/attr_file.c +20 -15
- data/vendor/libgit2/src/attrcache.c +11 -11
- data/vendor/libgit2/src/blame.c +30 -15
- data/vendor/libgit2/src/blame.h +1 -0
- data/vendor/libgit2/src/blame_git.c +16 -13
- data/vendor/libgit2/src/blob.c +50 -28
- data/vendor/libgit2/src/blob.h +18 -1
- data/vendor/libgit2/src/branch.c +38 -38
- data/vendor/libgit2/src/buf_text.c +7 -6
- data/vendor/libgit2/src/buffer.c +55 -50
- data/vendor/libgit2/src/buffer.h +1 -1
- data/vendor/libgit2/src/cache.c +16 -16
- data/vendor/libgit2/src/cache.h +2 -2
- data/vendor/libgit2/src/cc-compat.h +15 -3
- data/vendor/libgit2/src/checkout.c +83 -74
- data/vendor/libgit2/src/cherrypick.c +6 -6
- data/vendor/libgit2/src/clone.c +20 -20
- data/vendor/libgit2/src/commit.c +53 -33
- data/vendor/libgit2/src/commit.h +1 -0
- data/vendor/libgit2/src/commit_list.c +6 -10
- data/vendor/libgit2/src/common.h +32 -30
- data/vendor/libgit2/src/config.c +167 -147
- data/vendor/libgit2/src/config.h +1 -14
- data/vendor/libgit2/src/config_backend.h +84 -0
- data/vendor/libgit2/src/config_cache.c +7 -1
- data/vendor/libgit2/src/config_entries.c +259 -0
- data/vendor/libgit2/src/config_entries.h +23 -0
- data/vendor/libgit2/src/config_file.c +167 -439
- data/vendor/libgit2/src/config_mem.c +224 -0
- data/vendor/libgit2/src/config_parse.c +69 -38
- data/vendor/libgit2/src/config_parse.h +4 -4
- data/vendor/libgit2/src/crlf.c +215 -186
- data/vendor/libgit2/src/delta.c +25 -18
- data/vendor/libgit2/src/describe.c +23 -23
- data/vendor/libgit2/src/diff.c +12 -12
- data/vendor/libgit2/src/diff_driver.c +14 -15
- data/vendor/libgit2/src/diff_file.c +10 -10
- data/vendor/libgit2/src/diff_generate.c +29 -23
- data/vendor/libgit2/src/diff_generate.h +1 -1
- data/vendor/libgit2/src/diff_parse.c +3 -3
- data/vendor/libgit2/src/diff_print.c +17 -17
- data/vendor/libgit2/src/diff_stats.c +22 -7
- data/vendor/libgit2/src/diff_tform.c +12 -12
- data/vendor/libgit2/src/diff_xdiff.c +15 -3
- data/vendor/libgit2/src/errors.c +42 -20
- data/vendor/libgit2/src/features.h.in +2 -1
- data/vendor/libgit2/src/fetch.c +3 -3
- data/vendor/libgit2/src/fetchhead.c +16 -16
- data/vendor/libgit2/src/filebuf.c +28 -28
- data/vendor/libgit2/src/fileops.c +54 -54
- data/vendor/libgit2/src/fileops.h +1 -1
- data/vendor/libgit2/src/filter.c +30 -30
- data/vendor/libgit2/src/filter.h +0 -10
- data/vendor/libgit2/src/global.c +36 -23
- data/vendor/libgit2/src/hash.h +4 -1
- data/vendor/libgit2/src/hash/hash_collisiondetect.h +6 -2
- data/vendor/libgit2/src/hash/hash_common_crypto.h +5 -1
- data/vendor/libgit2/src/hash/hash_generic.h +5 -1
- data/vendor/libgit2/src/hash/hash_mbedtls.c +38 -0
- data/vendor/libgit2/src/hash/hash_mbedtls.h +24 -0
- data/vendor/libgit2/src/hash/hash_openssl.h +8 -4
- data/vendor/libgit2/src/hash/hash_win32.c +13 -13
- data/vendor/libgit2/src/hashsig.c +4 -4
- data/vendor/libgit2/src/idxmap.c +25 -5
- data/vendor/libgit2/src/idxmap.h +4 -18
- data/vendor/libgit2/src/ignore.c +9 -9
- data/vendor/libgit2/src/index.c +280 -198
- data/vendor/libgit2/src/index.h +16 -0
- data/vendor/libgit2/src/indexer.c +311 -139
- data/vendor/libgit2/src/integer.h +32 -22
- data/vendor/libgit2/src/iterator.c +116 -49
- data/vendor/libgit2/src/iterator.h +15 -0
- data/vendor/libgit2/src/khash.h +3 -1
- data/vendor/libgit2/src/mailmap.c +485 -0
- data/vendor/libgit2/src/mailmap.h +35 -0
- data/vendor/libgit2/src/merge.c +89 -59
- data/vendor/libgit2/src/merge_driver.c +7 -7
- data/vendor/libgit2/src/merge_file.c +1 -1
- data/vendor/libgit2/src/mwindow.c +8 -8
- data/vendor/libgit2/src/netops.c +22 -13
- data/vendor/libgit2/src/netops.h +2 -0
- data/vendor/libgit2/src/notes.c +15 -10
- data/vendor/libgit2/src/object.c +118 -67
- data/vendor/libgit2/src/object.h +20 -9
- data/vendor/libgit2/src/object_api.c +8 -8
- data/vendor/libgit2/src/odb.c +72 -72
- data/vendor/libgit2/src/odb.h +7 -7
- data/vendor/libgit2/src/odb_loose.c +46 -46
- data/vendor/libgit2/src/odb_mempack.c +14 -14
- data/vendor/libgit2/src/odb_pack.c +14 -10
- data/vendor/libgit2/src/offmap.c +30 -0
- data/vendor/libgit2/src/offmap.h +20 -11
- data/vendor/libgit2/src/oid.c +6 -6
- data/vendor/libgit2/src/oidmap.c +20 -0
- data/vendor/libgit2/src/oidmap.h +9 -12
- data/vendor/libgit2/src/pack-objects.c +71 -63
- data/vendor/libgit2/src/pack-objects.h +1 -7
- data/vendor/libgit2/src/pack.c +58 -58
- data/vendor/libgit2/src/pack.h +6 -6
- data/vendor/libgit2/src/parse.h +1 -1
- data/vendor/libgit2/src/patch.c +3 -3
- data/vendor/libgit2/src/patch_generate.c +18 -18
- data/vendor/libgit2/src/patch_parse.c +13 -13
- data/vendor/libgit2/src/path.c +93 -225
- data/vendor/libgit2/src/path.h +2 -84
- data/vendor/libgit2/src/pathspec.c +6 -6
- data/vendor/libgit2/src/posix.c +3 -3
- data/vendor/libgit2/src/proxy.c +1 -1
- data/vendor/libgit2/src/push.c +27 -26
- data/vendor/libgit2/src/push.h +2 -1
- data/vendor/libgit2/src/reader.c +265 -0
- data/vendor/libgit2/src/reader.h +107 -0
- data/vendor/libgit2/src/rebase.c +49 -52
- data/vendor/libgit2/src/refdb.c +3 -3
- data/vendor/libgit2/src/refdb_fs.c +181 -103
- data/vendor/libgit2/src/reflog.c +3 -3
- data/vendor/libgit2/src/refs.c +98 -74
- data/vendor/libgit2/src/refs.h +5 -3
- data/vendor/libgit2/src/refspec.c +47 -21
- data/vendor/libgit2/src/refspec.h +1 -1
- data/vendor/libgit2/src/remote.c +219 -166
- data/vendor/libgit2/src/remote.h +9 -0
- data/vendor/libgit2/src/repository.c +173 -133
- data/vendor/libgit2/src/repository.h +6 -3
- data/vendor/libgit2/src/reset.c +8 -8
- data/vendor/libgit2/src/revert.c +6 -6
- data/vendor/libgit2/src/revparse.c +30 -30
- data/vendor/libgit2/src/revwalk.c +60 -30
- data/vendor/libgit2/src/revwalk.h +2 -1
- data/vendor/libgit2/src/settings.c +42 -10
- data/vendor/libgit2/src/signature.c +11 -11
- data/vendor/libgit2/src/sortedcache.c +13 -13
- data/vendor/libgit2/src/stash.c +91 -45
- data/vendor/libgit2/src/status.c +13 -13
- data/vendor/libgit2/src/stdalloc.c +120 -0
- data/vendor/libgit2/src/{streams/curl.h → stdalloc.h} +6 -6
- data/vendor/libgit2/src/stream.h +17 -2
- data/vendor/libgit2/src/streams/mbedtls.c +483 -0
- data/vendor/libgit2/src/streams/mbedtls.h +23 -0
- data/vendor/libgit2/src/streams/openssl.c +204 -114
- data/vendor/libgit2/src/streams/openssl.h +4 -108
- data/vendor/libgit2/src/streams/registry.c +118 -0
- data/vendor/libgit2/src/streams/registry.h +19 -0
- data/vendor/libgit2/src/streams/socket.c +54 -29
- data/vendor/libgit2/src/streams/stransport.c +57 -32
- data/vendor/libgit2/src/streams/stransport.h +5 -0
- data/vendor/libgit2/src/streams/tls.c +50 -19
- data/vendor/libgit2/src/streams/tls.h +12 -4
- data/vendor/libgit2/src/strmap.c +22 -2
- data/vendor/libgit2/src/strmap.h +18 -15
- data/vendor/libgit2/src/submodule.c +179 -155
- data/vendor/libgit2/src/sysdir.c +18 -18
- data/vendor/libgit2/src/tag.c +31 -26
- data/vendor/libgit2/src/tag.h +2 -1
- data/vendor/libgit2/src/trace.c +1 -1
- data/vendor/libgit2/src/trace.h +1 -1
- data/vendor/libgit2/src/trailer.c +6 -6
- data/vendor/libgit2/src/transaction.c +23 -23
- data/vendor/libgit2/src/transport.c +5 -5
- data/vendor/libgit2/src/transports/auth.c +7 -4
- data/vendor/libgit2/src/transports/auth.h +1 -1
- data/vendor/libgit2/src/transports/auth_negotiate.c +12 -11
- data/vendor/libgit2/src/transports/cred.c +18 -18
- data/vendor/libgit2/src/transports/git.c +15 -15
- data/vendor/libgit2/src/transports/http.c +606 -216
- data/vendor/libgit2/src/transports/http.h +2 -0
- data/vendor/libgit2/src/transports/local.c +26 -26
- data/vendor/libgit2/src/transports/smart.c +54 -31
- data/vendor/libgit2/src/transports/smart.h +1 -2
- data/vendor/libgit2/src/transports/smart_pkt.c +43 -40
- data/vendor/libgit2/src/transports/smart_protocol.c +61 -57
- data/vendor/libgit2/src/transports/ssh.c +34 -33
- data/vendor/libgit2/src/transports/winhttp.c +99 -119
- data/vendor/libgit2/src/tree-cache.c +5 -5
- data/vendor/libgit2/src/tree.c +96 -121
- data/vendor/libgit2/src/tree.h +1 -12
- data/vendor/libgit2/src/unix/map.c +2 -2
- data/vendor/libgit2/src/util.c +22 -6
- data/vendor/libgit2/src/util.h +12 -135
- 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 +6 -6
- data/vendor/libgit2/src/win32/msvc-compat.h +6 -0
- data/vendor/libgit2/src/win32/path_w32.c +101 -7
- data/vendor/libgit2/src/win32/path_w32.h +18 -0
- data/vendor/libgit2/src/win32/posix_w32.c +24 -43
- data/vendor/libgit2/src/win32/w32_buffer.c +2 -2
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +96 -2
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +28 -75
- data/vendor/libgit2/src/win32/w32_stack.c +2 -2
- data/vendor/libgit2/src/win32/w32_util.c +1 -69
- data/vendor/libgit2/src/win32/w32_util.h +1 -19
- data/vendor/libgit2/src/worktree.c +75 -54
- data/vendor/libgit2/src/worktree.h +2 -0
- data/vendor/libgit2/src/xdiff/xdiffi.c +7 -5
- data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
- data/vendor/libgit2/src/xdiff/xmerge.c +15 -15
- data/vendor/libgit2/src/zstream.c +4 -4
- metadata +33 -7
- data/vendor/libgit2/src/config_file.h +0 -73
- data/vendor/libgit2/src/streams/curl.c +0 -385
data/vendor/libgit2/src/object.h
CHANGED
@@ -22,36 +22,47 @@ struct git_object {
|
|
22
22
|
/* fully free the object; internal method, DO NOT EXPORT */
|
23
23
|
void git_object__free(void *object);
|
24
24
|
|
25
|
+
/*
|
26
|
+
* Parse object from raw data. Note that the resulting object is
|
27
|
+
* tied to the lifetime of the data, as some objects simply point
|
28
|
+
* into it.
|
29
|
+
*/
|
30
|
+
int git_object__from_raw(
|
31
|
+
git_object **object_out,
|
32
|
+
const char *data,
|
33
|
+
size_t size,
|
34
|
+
git_object_t type);
|
35
|
+
|
25
36
|
int git_object__from_odb_object(
|
26
37
|
git_object **object_out,
|
27
38
|
git_repository *repo,
|
28
39
|
git_odb_object *odb_obj,
|
29
|
-
|
40
|
+
git_object_t type);
|
30
41
|
|
31
|
-
int git_object__resolve_to_type(git_object **obj,
|
42
|
+
int git_object__resolve_to_type(git_object **obj, git_object_t type);
|
32
43
|
|
33
|
-
|
44
|
+
git_object_t git_object_stringn2type(const char *str, size_t len);
|
34
45
|
|
35
46
|
int git_oid__parse(git_oid *oid, const char **buffer_out, const char *buffer_end, const char *header);
|
36
47
|
|
37
48
|
void git_oid__writebuf(git_buf *buf, const char *header, const git_oid *oid);
|
38
49
|
|
39
50
|
bool git_object__is_valid(
|
40
|
-
git_repository *repo, const git_oid *id,
|
51
|
+
git_repository *repo, const git_oid *id, git_object_t expected_type);
|
41
52
|
|
42
|
-
GIT_INLINE(
|
53
|
+
GIT_INLINE(git_object_t) git_object__type_from_filemode(git_filemode_t mode)
|
43
54
|
{
|
44
55
|
switch (mode) {
|
45
56
|
case GIT_FILEMODE_TREE:
|
46
|
-
return
|
57
|
+
return GIT_OBJECT_TREE;
|
47
58
|
case GIT_FILEMODE_COMMIT:
|
48
|
-
return
|
59
|
+
return GIT_OBJECT_COMMIT;
|
49
60
|
case GIT_FILEMODE_BLOB:
|
50
61
|
case GIT_FILEMODE_BLOB_EXECUTABLE:
|
51
62
|
case GIT_FILEMODE_LINK:
|
52
|
-
return
|
63
|
+
return GIT_OBJECT_BLOB;
|
53
64
|
default:
|
54
|
-
return
|
65
|
+
return GIT_OBJECT_INVALID;
|
55
66
|
}
|
56
67
|
}
|
57
68
|
|
@@ -20,12 +20,12 @@
|
|
20
20
|
*/
|
21
21
|
int git_commit_lookup(git_commit **out, git_repository *repo, const git_oid *id)
|
22
22
|
{
|
23
|
-
return git_object_lookup((git_object **)out, repo, id,
|
23
|
+
return git_object_lookup((git_object **)out, repo, id, GIT_OBJECT_COMMIT);
|
24
24
|
}
|
25
25
|
|
26
26
|
int git_commit_lookup_prefix(git_commit **out, git_repository *repo, const git_oid *id, size_t len)
|
27
27
|
{
|
28
|
-
return git_object_lookup_prefix((git_object **)out, repo, id, len,
|
28
|
+
return git_object_lookup_prefix((git_object **)out, repo, id, len, GIT_OBJECT_COMMIT);
|
29
29
|
}
|
30
30
|
|
31
31
|
void git_commit_free(git_commit *obj)
|
@@ -53,12 +53,12 @@ int git_commit_dup(git_commit **out, git_commit *obj)
|
|
53
53
|
*/
|
54
54
|
int git_tree_lookup(git_tree **out, git_repository *repo, const git_oid *id)
|
55
55
|
{
|
56
|
-
return git_object_lookup((git_object **)out, repo, id,
|
56
|
+
return git_object_lookup((git_object **)out, repo, id, GIT_OBJECT_TREE);
|
57
57
|
}
|
58
58
|
|
59
59
|
int git_tree_lookup_prefix(git_tree **out, git_repository *repo, const git_oid *id, size_t len)
|
60
60
|
{
|
61
|
-
return git_object_lookup_prefix((git_object **)out, repo, id, len,
|
61
|
+
return git_object_lookup_prefix((git_object **)out, repo, id, len, GIT_OBJECT_TREE);
|
62
62
|
}
|
63
63
|
|
64
64
|
void git_tree_free(git_tree *obj)
|
@@ -86,12 +86,12 @@ int git_tree_dup(git_tree **out, git_tree *obj)
|
|
86
86
|
*/
|
87
87
|
int git_tag_lookup(git_tag **out, git_repository *repo, const git_oid *id)
|
88
88
|
{
|
89
|
-
return git_object_lookup((git_object **)out, repo, id,
|
89
|
+
return git_object_lookup((git_object **)out, repo, id, GIT_OBJECT_TAG);
|
90
90
|
}
|
91
91
|
|
92
92
|
int git_tag_lookup_prefix(git_tag **out, git_repository *repo, const git_oid *id, size_t len)
|
93
93
|
{
|
94
|
-
return git_object_lookup_prefix((git_object **)out, repo, id, len,
|
94
|
+
return git_object_lookup_prefix((git_object **)out, repo, id, len, GIT_OBJECT_TAG);
|
95
95
|
}
|
96
96
|
|
97
97
|
void git_tag_free(git_tag *obj)
|
@@ -119,12 +119,12 @@ int git_tag_dup(git_tag **out, git_tag *obj)
|
|
119
119
|
*/
|
120
120
|
int git_blob_lookup(git_blob **out, git_repository *repo, const git_oid *id)
|
121
121
|
{
|
122
|
-
return git_object_lookup((git_object **)out, repo, id,
|
122
|
+
return git_object_lookup((git_object **)out, repo, id, GIT_OBJECT_BLOB);
|
123
123
|
}
|
124
124
|
|
125
125
|
int git_blob_lookup_prefix(git_blob **out, git_repository *repo, const git_oid *id, size_t len)
|
126
126
|
{
|
127
|
-
return git_object_lookup_prefix((git_object **)out, repo, id, len,
|
127
|
+
return git_object_lookup_prefix((git_object **)out, repo, id, len, GIT_OBJECT_BLOB);
|
128
128
|
}
|
129
129
|
|
130
130
|
void git_blob_free(git_blob *obj)
|
data/vendor/libgit2/src/odb.c
CHANGED
@@ -15,6 +15,7 @@
|
|
15
15
|
#include "delta.h"
|
16
16
|
#include "filter.h"
|
17
17
|
#include "repository.h"
|
18
|
+
#include "blob.h"
|
18
19
|
|
19
20
|
#include "git2/odb_backend.h"
|
20
21
|
#include "git2/oid.h"
|
@@ -51,34 +52,34 @@ static git_cache *odb_cache(git_odb *odb)
|
|
51
52
|
return &odb->own_cache;
|
52
53
|
}
|
53
54
|
|
54
|
-
static int odb_otype_fast(
|
55
|
+
static int odb_otype_fast(git_object_t *type_p, git_odb *db, const git_oid *id);
|
55
56
|
static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_depth);
|
56
57
|
static int error_null_oid(int error, const char *message);
|
57
58
|
|
58
|
-
static
|
59
|
+
static git_object_t odb_hardcoded_type(const git_oid *id)
|
59
60
|
{
|
60
61
|
static git_oid empty_tree = {{ 0x4b, 0x82, 0x5d, 0xc6, 0x42, 0xcb, 0x6e, 0xb9, 0xa0, 0x60,
|
61
62
|
0xe5, 0x4b, 0xf8, 0xd6, 0x92, 0x88, 0xfb, 0xee, 0x49, 0x04 }};
|
62
63
|
|
63
64
|
if (!git_oid_cmp(id, &empty_tree))
|
64
|
-
return
|
65
|
+
return GIT_OBJECT_TREE;
|
65
66
|
|
66
|
-
return
|
67
|
+
return GIT_OBJECT_INVALID;
|
67
68
|
}
|
68
69
|
|
69
70
|
static int odb_read_hardcoded(bool *found, git_rawobj *raw, const git_oid *id)
|
70
71
|
{
|
71
|
-
|
72
|
+
git_object_t type;
|
72
73
|
|
73
74
|
*found = false;
|
74
75
|
|
75
|
-
if ((type = odb_hardcoded_type(id)) ==
|
76
|
+
if ((type = odb_hardcoded_type(id)) == GIT_OBJECT_INVALID)
|
76
77
|
return 0;
|
77
78
|
|
78
79
|
raw->type = type;
|
79
80
|
raw->len = 0;
|
80
81
|
raw->data = git__calloc(1, sizeof(uint8_t));
|
81
|
-
|
82
|
+
GIT_ERROR_CHECK_ALLOC(raw->data);
|
82
83
|
|
83
84
|
*found = true;
|
84
85
|
return 0;
|
@@ -89,16 +90,16 @@ int git_odb__format_object_header(
|
|
89
90
|
char *hdr,
|
90
91
|
size_t hdr_size,
|
91
92
|
git_off_t obj_len,
|
92
|
-
|
93
|
+
git_object_t obj_type)
|
93
94
|
{
|
94
95
|
const char *type_str = git_object_type2string(obj_type);
|
95
96
|
int hdr_max = (hdr_size > INT_MAX-2) ? (INT_MAX-2) : (int)hdr_size;
|
96
97
|
int len;
|
97
98
|
|
98
|
-
len = p_snprintf(hdr, hdr_max, "%s %
|
99
|
+
len = p_snprintf(hdr, hdr_max, "%s %"PRId64, type_str, (int64_t)obj_len);
|
99
100
|
|
100
101
|
if (len < 0 || len >= hdr_max) {
|
101
|
-
|
102
|
+
git_error_set(GIT_ERROR_OS, "object header creation failed");
|
102
103
|
return -1;
|
103
104
|
}
|
104
105
|
|
@@ -116,12 +117,12 @@ int git_odb__hashobj(git_oid *id, git_rawobj *obj)
|
|
116
117
|
assert(id && obj);
|
117
118
|
|
118
119
|
if (!git_object_typeisloose(obj->type)) {
|
119
|
-
|
120
|
+
git_error_set(GIT_ERROR_INVALID, "invalid object type");
|
120
121
|
return -1;
|
121
122
|
}
|
122
123
|
|
123
124
|
if (!obj->data && obj->len != 0) {
|
124
|
-
|
125
|
+
git_error_set(GIT_ERROR_INVALID, "invalid object");
|
125
126
|
return -1;
|
126
127
|
}
|
127
128
|
|
@@ -175,7 +176,7 @@ size_t git_odb_object_size(git_odb_object *object)
|
|
175
176
|
return object->cached.size;
|
176
177
|
}
|
177
178
|
|
178
|
-
|
179
|
+
git_object_t git_odb_object_type(git_odb_object *object)
|
179
180
|
{
|
180
181
|
return object->cached.type;
|
181
182
|
}
|
@@ -195,7 +196,7 @@ void git_odb_object_free(git_odb_object *object)
|
|
195
196
|
git_cached_obj_decref(object);
|
196
197
|
}
|
197
198
|
|
198
|
-
int git_odb__hashfd(git_oid *out, git_file fd, size_t size,
|
199
|
+
int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_object_t type)
|
199
200
|
{
|
200
201
|
size_t hdr_len;
|
201
202
|
char hdr[64], buffer[FILEIO_BUFSIZE];
|
@@ -204,7 +205,7 @@ int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_otype type)
|
|
204
205
|
int error = 0;
|
205
206
|
|
206
207
|
if (!git_object_typeisloose(type)) {
|
207
|
-
|
208
|
+
git_error_set(GIT_ERROR_INVALID, "invalid object type for hash");
|
208
209
|
return -1;
|
209
210
|
}
|
210
211
|
|
@@ -229,7 +230,7 @@ int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_otype type)
|
|
229
230
|
* If size is not zero, the file was truncated after we originally
|
230
231
|
* stat'd it, so we consider this a read failure too */
|
231
232
|
if (read_len < 0 || size > 0) {
|
232
|
-
|
233
|
+
git_error_set(GIT_ERROR_OS, "error reading file for hashing");
|
233
234
|
error = -1;
|
234
235
|
|
235
236
|
goto done;
|
@@ -243,7 +244,7 @@ done:
|
|
243
244
|
}
|
244
245
|
|
245
246
|
int git_odb__hashfd_filtered(
|
246
|
-
git_oid *out, git_file fd, size_t size,
|
247
|
+
git_oid *out, git_file fd, size_t size, git_object_t type, git_filter_list *fl)
|
247
248
|
{
|
248
249
|
int error;
|
249
250
|
git_buf raw = GIT_BUF_INIT;
|
@@ -260,12 +261,12 @@ int git_odb__hashfd_filtered(
|
|
260
261
|
|
261
262
|
error = git_filter_list_apply_to_data(&post, fl, &raw);
|
262
263
|
|
263
|
-
|
264
|
+
git_buf_dispose(&raw);
|
264
265
|
|
265
266
|
if (!error)
|
266
267
|
error = git_odb_hash(out, post.ptr, post.size, type);
|
267
268
|
|
268
|
-
|
269
|
+
git_buf_dispose(&post);
|
269
270
|
}
|
270
271
|
|
271
272
|
return error;
|
@@ -281,7 +282,7 @@ int git_odb__hashlink(git_oid *out, const char *path)
|
|
281
282
|
return -1;
|
282
283
|
|
283
284
|
if (!git__is_int(st.st_size) || (int)st.st_size < 0) {
|
284
|
-
|
285
|
+
git_error_set(GIT_ERROR_FILESYSTEM, "file size overflow for 32-bit systems");
|
285
286
|
return -1;
|
286
287
|
}
|
287
288
|
|
@@ -292,32 +293,32 @@ int git_odb__hashlink(git_oid *out, const char *path)
|
|
292
293
|
int read_len;
|
293
294
|
size_t alloc_size;
|
294
295
|
|
295
|
-
|
296
|
+
GIT_ERROR_CHECK_ALLOC_ADD(&alloc_size, size, 1);
|
296
297
|
link_data = git__malloc(alloc_size);
|
297
|
-
|
298
|
+
GIT_ERROR_CHECK_ALLOC(link_data);
|
298
299
|
|
299
300
|
read_len = p_readlink(path, link_data, size);
|
300
301
|
link_data[size] = '\0';
|
301
302
|
if (read_len != size) {
|
302
|
-
|
303
|
+
git_error_set(GIT_ERROR_OS, "failed to read symlink data for '%s'", path);
|
303
304
|
git__free(link_data);
|
304
305
|
return -1;
|
305
306
|
}
|
306
307
|
|
307
|
-
result = git_odb_hash(out, link_data, size,
|
308
|
+
result = git_odb_hash(out, link_data, size, GIT_OBJECT_BLOB);
|
308
309
|
git__free(link_data);
|
309
310
|
} else {
|
310
311
|
int fd = git_futils_open_ro(path);
|
311
312
|
if (fd < 0)
|
312
313
|
return -1;
|
313
|
-
result = git_odb__hashfd(out, fd, size,
|
314
|
+
result = git_odb__hashfd(out, fd, size, GIT_OBJECT_BLOB);
|
314
315
|
p_close(fd);
|
315
316
|
}
|
316
317
|
|
317
318
|
return result;
|
318
319
|
}
|
319
320
|
|
320
|
-
int git_odb_hashfile(git_oid *out, const char *path,
|
321
|
+
int git_odb_hashfile(git_oid *out, const char *path, git_object_t type)
|
321
322
|
{
|
322
323
|
git_off_t size;
|
323
324
|
int result, fd = git_futils_open_ro(path);
|
@@ -325,7 +326,7 @@ int git_odb_hashfile(git_oid *out, const char *path, git_otype type)
|
|
325
326
|
return fd;
|
326
327
|
|
327
328
|
if ((size = git_futils_filesize(fd)) < 0 || !git__is_sizet(size)) {
|
328
|
-
|
329
|
+
git_error_set(GIT_ERROR_OS, "file size overflow for 32-bit systems");
|
329
330
|
p_close(fd);
|
330
331
|
return -1;
|
331
332
|
}
|
@@ -335,7 +336,7 @@ int git_odb_hashfile(git_oid *out, const char *path, git_otype type)
|
|
335
336
|
return result;
|
336
337
|
}
|
337
338
|
|
338
|
-
int git_odb_hash(git_oid *id, const void *data, size_t len,
|
339
|
+
int git_odb_hash(git_oid *id, const void *data, size_t len, git_object_t type)
|
339
340
|
{
|
340
341
|
git_rawobj raw;
|
341
342
|
|
@@ -356,7 +357,7 @@ typedef struct {
|
|
356
357
|
git_odb_stream stream;
|
357
358
|
char *buffer;
|
358
359
|
size_t size, written;
|
359
|
-
|
360
|
+
git_object_t type;
|
360
361
|
} fake_wstream;
|
361
362
|
|
362
363
|
static int fake_wstream__fwrite(git_odb_stream *_stream, const git_oid *oid)
|
@@ -384,21 +385,20 @@ static void fake_wstream__free(git_odb_stream *_stream)
|
|
384
385
|
git__free(stream);
|
385
386
|
}
|
386
387
|
|
387
|
-
static int init_fake_wstream(git_odb_stream **stream_p, git_odb_backend *backend, git_off_t size,
|
388
|
+
static int init_fake_wstream(git_odb_stream **stream_p, git_odb_backend *backend, git_off_t size, git_object_t type)
|
388
389
|
{
|
389
390
|
fake_wstream *stream;
|
391
|
+
size_t blobsize;
|
390
392
|
|
391
|
-
|
392
|
-
|
393
|
-
return -1;
|
394
|
-
}
|
393
|
+
GIT_ERROR_CHECK_BLOBSIZE(size);
|
394
|
+
blobsize = (size_t)size;
|
395
395
|
|
396
396
|
stream = git__calloc(1, sizeof(fake_wstream));
|
397
|
-
|
397
|
+
GIT_ERROR_CHECK_ALLOC(stream);
|
398
398
|
|
399
|
-
stream->size =
|
399
|
+
stream->size = blobsize;
|
400
400
|
stream->type = type;
|
401
|
-
stream->buffer = git__malloc(
|
401
|
+
stream->buffer = git__malloc(blobsize);
|
402
402
|
if (stream->buffer == NULL) {
|
403
403
|
git__free(stream);
|
404
404
|
return -1;
|
@@ -441,7 +441,7 @@ static int backend_sort_cmp(const void *a, const void *b)
|
|
441
441
|
int git_odb_new(git_odb **out)
|
442
442
|
{
|
443
443
|
git_odb *db = git__calloc(1, sizeof(*db));
|
444
|
-
|
444
|
+
GIT_ERROR_CHECK_ALLOC(db);
|
445
445
|
|
446
446
|
if (git_cache_init(&db->own_cache) < 0 ||
|
447
447
|
git_vector_init(&db->backends, 4, backend_sort_cmp) < 0) {
|
@@ -462,13 +462,13 @@ static int add_backend_internal(
|
|
462
462
|
|
463
463
|
assert(odb && backend);
|
464
464
|
|
465
|
-
|
465
|
+
GIT_ERROR_CHECK_VERSION(backend, GIT_ODB_BACKEND_VERSION, "git_odb_backend");
|
466
466
|
|
467
467
|
/* Check if the backend is already owned by another ODB */
|
468
468
|
assert(!backend->odb || backend->odb == odb);
|
469
469
|
|
470
470
|
internal = git__malloc(sizeof(backend_internal));
|
471
|
-
|
471
|
+
GIT_ERROR_CHECK_ALLOC(internal);
|
472
472
|
|
473
473
|
internal->backend = backend;
|
474
474
|
internal->priority = priority;
|
@@ -503,7 +503,7 @@ size_t git_odb_num_backends(git_odb *odb)
|
|
503
503
|
|
504
504
|
static int git_odb__error_unsupported_in_backend(const char *action)
|
505
505
|
{
|
506
|
-
|
506
|
+
git_error_set(GIT_ERROR_ODB,
|
507
507
|
"cannot %s - unsupported in the loaded odb backends", action);
|
508
508
|
return -1;
|
509
509
|
}
|
@@ -521,7 +521,7 @@ int git_odb_get_backend(git_odb_backend **out, git_odb *odb, size_t pos)
|
|
521
521
|
return 0;
|
522
522
|
}
|
523
523
|
|
524
|
-
|
524
|
+
git_error_set(GIT_ERROR_ODB, "no ODB backend loaded at index %" PRIuZ, pos);
|
525
525
|
return GIT_ENOTFOUND;
|
526
526
|
}
|
527
527
|
|
@@ -546,7 +546,7 @@ int git_odb__add_default_backends(
|
|
546
546
|
if (as_alternates)
|
547
547
|
return 0;
|
548
548
|
|
549
|
-
|
549
|
+
git_error_set(GIT_ERROR_ODB, "failed to load object database in '%s'", objects_dir);
|
550
550
|
return -1;
|
551
551
|
}
|
552
552
|
|
@@ -588,12 +588,12 @@ static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_
|
|
588
588
|
return -1;
|
589
589
|
|
590
590
|
if (git_path_exists(alternates_path.ptr) == false) {
|
591
|
-
|
591
|
+
git_buf_dispose(&alternates_path);
|
592
592
|
return 0;
|
593
593
|
}
|
594
594
|
|
595
595
|
if (git_futils_readbuffer(&alternates_buf, alternates_path.ptr) < 0) {
|
596
|
-
|
596
|
+
git_buf_dispose(&alternates_path);
|
597
597
|
return -1;
|
598
598
|
}
|
599
599
|
|
@@ -619,8 +619,8 @@ static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_
|
|
619
619
|
break;
|
620
620
|
}
|
621
621
|
|
622
|
-
|
623
|
-
|
622
|
+
git_buf_dispose(&alternates_path);
|
623
|
+
git_buf_dispose(&alternates_buf);
|
624
624
|
|
625
625
|
return result;
|
626
626
|
}
|
@@ -657,7 +657,7 @@ int git_odb__set_caps(git_odb *odb, int caps)
|
|
657
657
|
int val;
|
658
658
|
|
659
659
|
if (!repo) {
|
660
|
-
|
660
|
+
git_error_set(GIT_ERROR_ODB, "cannot access repository to set odb caps");
|
661
661
|
return -1;
|
662
662
|
}
|
663
663
|
|
@@ -871,7 +871,7 @@ int git_odb_expand_ids(
|
|
871
871
|
int error = GIT_EAMBIGUOUS;
|
872
872
|
|
873
873
|
if (!query->type)
|
874
|
-
query->type =
|
874
|
+
query->type = GIT_OBJECT_ANY;
|
875
875
|
|
876
876
|
/* if we have a short OID, expand it first */
|
877
877
|
if (query->length >= GIT_OID_MINPREFIXLEN && query->length < GIT_OID_HEXSZ) {
|
@@ -889,11 +889,11 @@ int git_odb_expand_ids(
|
|
889
889
|
* or because the user passed a full OID. Ensure its type is right.
|
890
890
|
*/
|
891
891
|
if (query->length >= GIT_OID_HEXSZ) {
|
892
|
-
|
892
|
+
git_object_t actual_type;
|
893
893
|
|
894
894
|
error = odb_otype_fast(&actual_type, db, &query->id);
|
895
895
|
if (!error) {
|
896
|
-
if (query->type !=
|
896
|
+
if (query->type != GIT_OBJECT_ANY && query->type != actual_type)
|
897
897
|
error = GIT_ENOTFOUND;
|
898
898
|
else
|
899
899
|
query->type = actual_type;
|
@@ -919,11 +919,11 @@ int git_odb_expand_ids(
|
|
919
919
|
}
|
920
920
|
}
|
921
921
|
|
922
|
-
|
922
|
+
git_error_clear();
|
923
923
|
return 0;
|
924
924
|
}
|
925
925
|
|
926
|
-
int git_odb_read_header(size_t *len_p,
|
926
|
+
int git_odb_read_header(size_t *len_p, git_object_t *type_p, git_odb *db, const git_oid *id)
|
927
927
|
{
|
928
928
|
int error;
|
929
929
|
git_odb_object *object;
|
@@ -937,15 +937,15 @@ int git_odb_read_header(size_t *len_p, git_otype *type_p, git_odb *db, const git
|
|
937
937
|
}
|
938
938
|
|
939
939
|
static int odb_read_header_1(
|
940
|
-
size_t *len_p,
|
940
|
+
size_t *len_p, git_object_t *type_p, git_odb *db,
|
941
941
|
const git_oid *id, bool only_refreshed)
|
942
942
|
{
|
943
943
|
size_t i;
|
944
|
-
|
944
|
+
git_object_t ht;
|
945
945
|
bool passthrough = false;
|
946
946
|
int error;
|
947
947
|
|
948
|
-
if (!only_refreshed && (ht = odb_hardcoded_type(id)) !=
|
948
|
+
if (!only_refreshed && (ht = odb_hardcoded_type(id)) != GIT_OBJECT_INVALID) {
|
949
949
|
*type_p = ht;
|
950
950
|
*len_p = 0;
|
951
951
|
return 0;
|
@@ -980,7 +980,7 @@ static int odb_read_header_1(
|
|
980
980
|
}
|
981
981
|
|
982
982
|
int git_odb__read_header_or_object(
|
983
|
-
git_odb_object **out, size_t *len_p,
|
983
|
+
git_odb_object **out, size_t *len_p, git_object_t *type_p,
|
984
984
|
git_odb *db, const git_oid *id)
|
985
985
|
{
|
986
986
|
int error = GIT_ENOTFOUND;
|
@@ -1075,7 +1075,7 @@ static int odb_read_1(git_odb_object **out, git_odb *db, const git_oid *id,
|
|
1075
1075
|
}
|
1076
1076
|
}
|
1077
1077
|
|
1078
|
-
|
1078
|
+
git_error_clear();
|
1079
1079
|
if ((object = odb_object__alloc(id, &raw)) == NULL) {
|
1080
1080
|
error = -1;
|
1081
1081
|
goto out;
|
@@ -1113,7 +1113,7 @@ int git_odb_read(git_odb_object **out, git_odb *db, const git_oid *id)
|
|
1113
1113
|
return error;
|
1114
1114
|
}
|
1115
1115
|
|
1116
|
-
static int odb_otype_fast(
|
1116
|
+
static int odb_otype_fast(git_object_t *type_p, git_odb *db, const git_oid *id)
|
1117
1117
|
{
|
1118
1118
|
git_odb_object *object;
|
1119
1119
|
size_t _unused;
|
@@ -1181,7 +1181,7 @@ static int read_prefix_1(git_odb_object **out, git_odb *db,
|
|
1181
1181
|
git_oid_tostr_s(&found_full_oid));
|
1182
1182
|
|
1183
1183
|
error = git_odb__error_ambiguous(buf.ptr);
|
1184
|
-
|
1184
|
+
git_buf_dispose(&buf);
|
1185
1185
|
goto out;
|
1186
1186
|
}
|
1187
1187
|
|
@@ -1260,7 +1260,7 @@ int git_odb_foreach(git_odb *db, git_odb_foreach_cb cb, void *payload)
|
|
1260
1260
|
git_vector_foreach(&db->backends, i, internal) {
|
1261
1261
|
git_odb_backend *b = internal->backend;
|
1262
1262
|
int error = b->foreach(b, cb, payload);
|
1263
|
-
if (error
|
1263
|
+
if (error != 0)
|
1264
1264
|
return error;
|
1265
1265
|
}
|
1266
1266
|
|
@@ -1268,7 +1268,7 @@ int git_odb_foreach(git_odb *db, git_odb_foreach_cb cb, void *payload)
|
|
1268
1268
|
}
|
1269
1269
|
|
1270
1270
|
int git_odb_write(
|
1271
|
-
git_oid *oid, git_odb *db, const void *data, size_t len,
|
1271
|
+
git_oid *oid, git_odb *db, const void *data, size_t len, git_object_t type)
|
1272
1272
|
{
|
1273
1273
|
size_t i;
|
1274
1274
|
int error = GIT_ERROR;
|
@@ -1313,7 +1313,7 @@ int git_odb_write(
|
|
1313
1313
|
return error;
|
1314
1314
|
}
|
1315
1315
|
|
1316
|
-
static int hash_header(git_hash_ctx *ctx, git_off_t size,
|
1316
|
+
static int hash_header(git_hash_ctx *ctx, git_off_t size, git_object_t type)
|
1317
1317
|
{
|
1318
1318
|
char header[64];
|
1319
1319
|
size_t hdrlen;
|
@@ -1327,7 +1327,7 @@ static int hash_header(git_hash_ctx *ctx, git_off_t size, git_otype type)
|
|
1327
1327
|
}
|
1328
1328
|
|
1329
1329
|
int git_odb_open_wstream(
|
1330
|
-
git_odb_stream **stream, git_odb *db, git_off_t size,
|
1330
|
+
git_odb_stream **stream, git_odb *db, git_off_t size, git_object_t type)
|
1331
1331
|
{
|
1332
1332
|
size_t i, writes = 0;
|
1333
1333
|
int error = GIT_ERROR;
|
@@ -1362,7 +1362,7 @@ int git_odb_open_wstream(
|
|
1362
1362
|
}
|
1363
1363
|
|
1364
1364
|
ctx = git__malloc(sizeof(git_hash_ctx));
|
1365
|
-
|
1365
|
+
GIT_ERROR_CHECK_ALLOC(ctx);
|
1366
1366
|
|
1367
1367
|
if ((error = git_hash_ctx_init(ctx)) < 0 ||
|
1368
1368
|
(error = hash_header(ctx, size, type)) < 0)
|
@@ -1382,7 +1382,7 @@ static int git_odb_stream__invalid_length(
|
|
1382
1382
|
const git_odb_stream *stream,
|
1383
1383
|
const char *action)
|
1384
1384
|
{
|
1385
|
-
|
1385
|
+
git_error_set(GIT_ERROR_ODB,
|
1386
1386
|
"cannot %s - "
|
1387
1387
|
"Invalid length. %"PRId64" was expected. The "
|
1388
1388
|
"total size of the received chunks amounts to %"PRId64".",
|
@@ -1436,7 +1436,7 @@ void git_odb_stream_free(git_odb_stream *stream)
|
|
1436
1436
|
int git_odb_open_rstream(
|
1437
1437
|
git_odb_stream **stream,
|
1438
1438
|
size_t *len,
|
1439
|
-
|
1439
|
+
git_object_t *type,
|
1440
1440
|
git_odb *db,
|
1441
1441
|
const git_oid *oid)
|
1442
1442
|
{
|
@@ -1524,7 +1524,7 @@ int git_odb__error_mismatch(const git_oid *expected, const git_oid *actual)
|
|
1524
1524
|
git_oid_tostr(expected_oid, sizeof(expected_oid), expected);
|
1525
1525
|
git_oid_tostr(actual_oid, sizeof(actual_oid), actual);
|
1526
1526
|
|
1527
|
-
|
1527
|
+
git_error_set(GIT_ERROR_ODB, "object hash mismatch - expected %s but got %s",
|
1528
1528
|
expected_oid, actual_oid);
|
1529
1529
|
|
1530
1530
|
return GIT_EMISMATCH;
|
@@ -1536,23 +1536,23 @@ int git_odb__error_notfound(
|
|
1536
1536
|
if (oid != NULL) {
|
1537
1537
|
char oid_str[GIT_OID_HEXSZ + 1];
|
1538
1538
|
git_oid_tostr(oid_str, oid_len+1, oid);
|
1539
|
-
|
1539
|
+
git_error_set(GIT_ERROR_ODB, "object not found - %s (%.*s)",
|
1540
1540
|
message, (int) oid_len, oid_str);
|
1541
1541
|
} else
|
1542
|
-
|
1542
|
+
git_error_set(GIT_ERROR_ODB, "object not found - %s", message);
|
1543
1543
|
|
1544
1544
|
return GIT_ENOTFOUND;
|
1545
1545
|
}
|
1546
1546
|
|
1547
1547
|
static int error_null_oid(int error, const char *message)
|
1548
1548
|
{
|
1549
|
-
|
1549
|
+
git_error_set(GIT_ERROR_ODB, "odb: %s: null OID cannot exist", message);
|
1550
1550
|
return error;
|
1551
1551
|
}
|
1552
1552
|
|
1553
1553
|
int git_odb__error_ambiguous(const char *message)
|
1554
1554
|
{
|
1555
|
-
|
1555
|
+
git_error_set(GIT_ERROR_ODB, "ambiguous SHA1 prefix - %s", message);
|
1556
1556
|
return GIT_EAMBIGUOUS;
|
1557
1557
|
}
|
1558
1558
|
|