rugged 0.18.0.gh.de28323 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +9 -4
- data/Rakefile +1 -1
- data/ext/rugged/extconf.rb +10 -0
- data/ext/rugged/rugged.c +153 -86
- data/ext/rugged/rugged.h +44 -33
- data/ext/rugged/rugged_blob.c +288 -60
- data/ext/rugged/rugged_branch.c +82 -57
- data/ext/rugged/rugged_commit.c +83 -86
- data/ext/rugged/rugged_config.c +68 -68
- data/ext/rugged/rugged_diff.c +509 -0
- data/ext/rugged/rugged_diff_delta.c +94 -0
- data/ext/rugged/rugged_diff_hunk.c +100 -0
- data/ext/rugged/rugged_diff_line.c +79 -0
- data/ext/rugged/rugged_diff_patch.c +169 -0
- data/ext/rugged/rugged_index.c +539 -8
- data/ext/rugged/rugged_note.c +74 -80
- data/ext/rugged/rugged_object.c +63 -8
- data/ext/rugged/rugged_reference.c +231 -145
- data/ext/rugged/rugged_remote.c +509 -53
- data/ext/rugged/rugged_repo.c +572 -236
- data/ext/rugged/rugged_revwalk.c +59 -36
- data/ext/rugged/rugged_settings.c +7 -9
- data/ext/rugged/rugged_signature.c +7 -11
- data/ext/rugged/rugged_tag.c +93 -39
- data/ext/rugged/rugged_tree.c +321 -58
- data/lib/rugged.rb +1 -0
- data/lib/rugged/commit.rb +16 -1
- data/lib/rugged/console.rb +9 -0
- data/lib/rugged/diff.rb +19 -0
- data/lib/rugged/diff/delta.rb +54 -0
- data/lib/rugged/diff/hunk.rb +23 -0
- data/lib/rugged/diff/line.rb +29 -0
- data/lib/rugged/diff/patch.rb +28 -0
- data/lib/rugged/repository.rb +36 -39
- data/lib/rugged/version.rb +1 -1
- data/test/blob_test.rb +308 -1
- data/test/branch_test.rb +7 -0
- data/test/commit_test.rb +7 -10
- data/test/coverage/cover.rb +9 -1
- data/test/diff_test.rb +777 -0
- data/test/fixtures/archive.tar.gz +0 -0
- data/test/fixtures/attr/attr0 +1 -0
- data/test/fixtures/attr/attr1 +29 -0
- data/test/fixtures/attr/attr2 +21 -0
- data/test/fixtures/attr/attr3 +4 -0
- data/test/fixtures/attr/binfile +1 -0
- data/test/fixtures/attr/dir/file +0 -0
- data/test/fixtures/attr/file +1 -0
- data/test/fixtures/attr/gitattributes +29 -0
- data/test/fixtures/attr/gitignore +2 -0
- data/test/fixtures/attr/ign +1 -0
- data/test/fixtures/attr/macro_bad +1 -0
- data/test/fixtures/attr/macro_test +1 -0
- data/test/fixtures/attr/root_test1 +1 -0
- data/test/fixtures/attr/root_test2 +6 -0
- data/test/fixtures/attr/root_test3 +19 -0
- data/test/fixtures/attr/root_test4.txt +14 -0
- data/test/fixtures/attr/sub/abc +37 -0
- data/test/fixtures/attr/sub/dir/file +0 -0
- data/test/fixtures/attr/sub/file +1 -0
- data/test/fixtures/attr/sub/ign/file +1 -0
- data/test/fixtures/attr/sub/ign/sub/file +1 -0
- data/test/fixtures/attr/sub/sub/dir +0 -0
- data/test/fixtures/attr/sub/sub/file +1 -0
- data/test/fixtures/attr/sub/sub/subsub.txt +1 -0
- data/test/fixtures/attr/sub/subdir_test1 +2 -0
- data/test/fixtures/attr/sub/subdir_test2.txt +1 -0
- data/test/fixtures/diff/another.txt +38 -0
- data/test/fixtures/diff/readme.txt +36 -0
- data/test/fixtures/mergedrepo/conflicts-one.txt +5 -0
- data/test/fixtures/mergedrepo/conflicts-two.txt +5 -0
- data/test/fixtures/mergedrepo/one.txt +10 -0
- data/test/fixtures/mergedrepo/two.txt +12 -0
- data/test/fixtures/status/current_file +1 -0
- data/test/fixtures/status/ignored_file +1 -0
- data/test/fixtures/status/modified_file +2 -0
- data/test/fixtures/status/new_file +1 -0
- data/test/fixtures/status/staged_changes +2 -0
- data/test/fixtures/status/staged_changes_modified_file +3 -0
- data/test/fixtures/status/staged_delete_modified_file +1 -0
- data/test/fixtures/status/staged_new_file +1 -0
- data/test/fixtures/status/staged_new_file_modified_file +2 -0
- data/test/fixtures/status/subdir.txt +2 -0
- data/test/fixtures/status/subdir/current_file +1 -0
- data/test/fixtures/status/subdir/modified_file +2 -0
- data/test/fixtures/status/subdir/new_file +1 -0
- data/test/fixtures/status//350/277/231 +1 -0
- data/test/fixtures/testrepo.git/config +5 -0
- data/test/fixtures/testrepo.git/objects/77/71329dfa3002caf8c61a0ceb62a31d09023f37 +0 -0
- data/test/fixtures/text_file.md +464 -0
- data/test/fixtures/unsymlinked.git/HEAD +1 -0
- data/test/fixtures/unsymlinked.git/config +6 -0
- data/test/fixtures/unsymlinked.git/description +1 -0
- data/test/fixtures/unsymlinked.git/info/exclude +2 -0
- data/test/fixtures/unsymlinked.git/objects/08/8b64704e0d6b8bd061dea879418cb5442a3fbf +0 -0
- data/test/fixtures/unsymlinked.git/objects/13/a5e939bca25940c069fd2169d993dba328e30b +0 -0
- data/test/fixtures/unsymlinked.git/objects/19/bf568e59e3a0b363cafb4106226e62d4a4c41c +0 -0
- data/test/fixtures/unsymlinked.git/objects/58/1fadd35b4cf320d102a152f918729011604773 +0 -0
- data/test/fixtures/unsymlinked.git/objects/5c/87b6791e8b13da658a14d1ef7e09b5dc3bac8c +0 -0
- data/test/fixtures/unsymlinked.git/objects/6f/e5f5398af85fb3de8a6aba0339b6d3bfa26a27 +0 -0
- data/test/fixtures/unsymlinked.git/objects/7f/ccd75616ec188b8f1b23d67506a334cc34a49d +0 -0
- data/test/fixtures/unsymlinked.git/objects/80/6999882bf91d24241e4077906b9017605eb1f3 +0 -0
- data/test/fixtures/unsymlinked.git/objects/83/7d176303c5005505ec1e4a30231c40930c0230 +0 -0
- data/test/fixtures/unsymlinked.git/objects/a8/595ccca04f40818ae0155c8f9c77a230e597b6 +2 -0
- data/test/fixtures/unsymlinked.git/objects/cf/8f1cf5cce859c438d6cc067284cb5e161206e7 +0 -0
- data/test/fixtures/unsymlinked.git/objects/d5/278d05c8607ec420bfee4cf219fbc0eeebfd6a +0 -0
- data/test/fixtures/unsymlinked.git/objects/f4/e16fb76536591a41454194058d048d8e4dd2e9 +0 -0
- data/test/fixtures/unsymlinked.git/objects/f9/e65619d93fdf2673882e0a261c5e93b1a84006 +0 -0
- data/test/fixtures/unsymlinked.git/refs/heads/exe-file +1 -0
- data/test/fixtures/unsymlinked.git/refs/heads/master +1 -0
- data/test/fixtures/unsymlinked.git/refs/heads/reg-file +1 -0
- data/test/index_test.rb +120 -0
- data/test/reference_test.rb +38 -3
- data/test/remote_test.rb +224 -3
- data/test/repo_reset_test.rb +2 -0
- data/test/repo_test.rb +147 -10
- data/test/test_helper.rb +5 -2
- data/vendor/libgit2/include/git2/attr.h +3 -3
- data/vendor/libgit2/include/git2/blob.h +11 -17
- data/vendor/libgit2/include/git2/branch.h +3 -2
- data/vendor/libgit2/include/git2/checkout.h +7 -0
- data/vendor/libgit2/include/git2/clone.h +3 -0
- data/vendor/libgit2/include/git2/commit.h +61 -66
- data/vendor/libgit2/include/git2/common.h +73 -42
- data/vendor/libgit2/include/git2/config.h +57 -71
- data/vendor/libgit2/include/git2/cred_helpers.h +2 -2
- data/vendor/libgit2/include/git2/diff.h +179 -30
- data/vendor/libgit2/include/git2/errors.h +3 -3
- data/vendor/libgit2/include/git2/index.h +225 -146
- data/vendor/libgit2/include/git2/indexer.h +2 -22
- data/vendor/libgit2/include/git2/inttypes.h +9 -9
- data/vendor/libgit2/include/git2/merge.h +123 -5
- data/vendor/libgit2/include/git2/odb.h +59 -38
- data/vendor/libgit2/include/git2/odb_backend.h +45 -104
- data/vendor/libgit2/include/git2/oid.h +30 -19
- data/vendor/libgit2/include/git2/pack.h +21 -3
- data/vendor/libgit2/include/git2/refdb.h +0 -35
- data/vendor/libgit2/include/git2/refs.h +93 -31
- data/vendor/libgit2/include/git2/refspec.h +17 -0
- data/vendor/libgit2/include/git2/remote.h +60 -20
- data/vendor/libgit2/include/git2/repository.h +48 -70
- data/vendor/libgit2/include/git2/reset.h +3 -3
- data/vendor/libgit2/include/git2/revparse.h +22 -0
- data/vendor/libgit2/include/git2/stash.h +1 -1
- data/vendor/libgit2/include/git2/status.h +131 -56
- data/vendor/libgit2/include/git2/strarray.h +2 -2
- data/vendor/libgit2/include/git2/submodule.h +16 -16
- data/vendor/libgit2/include/git2/sys/commit.h +46 -0
- data/vendor/libgit2/include/git2/sys/config.h +71 -0
- data/vendor/libgit2/include/git2/sys/index.h +179 -0
- data/vendor/libgit2/include/git2/sys/odb_backend.h +86 -0
- data/vendor/libgit2/include/git2/sys/refdb_backend.h +158 -0
- data/vendor/libgit2/include/git2/sys/refs.h +38 -0
- data/vendor/libgit2/include/git2/sys/repository.h +106 -0
- data/vendor/libgit2/include/git2/tag.h +44 -18
- data/vendor/libgit2/include/git2/trace.h +1 -2
- data/vendor/libgit2/include/git2/transport.h +74 -0
- data/vendor/libgit2/include/git2/tree.h +12 -22
- data/vendor/libgit2/include/git2/types.h +33 -0
- data/vendor/libgit2/include/git2/version.h +2 -2
- data/vendor/libgit2/src/array.h +66 -0
- data/vendor/libgit2/src/attr.c +26 -13
- data/vendor/libgit2/src/attr_file.c +3 -2
- data/vendor/libgit2/src/attr_file.h +3 -3
- data/vendor/libgit2/src/attrcache.h +4 -4
- data/vendor/libgit2/src/blob.c +13 -9
- data/vendor/libgit2/src/blob.h +2 -2
- data/vendor/libgit2/src/branch.c +67 -49
- data/vendor/libgit2/src/cache.c +224 -54
- data/vendor/libgit2/src/cache.h +33 -20
- data/vendor/libgit2/src/checkout.c +145 -85
- data/vendor/libgit2/src/clone.c +62 -50
- data/vendor/libgit2/src/commit.c +74 -40
- data/vendor/libgit2/src/commit.h +2 -3
- data/vendor/libgit2/src/commit_list.c +14 -8
- data/vendor/libgit2/src/config.c +119 -36
- data/vendor/libgit2/src/config.h +3 -0
- data/vendor/libgit2/src/config_cache.c +24 -7
- data/vendor/libgit2/src/config_file.c +9 -6
- data/vendor/libgit2/src/crlf.c +4 -2
- data/vendor/libgit2/src/date.c +3 -3
- data/vendor/libgit2/src/delta.c +1 -1
- data/vendor/libgit2/src/diff.c +681 -303
- data/vendor/libgit2/src/diff.h +34 -2
- data/vendor/libgit2/src/diff_driver.c +405 -0
- data/vendor/libgit2/src/diff_driver.h +49 -0
- data/vendor/libgit2/src/diff_file.c +447 -0
- data/vendor/libgit2/src/diff_file.h +58 -0
- data/vendor/libgit2/src/diff_patch.c +995 -0
- data/vendor/libgit2/src/diff_patch.h +46 -0
- data/vendor/libgit2/src/diff_print.c +430 -0
- data/vendor/libgit2/src/diff_tform.c +464 -203
- data/vendor/libgit2/src/diff_xdiff.c +166 -0
- data/vendor/libgit2/src/diff_xdiff.h +28 -0
- data/vendor/libgit2/src/fetch.c +11 -4
- data/vendor/libgit2/src/fileops.c +85 -61
- data/vendor/libgit2/src/fileops.h +4 -0
- data/vendor/libgit2/src/global.c +10 -2
- data/vendor/libgit2/src/global.h +0 -8
- data/vendor/libgit2/src/hash/hash_generic.h +3 -3
- data/vendor/libgit2/src/hash/hash_win32.h +4 -4
- data/vendor/libgit2/src/hashsig.c +0 -1
- data/vendor/libgit2/src/ignore.c +68 -28
- data/vendor/libgit2/src/ignore.h +10 -1
- data/vendor/libgit2/src/index.c +666 -84
- data/vendor/libgit2/src/index.h +6 -0
- data/vendor/libgit2/src/indexer.c +10 -28
- data/vendor/libgit2/src/iterator.c +427 -283
- data/vendor/libgit2/src/iterator.h +58 -4
- data/vendor/libgit2/src/merge.c +1892 -32
- data/vendor/libgit2/src/merge.h +132 -5
- data/vendor/libgit2/src/merge_file.c +174 -0
- data/vendor/libgit2/src/merge_file.h +71 -0
- data/vendor/libgit2/src/mwindow.c +1 -1
- data/vendor/libgit2/src/notes.c +45 -48
- data/vendor/libgit2/src/object.c +89 -127
- data/vendor/libgit2/src/object.h +0 -1
- data/vendor/libgit2/src/object_api.c +129 -0
- data/vendor/libgit2/src/odb.c +156 -59
- data/vendor/libgit2/src/odb.h +5 -2
- data/vendor/libgit2/src/odb_loose.c +31 -17
- data/vendor/libgit2/src/odb_pack.c +39 -43
- data/vendor/libgit2/src/oid.c +62 -27
- data/vendor/libgit2/src/oid.h +33 -0
- data/vendor/libgit2/src/oidmap.h +4 -6
- data/vendor/libgit2/src/pack-objects.c +54 -22
- data/vendor/libgit2/src/pack.c +98 -56
- data/vendor/libgit2/src/pack.h +3 -1
- data/vendor/libgit2/src/pathspec.c +26 -1
- data/vendor/libgit2/src/pathspec.h +14 -0
- data/vendor/libgit2/src/pool.c +5 -0
- data/vendor/libgit2/src/posix.c +2 -2
- data/vendor/libgit2/src/posix.h +3 -0
- data/vendor/libgit2/src/push.c +13 -10
- data/vendor/libgit2/src/refdb.c +82 -62
- data/vendor/libgit2/src/refdb.h +16 -16
- data/vendor/libgit2/src/refdb_fs.c +386 -133
- data/vendor/libgit2/src/reflog.c +3 -1
- data/vendor/libgit2/src/refs.c +247 -221
- data/vendor/libgit2/src/refs.h +2 -1
- data/vendor/libgit2/src/refspec.c +18 -1
- data/vendor/libgit2/src/refspec.h +3 -1
- data/vendor/libgit2/src/remote.c +434 -253
- data/vendor/libgit2/src/remote.h +5 -3
- data/vendor/libgit2/src/repository.c +197 -111
- data/vendor/libgit2/src/repository.h +26 -5
- data/vendor/libgit2/src/reset.c +1 -1
- data/vendor/libgit2/src/revparse.c +84 -79
- data/vendor/libgit2/src/revwalk.c +1 -1
- data/vendor/libgit2/src/signature.c +22 -10
- data/vendor/libgit2/src/stash.c +5 -2
- data/vendor/libgit2/src/status.c +311 -107
- data/vendor/libgit2/src/status.h +23 -0
- data/vendor/libgit2/src/submodule.c +21 -13
- data/vendor/libgit2/src/tag.c +42 -31
- data/vendor/libgit2/src/tag.h +2 -3
- data/vendor/libgit2/src/thread-utils.h +105 -3
- data/vendor/libgit2/src/trace.c +1 -2
- data/vendor/libgit2/src/trace.h +3 -3
- data/vendor/libgit2/src/transport.c +18 -6
- data/vendor/libgit2/src/transports/cred.c +103 -1
- data/vendor/libgit2/src/transports/local.c +19 -9
- data/vendor/libgit2/src/transports/smart_protocol.c +32 -12
- data/vendor/libgit2/src/transports/ssh.c +519 -0
- data/vendor/libgit2/src/transports/winhttp.c +3 -1
- data/vendor/libgit2/src/tree.c +26 -28
- data/vendor/libgit2/src/tree.h +3 -3
- data/vendor/libgit2/src/unix/posix.h +2 -0
- data/vendor/libgit2/src/util.c +43 -6
- data/vendor/libgit2/src/util.h +40 -12
- data/vendor/libgit2/src/vector.c +3 -5
- data/vendor/libgit2/src/vector.h +9 -0
- data/vendor/libgit2/src/win32/dir.c +1 -1
- data/vendor/libgit2/src/win32/error.c +2 -0
- data/vendor/libgit2/src/win32/findfile.c +3 -6
- data/vendor/libgit2/src/win32/posix_w32.c +85 -59
- data/vendor/libgit2/src/win32/pthread.c +16 -8
- data/vendor/libgit2/src/win32/pthread.h +7 -4
- metadata +407 -306
- data/test/coverage/HEAD.json +0 -1
- data/vendor/libgit2/include/git2/refdb_backend.h +0 -109
- data/vendor/libgit2/src/diff_output.c +0 -1819
- data/vendor/libgit2/src/diff_output.h +0 -93
@@ -29,11 +29,8 @@ GIT_BEGIN_DECL
|
|
29
29
|
* @param id Identity of the tree to locate.
|
30
30
|
* @return 0 or an error code
|
31
31
|
*/
|
32
|
-
|
33
|
-
git_tree **out, git_repository *repo, const git_oid *id)
|
34
|
-
{
|
35
|
-
return git_object_lookup((git_object **)out, repo, id, GIT_OBJ_TREE);
|
36
|
-
}
|
32
|
+
GIT_EXTERN(int) git_tree_lookup(
|
33
|
+
git_tree **out, git_repository *repo, const git_oid *id);
|
37
34
|
|
38
35
|
/**
|
39
36
|
* Lookup a tree object from the repository,
|
@@ -41,21 +38,17 @@ GIT_INLINE(int) git_tree_lookup(
|
|
41
38
|
*
|
42
39
|
* @see git_object_lookup_prefix
|
43
40
|
*
|
44
|
-
* @param
|
41
|
+
* @param out pointer to the looked up tree
|
45
42
|
* @param repo the repo to use when locating the tree.
|
46
43
|
* @param id identity of the tree to locate.
|
47
44
|
* @param len the length of the short identifier
|
48
45
|
* @return 0 or an error code
|
49
46
|
*/
|
50
|
-
|
47
|
+
GIT_EXTERN(int) git_tree_lookup_prefix(
|
51
48
|
git_tree **out,
|
52
49
|
git_repository *repo,
|
53
50
|
const git_oid *id,
|
54
|
-
size_t len)
|
55
|
-
{
|
56
|
-
return git_object_lookup_prefix(
|
57
|
-
(git_object **)out, repo, id, len, GIT_OBJ_TREE);
|
58
|
-
}
|
51
|
+
size_t len);
|
59
52
|
|
60
53
|
/**
|
61
54
|
* Close an open tree
|
@@ -67,10 +60,7 @@ GIT_INLINE(int) git_tree_lookup_prefix(
|
|
67
60
|
*
|
68
61
|
* @param tree The tree to close
|
69
62
|
*/
|
70
|
-
|
71
|
-
{
|
72
|
-
git_object_free((git_object *)tree);
|
73
|
-
}
|
63
|
+
GIT_EXTERN(void) git_tree_free(git_tree *tree);
|
74
64
|
|
75
65
|
/**
|
76
66
|
* Get the id of a tree.
|
@@ -107,7 +97,7 @@ GIT_EXTERN(size_t) git_tree_entrycount(const git_tree *tree);
|
|
107
97
|
* @return the tree entry; NULL if not found
|
108
98
|
*/
|
109
99
|
GIT_EXTERN(const git_tree_entry *) git_tree_entry_byname(
|
110
|
-
git_tree *tree, const char *filename);
|
100
|
+
const git_tree *tree, const char *filename);
|
111
101
|
|
112
102
|
/**
|
113
103
|
* Lookup a tree entry by its position in the tree
|
@@ -120,7 +110,7 @@ GIT_EXTERN(const git_tree_entry *) git_tree_entry_byname(
|
|
120
110
|
* @return the tree entry; NULL if not found
|
121
111
|
*/
|
122
112
|
GIT_EXTERN(const git_tree_entry *) git_tree_entry_byindex(
|
123
|
-
git_tree *tree, size_t idx);
|
113
|
+
const git_tree *tree, size_t idx);
|
124
114
|
|
125
115
|
/**
|
126
116
|
* Lookup a tree entry by SHA value.
|
@@ -146,12 +136,12 @@ GIT_EXTERN(const git_tree_entry *) git_tree_entry_byoid(
|
|
146
136
|
*
|
147
137
|
* @param out Pointer where to store the tree entry
|
148
138
|
* @param root Previously loaded tree which is the root of the relative path
|
149
|
-
* @param
|
139
|
+
* @param path Path to the contained entry
|
150
140
|
* @return 0 on success; GIT_ENOTFOUND if the path does not exist
|
151
141
|
*/
|
152
142
|
GIT_EXTERN(int) git_tree_entry_bypath(
|
153
143
|
git_tree_entry **out,
|
154
|
-
git_tree *root,
|
144
|
+
const git_tree *root,
|
155
145
|
const char *path);
|
156
146
|
|
157
147
|
/**
|
@@ -222,7 +212,7 @@ GIT_EXTERN(int) git_tree_entry_cmp(const git_tree_entry *e1, const git_tree_entr
|
|
222
212
|
*
|
223
213
|
* You must call `git_object_free()` on the object when you are done with it.
|
224
214
|
*
|
225
|
-
* @param
|
215
|
+
* @param object_out pointer to the converted object
|
226
216
|
* @param repo repository where to lookup the pointed object
|
227
217
|
* @param entry a tree entry
|
228
218
|
* @return 0 or an error code
|
@@ -261,7 +251,7 @@ GIT_EXTERN(void) git_treebuilder_clear(git_treebuilder *bld);
|
|
261
251
|
/**
|
262
252
|
* Get the number of entries listed in a treebuilder
|
263
253
|
*
|
264
|
-
* @param
|
254
|
+
* @param bld a previously loaded treebuilder.
|
265
255
|
* @return the number of entries in the treebuilder
|
266
256
|
*/
|
267
257
|
GIT_EXTERN(unsigned int) git_treebuilder_entrycount(git_treebuilder *bld);
|
@@ -131,6 +131,9 @@ typedef struct git_treebuilder git_treebuilder;
|
|
131
131
|
/** Memory representation of an index file. */
|
132
132
|
typedef struct git_index git_index;
|
133
133
|
|
134
|
+
/** An interator for conflicts in the index. */
|
135
|
+
typedef struct git_index_conflict_iterator git_index_conflict_iterator;
|
136
|
+
|
134
137
|
/** Memory representation of a set of config files */
|
135
138
|
typedef struct git_config git_config;
|
136
139
|
|
@@ -165,6 +168,16 @@ typedef struct git_signature {
|
|
165
168
|
/** In-memory representation of a reference. */
|
166
169
|
typedef struct git_reference git_reference;
|
167
170
|
|
171
|
+
/** Iterator for references */
|
172
|
+
typedef struct git_reference_iterator git_reference_iterator;
|
173
|
+
|
174
|
+
/** Merge heads, the input to merge */
|
175
|
+
typedef struct git_merge_head git_merge_head;
|
176
|
+
|
177
|
+
/** Representation of a status collection */
|
178
|
+
typedef struct git_status_list git_status_list;
|
179
|
+
|
180
|
+
|
168
181
|
/** Basic type of any Git reference. */
|
169
182
|
typedef enum {
|
170
183
|
GIT_REF_INVALID = 0, /** Invalid reference */
|
@@ -196,6 +209,26 @@ typedef struct git_push git_push;
|
|
196
209
|
typedef struct git_remote_head git_remote_head;
|
197
210
|
typedef struct git_remote_callbacks git_remote_callbacks;
|
198
211
|
|
212
|
+
/**
|
213
|
+
* This is passed as the first argument to the callback to allow the
|
214
|
+
* user to see the progress.
|
215
|
+
*/
|
216
|
+
typedef struct git_transfer_progress {
|
217
|
+
unsigned int total_objects;
|
218
|
+
unsigned int indexed_objects;
|
219
|
+
unsigned int received_objects;
|
220
|
+
size_t received_bytes;
|
221
|
+
} git_transfer_progress;
|
222
|
+
|
223
|
+
/**
|
224
|
+
* Type for progress callbacks during indexing. Return a value less than zero
|
225
|
+
* to cancel the transfer.
|
226
|
+
*
|
227
|
+
* @param stats Structure containing information about the state of the transfer
|
228
|
+
* @param payload Payload provided by caller
|
229
|
+
*/
|
230
|
+
typedef int (*git_transfer_progress_callback)(const git_transfer_progress *stats, void *payload);
|
231
|
+
|
199
232
|
/** @} */
|
200
233
|
GIT_END_DECL
|
201
234
|
|
@@ -7,9 +7,9 @@
|
|
7
7
|
#ifndef INCLUDE_git_version_h__
|
8
8
|
#define INCLUDE_git_version_h__
|
9
9
|
|
10
|
-
#define LIBGIT2_VERSION "0.
|
10
|
+
#define LIBGIT2_VERSION "0.19.0"
|
11
11
|
#define LIBGIT2_VER_MAJOR 0
|
12
|
-
#define LIBGIT2_VER_MINOR
|
12
|
+
#define LIBGIT2_VER_MINOR 19
|
13
13
|
#define LIBGIT2_VER_REVISION 0
|
14
14
|
|
15
15
|
#endif
|
@@ -0,0 +1,66 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
|
+
*
|
4
|
+
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
|
+
* a Linking Exception. For full terms see the included COPYING file.
|
6
|
+
*/
|
7
|
+
#ifndef INCLUDE_array_h__
|
8
|
+
#define INCLUDE_array_h__
|
9
|
+
|
10
|
+
#include "util.h"
|
11
|
+
|
12
|
+
/*
|
13
|
+
* Use this to declare a typesafe resizable array of items, a la:
|
14
|
+
*
|
15
|
+
* git_array_t(int) my_ints = GIT_ARRAY_INIT;
|
16
|
+
* ...
|
17
|
+
* int *i = git_array_alloc(my_ints);
|
18
|
+
* GITERR_CHECK_ALLOC(i);
|
19
|
+
* ...
|
20
|
+
* git_array_clear(my_ints);
|
21
|
+
*
|
22
|
+
* You may also want to do things like:
|
23
|
+
*
|
24
|
+
* typedef git_array_t(my_struct) my_struct_array_t;
|
25
|
+
*/
|
26
|
+
#define git_array_t(type) struct { type *ptr; uint32_t size, asize; }
|
27
|
+
|
28
|
+
#define GIT_ARRAY_INIT { NULL, 0, 0 }
|
29
|
+
|
30
|
+
#define git_array_init(a) \
|
31
|
+
do { (a).size = (a).asize = 0; (a).ptr = NULL; } while (0)
|
32
|
+
|
33
|
+
#define git_array_clear(a) \
|
34
|
+
do { git__free((a).ptr); git_array_init(a); } while (0)
|
35
|
+
|
36
|
+
#define GITERR_CHECK_ARRAY(a) GITERR_CHECK_ALLOC((a).ptr)
|
37
|
+
|
38
|
+
|
39
|
+
typedef git_array_t(void) git_array_generic_t;
|
40
|
+
|
41
|
+
/* use a generic array for growth so this can return the new item */
|
42
|
+
GIT_INLINE(void *) git_array_grow(git_array_generic_t *a, size_t item_size)
|
43
|
+
{
|
44
|
+
uint32_t new_size = (a->size < 8) ? 8 : a->asize * 3 / 2;
|
45
|
+
void *new_array = git__realloc(a->ptr, new_size * item_size);
|
46
|
+
if (!new_array) {
|
47
|
+
git_array_clear(*a);
|
48
|
+
return NULL;
|
49
|
+
} else {
|
50
|
+
a->ptr = new_array; a->asize = new_size; a->size++;
|
51
|
+
return (((char *)a->ptr) + (a->size - 1) * item_size);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
#define git_array_alloc(a) \
|
56
|
+
((a).size >= (a).asize) ? \
|
57
|
+
git_array_grow((git_array_generic_t *)&(a), sizeof(*(a).ptr)) : \
|
58
|
+
(a).ptr ? &(a).ptr[(a).size++] : NULL
|
59
|
+
|
60
|
+
#define git_array_last(a) ((a).size ? &(a).ptr[(a).size - 1] : NULL)
|
61
|
+
|
62
|
+
#define git_array_get(a, i) (((i) < (a).size) ? &(a).ptr[(i)] : NULL)
|
63
|
+
|
64
|
+
#define git_array_size(a) (a).size
|
65
|
+
|
66
|
+
#endif
|
data/vendor/libgit2/src/attr.c
CHANGED
@@ -36,7 +36,7 @@ static int collect_attr_files(
|
|
36
36
|
|
37
37
|
int git_attr_get(
|
38
38
|
const char **value,
|
39
|
-
|
39
|
+
git_repository *repo,
|
40
40
|
uint32_t flags,
|
41
41
|
const char *pathname,
|
42
42
|
const char *name)
|
@@ -88,10 +88,10 @@ typedef struct {
|
|
88
88
|
|
89
89
|
int git_attr_get_many(
|
90
90
|
const char **values,
|
91
|
-
|
91
|
+
git_repository *repo,
|
92
92
|
uint32_t flags,
|
93
93
|
const char *pathname,
|
94
|
-
|
94
|
+
size_t num_attr,
|
95
95
|
const char **names)
|
96
96
|
{
|
97
97
|
int error;
|
@@ -151,7 +151,7 @@ cleanup:
|
|
151
151
|
|
152
152
|
|
153
153
|
int git_attr_foreach(
|
154
|
-
|
154
|
+
git_repository *repo,
|
155
155
|
uint32_t flags,
|
156
156
|
const char *pathname,
|
157
157
|
int (*callback)(const char *name, const char *value, void *payload),
|
@@ -312,7 +312,7 @@ static int load_attr_blob_from_index(
|
|
312
312
|
|
313
313
|
entry = git_index_get_byindex(index, pos);
|
314
314
|
|
315
|
-
if (old_oid &&
|
315
|
+
if (old_oid && git_oid__cmp(old_oid, &entry->oid) == 0)
|
316
316
|
return GIT_ENOTFOUND;
|
317
317
|
|
318
318
|
if ((error = git_blob_lookup(blob, repo, &entry->oid)) < 0)
|
@@ -596,26 +596,33 @@ static int collect_attr_files(
|
|
596
596
|
}
|
597
597
|
|
598
598
|
static int attr_cache__lookup_path(
|
599
|
-
|
599
|
+
char **out, git_config *cfg, const char *key, const char *fallback)
|
600
600
|
{
|
601
601
|
git_buf buf = GIT_BUF_INIT;
|
602
602
|
int error;
|
603
|
+
const char *cfgval = NULL;
|
603
604
|
|
604
|
-
|
605
|
-
|
605
|
+
*out = NULL;
|
606
|
+
|
607
|
+
if (!(error = git_config_get_string(&cfgval, cfg, key))) {
|
606
608
|
|
607
|
-
|
609
|
+
/* expand leading ~/ as needed */
|
610
|
+
if (cfgval && cfgval[0] == '~' && cfgval[1] == '/' &&
|
611
|
+
!git_futils_find_global_file(&buf, &cfgval[2]))
|
612
|
+
*out = git_buf_detach(&buf);
|
613
|
+
else if (cfgval)
|
614
|
+
*out = git__strdup(cfgval);
|
615
|
+
|
616
|
+
} else if (error == GIT_ENOTFOUND) {
|
608
617
|
giterr_clear();
|
609
618
|
error = 0;
|
610
619
|
|
611
620
|
if (!git_futils_find_xdg_file(&buf, fallback))
|
612
621
|
*out = git_buf_detach(&buf);
|
613
|
-
else
|
614
|
-
*out = NULL;
|
615
|
-
|
616
|
-
git_buf_free(&buf);
|
617
622
|
}
|
618
623
|
|
624
|
+
git_buf_free(&buf);
|
625
|
+
|
619
626
|
return error;
|
620
627
|
}
|
621
628
|
|
@@ -696,6 +703,12 @@ void git_attr_cache_flush(
|
|
696
703
|
|
697
704
|
git_pool_clear(&cache->pool);
|
698
705
|
|
706
|
+
git__free(cache->cfg_attr_file);
|
707
|
+
cache->cfg_attr_file = NULL;
|
708
|
+
|
709
|
+
git__free(cache->cfg_excl_file);
|
710
|
+
cache->cfg_excl_file = NULL;
|
711
|
+
|
699
712
|
cache->initialized = 0;
|
700
713
|
}
|
701
714
|
|
@@ -397,7 +397,8 @@ int git_attr_fnmatch__parse(
|
|
397
397
|
|
398
398
|
*base = scan;
|
399
399
|
|
400
|
-
spec->length = scan - pattern
|
400
|
+
if ((spec->length = scan - pattern) == 0)
|
401
|
+
return GIT_ENOTFOUND;
|
401
402
|
|
402
403
|
if (pattern[spec->length - 1] == '/') {
|
403
404
|
spec->length--;
|
@@ -497,7 +498,7 @@ int git_attr_assignment__parse(
|
|
497
498
|
|
498
499
|
assert(assigns && !assigns->length);
|
499
500
|
|
500
|
-
assigns
|
501
|
+
git_vector_set_cmp(assigns, sort_by_hash_and_name);
|
501
502
|
|
502
503
|
while (*scan && *scan != '\n') {
|
503
504
|
const char *name_start, *value_start;
|
@@ -47,14 +47,14 @@ typedef struct {
|
|
47
47
|
typedef struct {
|
48
48
|
git_refcount unused;
|
49
49
|
const char *name;
|
50
|
-
|
50
|
+
uint32_t name_hash;
|
51
51
|
} git_attr_name;
|
52
52
|
|
53
53
|
typedef struct {
|
54
54
|
git_refcount rc; /* for macros */
|
55
55
|
char *name;
|
56
|
-
|
57
|
-
|
56
|
+
uint32_t name_hash;
|
57
|
+
const char *value;
|
58
58
|
} git_attr_assignment;
|
59
59
|
|
60
60
|
typedef struct {
|
@@ -13,10 +13,10 @@
|
|
13
13
|
typedef struct {
|
14
14
|
int initialized;
|
15
15
|
git_pool pool;
|
16
|
-
git_strmap *files;
|
17
|
-
git_strmap *macros;
|
18
|
-
|
19
|
-
|
16
|
+
git_strmap *files; /* hash path to git_attr_file of rules */
|
17
|
+
git_strmap *macros; /* hash name to vector<git_attr_assignment> */
|
18
|
+
char *cfg_attr_file; /* cached value of core.attributesfile */
|
19
|
+
char *cfg_excl_file; /* cached value of core.excludesfile */
|
20
20
|
} git_attr_cache;
|
21
21
|
|
22
22
|
extern int git_attr_cache__init(git_repository *repo);
|
data/vendor/libgit2/src/blob.c
CHANGED
@@ -8,8 +8,10 @@
|
|
8
8
|
#include "git2/common.h"
|
9
9
|
#include "git2/object.h"
|
10
10
|
#include "git2/repository.h"
|
11
|
+
#include "git2/odb_backend.h"
|
11
12
|
|
12
13
|
#include "common.h"
|
14
|
+
#include "filebuf.h"
|
13
15
|
#include "blob.h"
|
14
16
|
#include "filter.h"
|
15
17
|
#include "buf_text.h"
|
@@ -17,32 +19,34 @@
|
|
17
19
|
const void *git_blob_rawcontent(const git_blob *blob)
|
18
20
|
{
|
19
21
|
assert(blob);
|
20
|
-
return blob->odb_object
|
22
|
+
return git_odb_object_data(blob->odb_object);
|
21
23
|
}
|
22
24
|
|
23
25
|
git_off_t git_blob_rawsize(const git_blob *blob)
|
24
26
|
{
|
25
27
|
assert(blob);
|
26
|
-
return (git_off_t)blob->odb_object
|
28
|
+
return (git_off_t)git_odb_object_size(blob->odb_object);
|
27
29
|
}
|
28
30
|
|
29
31
|
int git_blob__getbuf(git_buf *buffer, git_blob *blob)
|
30
32
|
{
|
31
33
|
return git_buf_set(
|
32
|
-
buffer,
|
34
|
+
buffer,
|
35
|
+
git_odb_object_data(blob->odb_object),
|
36
|
+
git_odb_object_size(blob->odb_object));
|
33
37
|
}
|
34
38
|
|
35
|
-
void git_blob__free(
|
39
|
+
void git_blob__free(void *blob)
|
36
40
|
{
|
37
|
-
git_odb_object_free(blob->odb_object);
|
41
|
+
git_odb_object_free(((git_blob *)blob)->odb_object);
|
38
42
|
git__free(blob);
|
39
43
|
}
|
40
44
|
|
41
|
-
int git_blob__parse(
|
45
|
+
int git_blob__parse(void *blob, git_odb_object *odb_obj)
|
42
46
|
{
|
43
47
|
assert(blob);
|
44
48
|
git_cached_obj_incref((git_cached_obj *)odb_obj);
|
45
|
-
blob->odb_object = odb_obj;
|
49
|
+
((git_blob *)blob)->odb_object = odb_obj;
|
46
50
|
return 0;
|
47
51
|
}
|
48
52
|
|
@@ -314,8 +318,8 @@ int git_blob_is_binary(git_blob *blob)
|
|
314
318
|
|
315
319
|
assert(blob);
|
316
320
|
|
317
|
-
content.ptr = blob->odb_object->
|
318
|
-
content.size = min(blob->odb_object->
|
321
|
+
content.ptr = blob->odb_object->buffer;
|
322
|
+
content.size = min(blob->odb_object->cached.size, 4000);
|
319
323
|
|
320
324
|
return git_buf_text_is_binary(&content);
|
321
325
|
}
|
data/vendor/libgit2/src/blob.h
CHANGED
@@ -17,8 +17,8 @@ struct git_blob {
|
|
17
17
|
git_odb_object *odb_object;
|
18
18
|
};
|
19
19
|
|
20
|
-
void git_blob__free(
|
21
|
-
int git_blob__parse(
|
20
|
+
void git_blob__free(void *blob);
|
21
|
+
int git_blob__parse(void *blob, git_odb_object *obj);
|
22
22
|
int git_blob__getbuf(git_buf *buffer, git_blob *blob);
|
23
23
|
|
24
24
|
#endif
|