rugged 0.17.0.b7 → 0.18.0.b1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/README.md +88 -32
- data/ext/rugged/extconf.rb +4 -2
- data/ext/rugged/rugged.c +72 -10
- data/ext/rugged/rugged.h +14 -10
- data/ext/rugged/rugged_blob.c +8 -10
- data/ext/rugged/rugged_branch.c +11 -14
- data/ext/rugged/rugged_commit.c +31 -24
- data/ext/rugged/rugged_config.c +2 -2
- data/ext/rugged/rugged_index.c +133 -198
- data/ext/rugged/rugged_note.c +372 -0
- data/ext/rugged/rugged_object.c +50 -22
- data/ext/rugged/rugged_reference.c +122 -130
- data/ext/rugged/rugged_remote.c +72 -29
- data/ext/rugged/rugged_repo.c +402 -20
- data/ext/rugged/rugged_revwalk.c +7 -3
- data/ext/rugged/rugged_settings.c +110 -0
- data/ext/rugged/rugged_signature.c +23 -7
- data/ext/rugged/rugged_tag.c +32 -16
- data/ext/rugged/rugged_tree.c +44 -15
- data/lib/rugged.rb +1 -0
- data/lib/rugged/index.rb +8 -0
- data/lib/rugged/remote.rb +13 -0
- data/lib/rugged/repository.rb +3 -3
- data/lib/rugged/version.rb +1 -1
- data/test/blob_test.rb +13 -15
- data/test/branch_test.rb +32 -67
- data/test/commit_test.rb +50 -12
- data/test/config_test.rb +12 -11
- data/test/coverage/HEAD.json +1 -1
- data/test/coverage/cover.rb +40 -21
- data/test/errors_test.rb +34 -0
- data/test/fixtures/alternate/objects/14/6ae76773c91e3b1d00cf7a338ec55ae58297e2 +0 -0
- data/test/fixtures/alternate/objects/14/9c32d47e99d0a3572ff1e70a2e0051bbf347a9 +0 -0
- data/test/fixtures/alternate/objects/14/fb3108588f9421bf764041e5e3ac305eb6277f +0 -0
- data/test/fixtures/testrepo.git/logs/refs/notes/commits +1 -0
- data/test/fixtures/testrepo.git/objects/44/1034f860c1d5d90e4188d11ae0d325176869a8 +1 -0
- data/test/fixtures/testrepo.git/objects/60/d415052a33de2150bf68757f6461df4f563ae4 +0 -0
- data/test/fixtures/testrepo.git/objects/68/8a8f4ef7496901d15322972f96e212a9e466cc +1 -0
- data/test/fixtures/testrepo.git/objects/94/eca2de348d5f672faf56b0decafa5937e3235e +0 -0
- data/test/fixtures/testrepo.git/objects/9b/7384fe1676186192842f5d3e129457b62db9e3 +0 -0
- data/test/fixtures/testrepo.git/objects/b7/4713326bc972cc15751ed504dca6f6f3b91f7a +3 -0
- data/test/fixtures/testrepo.git/refs/notes/commits +1 -0
- data/test/index_test.rb +65 -69
- data/test/lib_test.rb +76 -11
- data/test/note_test.rb +158 -0
- data/test/object_test.rb +8 -11
- data/test/reference_test.rb +77 -85
- data/test/remote_test.rb +86 -8
- data/test/repo_pack_test.rb +9 -7
- data/test/repo_reset_test.rb +80 -0
- data/test/repo_test.rb +176 -53
- data/test/tag_test.rb +44 -7
- data/test/test_helper.rb +63 -35
- data/test/tree_test.rb +34 -13
- data/test/walker_test.rb +14 -14
- data/vendor/libgit2/Makefile.embed +1 -1
- data/vendor/libgit2/deps/http-parser/http_parser.c +974 -578
- data/vendor/libgit2/deps/http-parser/http_parser.h +106 -70
- data/vendor/libgit2/deps/regex/regcomp.c +7 -6
- data/vendor/libgit2/deps/regex/regex_internal.c +1 -1
- data/vendor/libgit2/deps/regex/regex_internal.h +12 -3
- data/vendor/libgit2/deps/regex/regexec.c +5 -5
- data/vendor/libgit2/include/git2.h +5 -1
- data/vendor/libgit2/include/git2/attr.h +4 -2
- data/vendor/libgit2/include/git2/blob.h +39 -12
- data/vendor/libgit2/include/git2/branch.h +123 -35
- data/vendor/libgit2/include/git2/checkout.h +206 -48
- data/vendor/libgit2/include/git2/clone.h +72 -27
- data/vendor/libgit2/include/git2/commit.h +20 -17
- data/vendor/libgit2/include/git2/common.h +67 -1
- data/vendor/libgit2/include/git2/config.h +81 -60
- data/vendor/libgit2/include/git2/cred_helpers.h +53 -0
- data/vendor/libgit2/include/git2/diff.h +459 -150
- data/vendor/libgit2/include/git2/errors.h +9 -1
- data/vendor/libgit2/include/git2/graph.h +41 -0
- data/vendor/libgit2/include/git2/ignore.h +7 -6
- data/vendor/libgit2/include/git2/index.h +323 -97
- data/vendor/libgit2/include/git2/indexer.h +27 -59
- data/vendor/libgit2/include/git2/inttypes.h +4 -0
- data/vendor/libgit2/include/git2/merge.h +13 -3
- data/vendor/libgit2/include/git2/message.h +14 -8
- data/vendor/libgit2/include/git2/net.h +9 -7
- data/vendor/libgit2/include/git2/notes.h +88 -29
- data/vendor/libgit2/include/git2/object.h +16 -6
- data/vendor/libgit2/include/git2/odb.h +80 -17
- data/vendor/libgit2/include/git2/odb_backend.h +47 -11
- data/vendor/libgit2/include/git2/oid.h +26 -17
- data/vendor/libgit2/include/git2/pack.h +62 -8
- data/vendor/libgit2/include/git2/push.h +131 -0
- data/vendor/libgit2/include/git2/refdb.h +103 -0
- data/vendor/libgit2/include/git2/refdb_backend.h +109 -0
- data/vendor/libgit2/include/git2/reflog.h +30 -21
- data/vendor/libgit2/include/git2/refs.h +215 -193
- data/vendor/libgit2/include/git2/refspec.h +22 -2
- data/vendor/libgit2/include/git2/remote.h +158 -37
- data/vendor/libgit2/include/git2/repository.h +150 -31
- data/vendor/libgit2/include/git2/reset.h +43 -9
- data/vendor/libgit2/include/git2/revparse.h +48 -4
- data/vendor/libgit2/include/git2/revwalk.h +25 -10
- data/vendor/libgit2/include/git2/signature.h +20 -12
- data/vendor/libgit2/include/git2/stash.h +121 -0
- data/vendor/libgit2/include/git2/status.h +122 -53
- data/vendor/libgit2/include/git2/strarray.h +17 -11
- data/vendor/libgit2/include/git2/submodule.h +42 -7
- data/vendor/libgit2/include/git2/tag.h +72 -59
- data/vendor/libgit2/include/git2/threads.h +4 -2
- data/vendor/libgit2/include/git2/trace.h +68 -0
- data/vendor/libgit2/include/git2/transport.h +328 -0
- data/vendor/libgit2/include/git2/tree.h +149 -120
- data/vendor/libgit2/include/git2/types.h +13 -12
- data/vendor/libgit2/include/git2/version.h +3 -3
- data/vendor/libgit2/src/amiga/map.c +2 -2
- data/vendor/libgit2/src/attr.c +58 -48
- data/vendor/libgit2/src/attr.h +4 -18
- data/vendor/libgit2/src/attr_file.c +30 -6
- data/vendor/libgit2/src/attr_file.h +6 -8
- data/vendor/libgit2/src/attrcache.h +24 -0
- data/vendor/libgit2/src/blob.c +30 -7
- data/vendor/libgit2/src/blob.h +1 -1
- data/vendor/libgit2/src/branch.c +361 -68
- data/vendor/libgit2/src/branch.h +17 -0
- data/vendor/libgit2/src/bswap.h +1 -1
- data/vendor/libgit2/src/buf_text.c +291 -0
- data/vendor/libgit2/src/buf_text.h +122 -0
- data/vendor/libgit2/src/buffer.c +27 -101
- data/vendor/libgit2/src/buffer.h +54 -39
- data/vendor/libgit2/src/cache.c +15 -6
- data/vendor/libgit2/src/cache.h +1 -1
- data/vendor/libgit2/src/cc-compat.h +3 -1
- data/vendor/libgit2/src/checkout.c +1165 -222
- data/vendor/libgit2/src/checkout.h +24 -0
- data/vendor/libgit2/src/clone.c +171 -86
- data/vendor/libgit2/src/commit.c +44 -45
- data/vendor/libgit2/src/commit.h +3 -3
- data/vendor/libgit2/src/commit_list.c +194 -0
- data/vendor/libgit2/src/commit_list.h +49 -0
- data/vendor/libgit2/src/common.h +44 -10
- data/vendor/libgit2/src/compress.c +1 -1
- data/vendor/libgit2/src/compress.h +1 -1
- data/vendor/libgit2/src/config.c +211 -124
- data/vendor/libgit2/src/config.h +23 -4
- data/vendor/libgit2/src/config_cache.c +2 -2
- data/vendor/libgit2/src/config_file.c +129 -53
- data/vendor/libgit2/src/config_file.h +10 -8
- data/vendor/libgit2/src/crlf.c +66 -67
- data/vendor/libgit2/src/date.c +12 -12
- data/vendor/libgit2/src/delta-apply.c +14 -1
- data/vendor/libgit2/src/delta-apply.h +18 -1
- data/vendor/libgit2/src/delta.c +40 -107
- data/vendor/libgit2/src/delta.h +19 -17
- data/vendor/libgit2/src/diff.c +347 -496
- data/vendor/libgit2/src/diff.h +27 -1
- data/vendor/libgit2/src/diff_output.c +564 -249
- data/vendor/libgit2/src/diff_output.h +15 -8
- data/vendor/libgit2/src/diff_tform.c +687 -0
- data/vendor/libgit2/src/errors.c +27 -36
- data/vendor/libgit2/src/fetch.c +13 -351
- data/vendor/libgit2/src/fetch.h +13 -3
- data/vendor/libgit2/src/fetchhead.c +295 -0
- data/vendor/libgit2/src/fetchhead.h +34 -0
- data/vendor/libgit2/src/filebuf.c +42 -15
- data/vendor/libgit2/src/filebuf.h +4 -2
- data/vendor/libgit2/src/fileops.c +466 -113
- data/vendor/libgit2/src/fileops.h +154 -28
- data/vendor/libgit2/src/filter.c +3 -75
- data/vendor/libgit2/src/filter.h +1 -29
- data/vendor/libgit2/src/fnmatch.c +1 -1
- data/vendor/libgit2/src/fnmatch.h +1 -1
- data/vendor/libgit2/src/global.c +54 -10
- data/vendor/libgit2/src/global.h +10 -1
- data/vendor/libgit2/src/graph.c +178 -0
- data/vendor/libgit2/src/hash.c +25 -52
- data/vendor/libgit2/src/hash.h +21 -9
- data/vendor/libgit2/src/{sha1/sha1.c → hash/hash_generic.c} +20 -12
- data/vendor/libgit2/src/hash/hash_generic.h +24 -0
- data/vendor/libgit2/src/hash/hash_openssl.h +45 -0
- data/vendor/libgit2/src/hash/hash_win32.c +291 -0
- data/vendor/libgit2/src/hash/hash_win32.h +140 -0
- data/vendor/libgit2/src/hashsig.c +368 -0
- data/vendor/libgit2/src/hashsig.h +72 -0
- data/vendor/libgit2/src/ignore.c +22 -15
- data/vendor/libgit2/src/ignore.h +6 -1
- data/vendor/libgit2/src/index.c +770 -171
- data/vendor/libgit2/src/index.h +13 -5
- data/vendor/libgit2/src/indexer.c +286 -431
- data/vendor/libgit2/src/iterator.c +854 -466
- data/vendor/libgit2/src/iterator.h +134 -109
- data/vendor/libgit2/src/map.h +1 -1
- data/vendor/libgit2/src/merge.c +296 -0
- data/vendor/libgit2/src/merge.h +22 -0
- data/vendor/libgit2/src/message.c +1 -1
- data/vendor/libgit2/src/message.h +1 -1
- data/vendor/libgit2/src/mwindow.c +35 -30
- data/vendor/libgit2/src/mwindow.h +2 -2
- data/vendor/libgit2/src/netops.c +162 -98
- data/vendor/libgit2/src/netops.h +50 -15
- data/vendor/libgit2/src/notes.c +109 -58
- data/vendor/libgit2/src/notes.h +2 -1
- data/vendor/libgit2/src/object.c +46 -57
- data/vendor/libgit2/src/object.h +1 -8
- data/vendor/libgit2/src/odb.c +151 -40
- data/vendor/libgit2/src/odb.h +5 -1
- data/vendor/libgit2/src/odb_loose.c +4 -5
- data/vendor/libgit2/src/odb_pack.c +122 -80
- data/vendor/libgit2/src/offmap.h +65 -0
- data/vendor/libgit2/src/oid.c +12 -4
- data/vendor/libgit2/src/oidmap.h +1 -1
- data/vendor/libgit2/src/pack-objects.c +88 -61
- data/vendor/libgit2/src/pack-objects.h +8 -8
- data/vendor/libgit2/src/pack.c +293 -28
- data/vendor/libgit2/src/pack.h +49 -4
- data/vendor/libgit2/src/path.c +103 -14
- data/vendor/libgit2/src/path.h +23 -7
- data/vendor/libgit2/src/pathspec.c +168 -0
- data/vendor/libgit2/src/pathspec.h +40 -0
- data/vendor/libgit2/src/pool.c +29 -4
- data/vendor/libgit2/src/pool.h +8 -1
- data/vendor/libgit2/src/posix.c +26 -27
- data/vendor/libgit2/src/posix.h +2 -3
- data/vendor/libgit2/src/pqueue.c +23 -1
- data/vendor/libgit2/src/pqueue.h +23 -1
- data/vendor/libgit2/src/push.c +653 -0
- data/vendor/libgit2/src/push.h +51 -0
- data/vendor/libgit2/src/refdb.c +185 -0
- data/vendor/libgit2/src/refdb.h +46 -0
- data/vendor/libgit2/src/refdb_fs.c +1024 -0
- data/vendor/libgit2/src/refdb_fs.h +15 -0
- data/vendor/libgit2/src/reflog.c +77 -45
- data/vendor/libgit2/src/reflog.h +1 -3
- data/vendor/libgit2/src/refs.c +366 -1326
- data/vendor/libgit2/src/refs.h +22 -13
- data/vendor/libgit2/src/refspec.c +46 -7
- data/vendor/libgit2/src/refspec.h +11 -1
- data/vendor/libgit2/src/remote.c +758 -120
- data/vendor/libgit2/src/remote.h +10 -5
- data/vendor/libgit2/src/repo_template.h +6 -6
- data/vendor/libgit2/src/repository.c +315 -96
- data/vendor/libgit2/src/repository.h +5 -3
- data/vendor/libgit2/src/reset.c +99 -81
- data/vendor/libgit2/src/revparse.c +157 -84
- data/vendor/libgit2/src/revwalk.c +68 -470
- data/vendor/libgit2/src/revwalk.h +44 -0
- data/vendor/libgit2/src/sha1_lookup.c +1 -1
- data/vendor/libgit2/src/sha1_lookup.h +1 -1
- data/vendor/libgit2/src/signature.c +68 -200
- data/vendor/libgit2/src/signature.h +1 -1
- data/vendor/libgit2/src/stash.c +663 -0
- data/vendor/libgit2/src/status.c +101 -79
- data/vendor/libgit2/src/strmap.h +1 -1
- data/vendor/libgit2/src/submodule.c +67 -51
- data/vendor/libgit2/src/submodule.h +1 -1
- data/vendor/libgit2/src/tag.c +35 -29
- data/vendor/libgit2/src/tag.h +1 -1
- data/vendor/libgit2/src/thread-utils.c +1 -1
- data/vendor/libgit2/src/thread-utils.h +2 -2
- data/vendor/libgit2/src/trace.c +39 -0
- data/vendor/libgit2/src/trace.h +56 -0
- data/vendor/libgit2/src/transport.c +81 -34
- data/vendor/libgit2/src/transports/cred.c +60 -0
- data/vendor/libgit2/src/transports/cred_helpers.c +49 -0
- data/vendor/libgit2/src/transports/git.c +234 -127
- data/vendor/libgit2/src/transports/http.c +761 -433
- data/vendor/libgit2/src/transports/local.c +460 -64
- data/vendor/libgit2/src/transports/smart.c +345 -0
- data/vendor/libgit2/src/transports/smart.h +179 -0
- data/vendor/libgit2/src/{pkt.c → transports/smart_pkt.c} +131 -12
- data/vendor/libgit2/src/transports/smart_protocol.c +856 -0
- data/vendor/libgit2/src/transports/winhttp.c +1136 -0
- data/vendor/libgit2/src/tree-cache.c +2 -2
- data/vendor/libgit2/src/tree-cache.h +1 -1
- data/vendor/libgit2/src/tree.c +239 -166
- data/vendor/libgit2/src/tree.h +11 -2
- data/vendor/libgit2/src/tsort.c +39 -23
- data/vendor/libgit2/src/unix/map.c +1 -1
- data/vendor/libgit2/src/unix/posix.h +12 -2
- data/vendor/libgit2/src/unix/realpath.c +30 -0
- data/vendor/libgit2/src/util.c +250 -13
- data/vendor/libgit2/src/util.h +71 -14
- data/vendor/libgit2/src/vector.c +123 -60
- data/vendor/libgit2/src/vector.h +24 -22
- data/vendor/libgit2/src/win32/dir.c +1 -1
- data/vendor/libgit2/src/win32/dir.h +1 -1
- data/vendor/libgit2/src/win32/error.c +77 -0
- data/vendor/libgit2/src/win32/error.h +13 -0
- data/vendor/libgit2/src/win32/findfile.c +143 -54
- data/vendor/libgit2/src/win32/findfile.h +10 -6
- data/vendor/libgit2/src/win32/map.c +1 -1
- data/vendor/libgit2/src/win32/mingw-compat.h +1 -1
- data/vendor/libgit2/src/win32/msvc-compat.h +10 -1
- data/vendor/libgit2/src/win32/posix.h +10 -1
- data/vendor/libgit2/src/win32/posix_w32.c +132 -63
- data/vendor/libgit2/src/win32/precompiled.c +1 -1
- data/vendor/libgit2/src/win32/pthread.c +1 -1
- data/vendor/libgit2/src/win32/pthread.h +1 -1
- data/vendor/libgit2/src/win32/utf-conv.c +5 -5
- data/vendor/libgit2/src/win32/utf-conv.h +3 -3
- data/vendor/libgit2/src/win32/version.h +20 -0
- metadata +308 -252
- data/test/fixtures/testrepo.git/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 +0 -0
- data/test/fixtures/testrepo.git/objects/7f/043268ea43ce18e3540acaabf9e090c91965b0 +0 -0
- data/test/fixtures/testrepo.git/objects/a3/e05719b428a2d0ed7a55c4ce53dcc5768c6d5e +0 -0
- data/test/index_test.rb~ +0 -218
- data/vendor/libgit2/src/pkt.h +0 -91
- data/vendor/libgit2/src/ppc/sha1.c +0 -70
- data/vendor/libgit2/src/ppc/sha1.h +0 -26
- data/vendor/libgit2/src/protocol.c +0 -110
- data/vendor/libgit2/src/protocol.h +0 -21
- data/vendor/libgit2/src/sha1.h +0 -33
- data/vendor/libgit2/src/transport.h +0 -148
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (C)
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
3
|
*
|
4
4
|
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
@@ -16,14 +16,23 @@ GIT_BEGIN_DECL
|
|
16
16
|
* This is passed as the first argument to the callback to allow the
|
17
17
|
* user to see the progress.
|
18
18
|
*/
|
19
|
-
typedef struct
|
20
|
-
unsigned int
|
21
|
-
unsigned int
|
22
|
-
unsigned int
|
23
|
-
|
19
|
+
typedef struct git_transfer_progress {
|
20
|
+
unsigned int total_objects;
|
21
|
+
unsigned int indexed_objects;
|
22
|
+
unsigned int received_objects;
|
23
|
+
size_t received_bytes;
|
24
|
+
} git_transfer_progress;
|
24
25
|
|
25
26
|
|
26
|
-
|
27
|
+
/**
|
28
|
+
* Type for progress callbacks during indexing. Return a value less than zero
|
29
|
+
* to cancel the transfer.
|
30
|
+
*
|
31
|
+
* @param stats Structure containing information about the state of the transfer
|
32
|
+
* @param payload Payload provided by caller
|
33
|
+
*/
|
34
|
+
typedef int (*git_transfer_progress_callback)(const git_transfer_progress *stats, void *payload);
|
35
|
+
|
27
36
|
typedef struct git_indexer_stream git_indexer_stream;
|
28
37
|
|
29
38
|
/**
|
@@ -31,18 +40,24 @@ typedef struct git_indexer_stream git_indexer_stream;
|
|
31
40
|
*
|
32
41
|
* @param out where to store the indexer instance
|
33
42
|
* @param path to the directory where the packfile should be stored
|
43
|
+
* @param progress_cb function to call with progress information
|
44
|
+
* @param progress_payload payload for the progress callback
|
34
45
|
*/
|
35
|
-
GIT_EXTERN(int) git_indexer_stream_new(
|
46
|
+
GIT_EXTERN(int) git_indexer_stream_new(
|
47
|
+
git_indexer_stream **out,
|
48
|
+
const char *path,
|
49
|
+
git_transfer_progress_callback progress_cb,
|
50
|
+
void *progress_cb_payload);
|
36
51
|
|
37
52
|
/**
|
38
53
|
* Add data to the indexer
|
39
54
|
*
|
40
55
|
* @param idx the indexer
|
41
56
|
* @param data the data to add
|
42
|
-
* @param size the size of the data
|
57
|
+
* @param size the size of the data in bytes
|
43
58
|
* @param stats stat storage
|
44
59
|
*/
|
45
|
-
GIT_EXTERN(int) git_indexer_stream_add(git_indexer_stream *idx, const void *data, size_t size,
|
60
|
+
GIT_EXTERN(int) git_indexer_stream_add(git_indexer_stream *idx, const void *data, size_t size, git_transfer_progress *stats);
|
46
61
|
|
47
62
|
/**
|
48
63
|
* Finalize the pack and index
|
@@ -51,7 +66,7 @@ GIT_EXTERN(int) git_indexer_stream_add(git_indexer_stream *idx, const void *data
|
|
51
66
|
*
|
52
67
|
* @param idx the indexer
|
53
68
|
*/
|
54
|
-
GIT_EXTERN(int) git_indexer_stream_finalize(git_indexer_stream *idx,
|
69
|
+
GIT_EXTERN(int) git_indexer_stream_finalize(git_indexer_stream *idx, git_transfer_progress *stats);
|
55
70
|
|
56
71
|
/**
|
57
72
|
* Get the packfile's hash
|
@@ -61,7 +76,7 @@ GIT_EXTERN(int) git_indexer_stream_finalize(git_indexer_stream *idx, git_indexer
|
|
61
76
|
*
|
62
77
|
* @param idx the indexer instance
|
63
78
|
*/
|
64
|
-
GIT_EXTERN(const git_oid *) git_indexer_stream_hash(git_indexer_stream *idx);
|
79
|
+
GIT_EXTERN(const git_oid *) git_indexer_stream_hash(const git_indexer_stream *idx);
|
65
80
|
|
66
81
|
/**
|
67
82
|
* Free the indexer and its resources
|
@@ -70,53 +85,6 @@ GIT_EXTERN(const git_oid *) git_indexer_stream_hash(git_indexer_stream *idx);
|
|
70
85
|
*/
|
71
86
|
GIT_EXTERN(void) git_indexer_stream_free(git_indexer_stream *idx);
|
72
87
|
|
73
|
-
/**
|
74
|
-
* Create a new indexer instance
|
75
|
-
*
|
76
|
-
* @param out where to store the indexer instance
|
77
|
-
* @param packname the absolute filename of the packfile to index
|
78
|
-
*/
|
79
|
-
GIT_EXTERN(int) git_indexer_new(git_indexer **out, const char *packname);
|
80
|
-
|
81
|
-
/**
|
82
|
-
* Iterate over the objects in the packfile and extract the information
|
83
|
-
*
|
84
|
-
* Indexing a packfile can be very expensive so this function is
|
85
|
-
* expected to be run in a worker thread and the stats used to provide
|
86
|
-
* feedback the user.
|
87
|
-
*
|
88
|
-
* @param idx the indexer instance
|
89
|
-
* @param stats storage for the running state
|
90
|
-
*/
|
91
|
-
GIT_EXTERN(int) git_indexer_run(git_indexer *idx, git_indexer_stats *stats);
|
92
|
-
|
93
|
-
/**
|
94
|
-
* Write the index file to disk.
|
95
|
-
*
|
96
|
-
* The file will be stored as pack-$hash.idx in the same directory as
|
97
|
-
* the packfile.
|
98
|
-
*
|
99
|
-
* @param idx the indexer instance
|
100
|
-
*/
|
101
|
-
GIT_EXTERN(int) git_indexer_write(git_indexer *idx);
|
102
|
-
|
103
|
-
/**
|
104
|
-
* Get the packfile's hash
|
105
|
-
*
|
106
|
-
* A packfile's name is derived from the sorted hashing of all object
|
107
|
-
* names. This is only correct after the index has been written to disk.
|
108
|
-
*
|
109
|
-
* @param idx the indexer instance
|
110
|
-
*/
|
111
|
-
GIT_EXTERN(const git_oid *) git_indexer_hash(git_indexer *idx);
|
112
|
-
|
113
|
-
/**
|
114
|
-
* Free the indexer and its resources
|
115
|
-
*
|
116
|
-
* @param idx the indexer to free
|
117
|
-
*/
|
118
|
-
GIT_EXTERN(void) git_indexer_free(git_indexer *idx);
|
119
|
-
|
120
88
|
GIT_END_DECL
|
121
89
|
|
122
90
|
#endif
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (C)
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
3
|
*
|
4
4
|
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
@@ -27,8 +27,13 @@ GIT_BEGIN_DECL
|
|
27
27
|
* @param repo the repository where the commits exist
|
28
28
|
* @param one one of the commits
|
29
29
|
* @param two the other commit
|
30
|
+
* @return Zero on success; GIT_ENOTFOUND or -1 on failure.
|
30
31
|
*/
|
31
|
-
GIT_EXTERN(int) git_merge_base(
|
32
|
+
GIT_EXTERN(int) git_merge_base(
|
33
|
+
git_oid *out,
|
34
|
+
git_repository *repo,
|
35
|
+
const git_oid *one,
|
36
|
+
const git_oid *two);
|
32
37
|
|
33
38
|
/**
|
34
39
|
* Find a merge base given a list of commits
|
@@ -37,8 +42,13 @@ GIT_EXTERN(int) git_merge_base(git_oid *out, git_repository *repo, const git_oid
|
|
37
42
|
* @param repo the repository where the commits exist
|
38
43
|
* @param input_array oids of the commits
|
39
44
|
* @param length The number of commits in the provided `input_array`
|
45
|
+
* @return Zero on success; GIT_ENOTFOUND or -1 on failure.
|
40
46
|
*/
|
41
|
-
GIT_EXTERN(int) git_merge_base_many(
|
47
|
+
GIT_EXTERN(int) git_merge_base_many(
|
48
|
+
git_oid *out,
|
49
|
+
git_repository *repo,
|
50
|
+
const git_oid input_array[],
|
51
|
+
size_t length);
|
42
52
|
|
43
53
|
/** @} */
|
44
54
|
GIT_END_DECL
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (C)
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
3
|
*
|
4
4
|
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
@@ -23,21 +23,27 @@ GIT_BEGIN_DECL
|
|
23
23
|
*
|
24
24
|
* Optionally, can remove lines starting with a "#".
|
25
25
|
*
|
26
|
-
* @param
|
27
|
-
*
|
28
|
-
* prettified message as the output value.
|
26
|
+
* @param out The user-allocated buffer which will be filled with the
|
27
|
+
* cleaned up message. Pass NULL if you just want to get the needed
|
28
|
+
* size of the prettified message as the output value.
|
29
29
|
*
|
30
|
-
* @param
|
30
|
+
* @param out_size Size of the `out` buffer in bytes.
|
31
31
|
*
|
32
32
|
* @param message The message to be prettified.
|
33
33
|
*
|
34
|
-
* @param strip_comments
|
34
|
+
* @param strip_comments Non-zero to remove lines starting with "#", 0 to
|
35
|
+
* leave them in.
|
35
36
|
*
|
36
37
|
* @return -1 on error, else number of characters in prettified message
|
37
|
-
*
|
38
|
+
* including the trailing NUL byte
|
38
39
|
*/
|
39
|
-
GIT_EXTERN(int) git_message_prettify(
|
40
|
+
GIT_EXTERN(int) git_message_prettify(
|
41
|
+
char *out,
|
42
|
+
size_t out_size,
|
43
|
+
const char *message,
|
44
|
+
int strip_comments);
|
40
45
|
|
41
46
|
/** @} */
|
42
47
|
GIT_END_DECL
|
48
|
+
|
43
49
|
#endif /* INCLUDE_git_message_h__ */
|
@@ -1,11 +1,11 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (C)
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
3
|
*
|
4
4
|
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
6
6
|
*/
|
7
|
-
#ifndef
|
8
|
-
#define
|
7
|
+
#ifndef INCLUDE_git_net_h__
|
8
|
+
#define INCLUDE_git_net_h__
|
9
9
|
|
10
10
|
#include "common.h"
|
11
11
|
#include "oid.h"
|
@@ -27,15 +27,17 @@ GIT_BEGIN_DECL
|
|
27
27
|
* gets called.
|
28
28
|
*/
|
29
29
|
|
30
|
-
|
31
|
-
|
30
|
+
typedef enum {
|
31
|
+
GIT_DIRECTION_FETCH = 0,
|
32
|
+
GIT_DIRECTION_PUSH = 1
|
33
|
+
} git_direction;
|
32
34
|
|
33
35
|
|
34
36
|
/**
|
35
37
|
* Remote head description, given out on `ls` calls.
|
36
38
|
*/
|
37
39
|
struct git_remote_head {
|
38
|
-
int local
|
40
|
+
int local; /* available locally */
|
39
41
|
git_oid oid;
|
40
42
|
git_oid loid;
|
41
43
|
char *name;
|
@@ -44,7 +46,7 @@ struct git_remote_head {
|
|
44
46
|
/**
|
45
47
|
* Callback for listing the remote heads
|
46
48
|
*/
|
47
|
-
typedef int (*git_headlist_cb)(git_remote_head
|
49
|
+
typedef int (*git_headlist_cb)(git_remote_head *rhead, void *payload);
|
48
50
|
|
49
51
|
/** @} */
|
50
52
|
GIT_END_DECL
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (C)
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
3
|
*
|
4
4
|
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
5
|
* a Linking Exception. For full terms see the included COPYING file.
|
@@ -18,21 +18,83 @@
|
|
18
18
|
*/
|
19
19
|
GIT_BEGIN_DECL
|
20
20
|
|
21
|
+
/**
|
22
|
+
* Callback for git_note_foreach.
|
23
|
+
*
|
24
|
+
* Receives:
|
25
|
+
* - blob_id: Oid of the blob containing the message
|
26
|
+
* - annotated_object_id: Oid of the git object being annotated
|
27
|
+
* - payload: Payload data passed to `git_note_foreach`
|
28
|
+
*/
|
29
|
+
typedef int (*git_note_foreach_cb)(
|
30
|
+
const git_oid *blob_id, const git_oid *annotated_object_id, void *payload);
|
31
|
+
|
32
|
+
/**
|
33
|
+
* note iterator
|
34
|
+
*/
|
35
|
+
typedef struct git_iterator git_note_iterator;
|
36
|
+
|
37
|
+
/**
|
38
|
+
* Creates a new iterator for notes
|
39
|
+
*
|
40
|
+
* The iterator must be freed manually by the user.
|
41
|
+
*
|
42
|
+
* @param out pointer to the iterator
|
43
|
+
* @param repo repository where to look up the note
|
44
|
+
* @param notes_ref canonical name of the reference to use (optional); defaults to
|
45
|
+
* "refs/notes/commits"
|
46
|
+
*
|
47
|
+
* @return 0 or an error code
|
48
|
+
*/
|
49
|
+
GIT_EXTERN(int) git_note_iterator_new(
|
50
|
+
git_note_iterator **out,
|
51
|
+
git_repository *repo,
|
52
|
+
const char *notes_ref);
|
53
|
+
|
54
|
+
/**
|
55
|
+
* Frees an git_note_iterator
|
56
|
+
*
|
57
|
+
* @param it pointer to the iterator
|
58
|
+
*/
|
59
|
+
GIT_EXTERN(void) git_note_iterator_free(git_note_iterator *it);
|
60
|
+
|
61
|
+
/**
|
62
|
+
* Returns the current item (note_id and annotated_id) and advance the iterator
|
63
|
+
* internally to the next value
|
64
|
+
*
|
65
|
+
* The notes must not be freed manually by the user.
|
66
|
+
*
|
67
|
+
* @param it pointer to the iterator
|
68
|
+
* @param note_id id of blob containing the message
|
69
|
+
* @param annotated_id id of the git object being annotated
|
70
|
+
*
|
71
|
+
* @return 0 (no error), GIT_ITEROVER (iteration is done) or an error code
|
72
|
+
* (negative value)
|
73
|
+
*/
|
74
|
+
GIT_EXTERN(int) git_note_next(
|
75
|
+
git_oid* note_id,
|
76
|
+
git_oid* annotated_id,
|
77
|
+
git_note_iterator *it);
|
78
|
+
|
79
|
+
|
21
80
|
/**
|
22
81
|
* Read the note for an object
|
23
82
|
*
|
24
83
|
* The note must be freed manually by the user.
|
25
84
|
*
|
26
|
-
* @param
|
85
|
+
* @param out pointer to the read note; NULL in case of error
|
27
86
|
* @param repo repository where to look up the note
|
28
|
-
* @param notes_ref canonical name of the reference to use (optional);
|
29
|
-
*
|
87
|
+
* @param notes_ref canonical name of the reference to use (optional); defaults to
|
88
|
+
* "refs/notes/commits"
|
30
89
|
* @param oid OID of the git object to read the note from
|
31
90
|
*
|
32
91
|
* @return 0 or an error code
|
33
92
|
*/
|
34
|
-
GIT_EXTERN(int) git_note_read(
|
35
|
-
|
93
|
+
GIT_EXTERN(int) git_note_read(
|
94
|
+
git_note **out,
|
95
|
+
git_repository *repo,
|
96
|
+
const char *notes_ref,
|
97
|
+
const git_oid *oid);
|
36
98
|
|
37
99
|
/**
|
38
100
|
* Get the note message
|
@@ -40,7 +102,7 @@ GIT_EXTERN(int) git_note_read(git_note **note, git_repository *repo,
|
|
40
102
|
* @param note
|
41
103
|
* @return the note message
|
42
104
|
*/
|
43
|
-
GIT_EXTERN(const char *) git_note_message(git_note *note);
|
105
|
+
GIT_EXTERN(const char *) git_note_message(const git_note *note);
|
44
106
|
|
45
107
|
|
46
108
|
/**
|
@@ -49,7 +111,7 @@ GIT_EXTERN(const char *) git_note_message(git_note *note);
|
|
49
111
|
* @param note
|
50
112
|
* @return the note object OID
|
51
113
|
*/
|
52
|
-
GIT_EXTERN(const git_oid *) git_note_oid(git_note *note);
|
114
|
+
GIT_EXTERN(const git_oid *) git_note_oid(const git_note *note);
|
53
115
|
|
54
116
|
/**
|
55
117
|
* Add a note for an object
|
@@ -62,13 +124,19 @@ GIT_EXTERN(const git_oid *) git_note_oid(git_note *note);
|
|
62
124
|
* defaults to "refs/notes/commits"
|
63
125
|
* @param oid OID of the git object to decorate
|
64
126
|
* @param note Content of the note to add for object oid
|
127
|
+
* @param force Overwrite existing note
|
65
128
|
*
|
66
129
|
* @return 0 or an error code
|
67
130
|
*/
|
68
|
-
GIT_EXTERN(int) git_note_create(
|
69
|
-
|
70
|
-
|
71
|
-
|
131
|
+
GIT_EXTERN(int) git_note_create(
|
132
|
+
git_oid *out,
|
133
|
+
git_repository *repo,
|
134
|
+
const git_signature *author,
|
135
|
+
const git_signature *committer,
|
136
|
+
const char *notes_ref,
|
137
|
+
const git_oid *oid,
|
138
|
+
const char *note,
|
139
|
+
int force);
|
72
140
|
|
73
141
|
|
74
142
|
/**
|
@@ -83,9 +151,12 @@ GIT_EXTERN(int) git_note_create(git_oid *out, git_repository *repo,
|
|
83
151
|
*
|
84
152
|
* @return 0 or an error code
|
85
153
|
*/
|
86
|
-
GIT_EXTERN(int) git_note_remove(
|
87
|
-
|
88
|
-
|
154
|
+
GIT_EXTERN(int) git_note_remove(
|
155
|
+
git_repository *repo,
|
156
|
+
const char *notes_ref,
|
157
|
+
const git_signature *author,
|
158
|
+
const git_signature *committer,
|
159
|
+
const git_oid *oid);
|
89
160
|
|
90
161
|
/**
|
91
162
|
* Free a git_note object
|
@@ -104,17 +175,6 @@ GIT_EXTERN(void) git_note_free(git_note *note);
|
|
104
175
|
*/
|
105
176
|
GIT_EXTERN(int) git_note_default_ref(const char **out, git_repository *repo);
|
106
177
|
|
107
|
-
/**
|
108
|
-
* Basic components of a note
|
109
|
-
*
|
110
|
-
* - Oid of the blob containing the message
|
111
|
-
* - Oid of the git object being annotated
|
112
|
-
*/
|
113
|
-
typedef struct {
|
114
|
-
git_oid blob_oid;
|
115
|
-
git_oid annotated_object_oid;
|
116
|
-
} git_note_data;
|
117
|
-
|
118
178
|
/**
|
119
179
|
* Loop over all the notes within a specified namespace
|
120
180
|
* and issue a callback for each one.
|
@@ -134,9 +194,8 @@ typedef struct {
|
|
134
194
|
GIT_EXTERN(int) git_note_foreach(
|
135
195
|
git_repository *repo,
|
136
196
|
const char *notes_ref,
|
137
|
-
|
138
|
-
void *payload
|
139
|
-
);
|
197
|
+
git_note_foreach_cb note_cb,
|
198
|
+
void *payload);
|
140
199
|
|
141
200
|
/** @} */
|
142
201
|
GIT_END_DECL
|