rugged 0.22.2 → 0.23.0b1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/rugged/rugged.c +1 -2
- data/ext/rugged/rugged_branch_collection.c +6 -44
- data/ext/rugged/rugged_config.c +7 -3
- data/ext/rugged/rugged_diff_delta.c +1 -1
- data/ext/rugged/rugged_diff_line.c +1 -1
- data/ext/rugged/rugged_object.c +2 -2
- data/ext/rugged/rugged_reference_collection.c +12 -56
- data/ext/rugged/rugged_remote.c +4 -33
- data/ext/rugged/rugged_remote_collection.c +1 -1
- data/ext/rugged/rugged_repo.c +10 -36
- data/ext/rugged/rugged_settings.c +3 -3
- data/ext/rugged/rugged_tree.c +1 -1
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/CMakeLists.txt +10 -3
- data/vendor/libgit2/COPYING +15 -21
- data/vendor/libgit2/include/git2/annotated_commit.h +20 -3
- data/vendor/libgit2/include/git2/branch.h +20 -16
- data/vendor/libgit2/include/git2/checkout.h +32 -18
- data/vendor/libgit2/include/git2/cherrypick.h +2 -2
- data/vendor/libgit2/include/git2/clone.h +4 -10
- data/vendor/libgit2/include/git2/config.h +66 -12
- data/vendor/libgit2/include/git2/describe.h +3 -2
- data/vendor/libgit2/include/git2/diff.h +3 -3
- data/vendor/libgit2/include/git2/errors.h +1 -0
- data/vendor/libgit2/include/git2/filter.h +21 -5
- data/vendor/libgit2/include/git2/index.h +32 -0
- data/vendor/libgit2/include/git2/merge.h +20 -3
- data/vendor/libgit2/include/git2/oid.h +1 -1
- data/vendor/libgit2/include/git2/pack.h +13 -0
- data/vendor/libgit2/include/git2/patch.h +3 -6
- data/vendor/libgit2/include/git2/rebase.h +8 -12
- data/vendor/libgit2/include/git2/refs.h +19 -29
- data/vendor/libgit2/include/git2/remote.h +5 -11
- data/vendor/libgit2/include/git2/repository.h +44 -15
- data/vendor/libgit2/include/git2/reset.h +19 -10
- data/vendor/libgit2/include/git2/revert.h +2 -2
- data/vendor/libgit2/include/git2/submodule.h +3 -9
- data/vendor/libgit2/include/git2/sys/config.h +3 -1
- data/vendor/libgit2/include/git2/sys/filter.h +10 -2
- data/vendor/libgit2/include/git2/sys/hashsig.h +49 -22
- data/vendor/libgit2/include/git2/transport.h +1 -1
- data/vendor/libgit2/include/git2/types.h +10 -3
- data/vendor/libgit2/include/git2/version.h +3 -2
- data/vendor/libgit2/src/annotated_commit.c +28 -0
- data/vendor/libgit2/src/array.h +19 -8
- data/vendor/libgit2/src/attr.c +95 -35
- data/vendor/libgit2/src/attr_file.c +51 -17
- data/vendor/libgit2/src/attr_file.h +37 -10
- data/vendor/libgit2/src/attrcache.c +13 -7
- data/vendor/libgit2/src/attrcache.h +1 -0
- data/vendor/libgit2/src/blame.c +26 -2
- data/vendor/libgit2/src/blame_git.c +6 -2
- data/vendor/libgit2/src/blob.c +6 -8
- data/vendor/libgit2/src/branch.c +55 -43
- data/vendor/libgit2/src/buf_text.c +13 -6
- data/vendor/libgit2/src/buffer.c +110 -25
- data/vendor/libgit2/src/buffer.h +18 -0
- data/vendor/libgit2/src/checkout.c +164 -92
- data/vendor/libgit2/src/checkout.h +0 -7
- data/vendor/libgit2/src/cherrypick.c +13 -7
- data/vendor/libgit2/src/clone.c +23 -25
- data/vendor/libgit2/src/commit.c +3 -3
- data/vendor/libgit2/src/common.h +23 -1
- data/vendor/libgit2/src/config.c +137 -19
- data/vendor/libgit2/src/config.h +2 -2
- data/vendor/libgit2/src/config_cache.c +2 -1
- data/vendor/libgit2/src/config_file.c +39 -18
- data/vendor/libgit2/src/config_file.h +1 -1
- data/vendor/libgit2/src/crlf.c +1 -1
- data/vendor/libgit2/src/delta-apply.c +3 -2
- data/vendor/libgit2/src/delta.c +25 -6
- data/vendor/libgit2/src/describe.c +2 -0
- data/vendor/libgit2/src/diff.c +8 -5
- data/vendor/libgit2/src/diff_driver.c +39 -18
- data/vendor/libgit2/src/diff_file.c +1 -1
- data/vendor/libgit2/src/diff_patch.c +12 -6
- data/vendor/libgit2/src/diff_tform.c +21 -24
- data/vendor/libgit2/src/filebuf.c +14 -12
- data/vendor/libgit2/src/fileops.c +61 -18
- data/vendor/libgit2/src/fileops.h +11 -2
- data/vendor/libgit2/src/filter.c +351 -99
- data/vendor/libgit2/src/filter.h +17 -0
- data/vendor/libgit2/src/global.c +38 -9
- data/vendor/libgit2/src/hash/hash_generic.c +1 -1
- data/vendor/libgit2/src/hashsig.c +28 -16
- data/vendor/libgit2/src/ignore.c +2 -2
- data/vendor/libgit2/src/index.c +159 -42
- data/vendor/libgit2/src/index.h +29 -0
- data/vendor/libgit2/src/indexer.c +11 -2
- data/vendor/libgit2/src/integer.h +96 -0
- data/vendor/libgit2/src/iterator.c +5 -3
- data/vendor/libgit2/src/khash.h +41 -29
- data/vendor/libgit2/src/merge.c +48 -35
- data/vendor/libgit2/src/merge.h +0 -1
- data/vendor/libgit2/src/merge_file.c +13 -0
- data/vendor/libgit2/src/mwindow.c +1 -1
- data/vendor/libgit2/src/notes.c +1 -1
- data/vendor/libgit2/src/odb.c +13 -11
- data/vendor/libgit2/src/odb_loose.c +22 -10
- data/vendor/libgit2/src/odb_mempack.c +4 -2
- data/vendor/libgit2/src/offmap.h +3 -2
- data/vendor/libgit2/src/oid.c +1 -1
- data/vendor/libgit2/src/oidmap.h +2 -1
- data/vendor/libgit2/src/openssl_stream.c +6 -3
- data/vendor/libgit2/src/pack-objects.c +273 -12
- data/vendor/libgit2/src/pack-objects.h +10 -0
- data/vendor/libgit2/src/pack.c +17 -6
- data/vendor/libgit2/src/pack.h +1 -3
- data/vendor/libgit2/src/path.c +68 -38
- data/vendor/libgit2/src/pathspec.c +3 -0
- data/vendor/libgit2/src/pool.c +9 -8
- data/vendor/libgit2/src/posix.c +11 -1
- data/vendor/libgit2/src/push.c +15 -17
- data/vendor/libgit2/src/push.h +1 -6
- data/vendor/libgit2/src/rebase.c +77 -35
- data/vendor/libgit2/src/refdb_fs.c +2 -2
- data/vendor/libgit2/src/refs.c +107 -81
- data/vendor/libgit2/src/refs.h +2 -2
- data/vendor/libgit2/src/refspec.c +3 -0
- data/vendor/libgit2/src/remote.c +19 -21
- data/vendor/libgit2/src/repository.c +258 -67
- data/vendor/libgit2/src/repository.h +31 -16
- data/vendor/libgit2/src/reset.c +28 -12
- data/vendor/libgit2/src/revert.c +12 -7
- data/vendor/libgit2/src/revwalk.c +3 -5
- data/vendor/libgit2/src/revwalk.h +1 -1
- data/vendor/libgit2/src/sortedcache.c +5 -3
- data/vendor/libgit2/src/stash.c +3 -5
- data/vendor/libgit2/src/strmap.h +2 -1
- data/vendor/libgit2/src/submodule.c +5 -6
- data/vendor/libgit2/src/tag.c +7 -5
- data/vendor/libgit2/src/transaction.c +1 -1
- data/vendor/libgit2/src/transports/cred.c +5 -2
- data/vendor/libgit2/src/transports/git.c +2 -3
- data/vendor/libgit2/src/transports/local.c +15 -34
- data/vendor/libgit2/src/transports/smart.c +1 -1
- data/vendor/libgit2/src/transports/smart_pkt.c +58 -18
- data/vendor/libgit2/src/transports/smart_protocol.c +2 -2
- data/vendor/libgit2/src/transports/winhttp.c +2 -2
- data/vendor/libgit2/src/tree.c +7 -5
- data/vendor/libgit2/src/tsort.c +3 -1
- data/vendor/libgit2/src/util.c +25 -0
- data/vendor/libgit2/src/util.h +31 -27
- data/vendor/libgit2/src/vector.c +2 -7
- data/vendor/libgit2/src/win32/dir.c +5 -3
- data/vendor/libgit2/src/win32/git2.rc +8 -4
- data/vendor/libgit2/src/win32/mingw-compat.h +7 -0
- data/vendor/libgit2/src/win32/msvc-compat.h +3 -0
- data/vendor/libgit2/src/win32/posix.h +1 -3
- data/vendor/libgit2/src/win32/posix_w32.c +31 -7
- data/vendor/libgit2/src/win32/utf-conv.c +1 -3
- data/vendor/libgit2/src/zstream.c +1 -1
- metadata +5 -5
- data/vendor/libgit2/src/bswap.h +0 -97
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3ccaada5f69a36af35645687caa0f1a638a4b0b
|
4
|
+
data.tar.gz: c4bce14c10e3fe2a221414f741b165c7e66d7172
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fa91bf79f6400ec811298aab161e8204606e203dd9aa90e7f723a02d0ee84cd15dbb9b337a8d4f2ad0d8e635403a372cb81540ee4335163d9867a92de81c50d
|
7
|
+
data.tar.gz: db2139a478a8c3d357fabd5ff73a8206628b21feb6e8fef06124346da4b3b796cf38320ec50b18f0e8d5dae69aa05b1ea7ead18cb902803ca407f05c749a9fac
|
data/ext/rugged/rugged.c
CHANGED
@@ -175,7 +175,7 @@ static VALUE rb_git_prettify_message(int argc, VALUE *argv, VALUE self)
|
|
175
175
|
rb_scan_args(argc, argv, "11", &rb_message, &rb_strip);
|
176
176
|
|
177
177
|
Check_Type(rb_message, T_STRING);
|
178
|
-
|
178
|
+
|
179
179
|
switch (TYPE(rb_strip)) {
|
180
180
|
case T_FALSE:
|
181
181
|
strip_comments = 0;
|
@@ -495,4 +495,3 @@ void Init_rugged(void)
|
|
495
495
|
rb_mShutdownHook = Data_Wrap_Struct(rb_cObject, NULL, &cleanup_cb, NULL);
|
496
496
|
rb_global_variable(&rb_mShutdownHook);
|
497
497
|
}
|
498
|
-
|
@@ -51,7 +51,7 @@ static inline int rugged_branch_lookup(git_reference **branch, git_repository *r
|
|
51
51
|
|
52
52
|
if (strncmp(branch_name, "refs/heads/", strlen("refs/heads/")) == 0 ||
|
53
53
|
strncmp(branch_name, "refs/remotes/", strlen("refs/remotes/")) == 0)
|
54
|
-
return git_reference_lookup(branch, repo, branch_name);
|
54
|
+
return git_reference_lookup(branch, repo, branch_name);
|
55
55
|
|
56
56
|
if ((error = git_branch_lookup(branch, repo, branch_name, GIT_BRANCH_LOCAL)) == GIT_OK ||
|
57
57
|
error != GIT_ENOTFOUND)
|
@@ -70,7 +70,7 @@ static inline int rugged_branch_lookup(git_reference **branch, git_repository *r
|
|
70
70
|
|
71
71
|
return error;
|
72
72
|
} else {
|
73
|
-
rb_raise(rb_eTypeError, "Expecting a String or Rugged::Branch instance");
|
73
|
+
rb_raise(rb_eTypeError, "Expecting a String or Rugged::Branch instance");
|
74
74
|
}
|
75
75
|
}
|
76
76
|
|
@@ -120,12 +120,6 @@ static git_branch_t parse_branch_type(VALUE rb_filter)
|
|
120
120
|
* Overwrites the branch with the given +name+, if it already exists,
|
121
121
|
* instead of raising an exception.
|
122
122
|
*
|
123
|
-
* :message ::
|
124
|
-
* A single line log message to be appended to the reflog.
|
125
|
-
*
|
126
|
-
* :signature ::
|
127
|
-
* The signature to be used for populating the reflog entry.
|
128
|
-
*
|
129
123
|
* If a branch with the given +name+ already exists and +:force+ is not +true+,
|
130
124
|
* an exception will be raised.
|
131
125
|
*
|
@@ -137,8 +131,6 @@ static VALUE rb_git_branch_collection_create(int argc, VALUE *argv, VALUE self)
|
|
137
131
|
git_repository *repo;
|
138
132
|
git_reference *branch;
|
139
133
|
git_commit *target;
|
140
|
-
git_signature *signature = NULL;
|
141
|
-
char *log_message = NULL;
|
142
134
|
int error, force = 0;
|
143
135
|
|
144
136
|
rb_scan_args(argc, argv, "20:", &rb_name, &rb_target, &rb_options);
|
@@ -150,25 +142,14 @@ static VALUE rb_git_branch_collection_create(int argc, VALUE *argv, VALUE self)
|
|
150
142
|
Check_Type(rb_target, T_STRING);
|
151
143
|
|
152
144
|
if (!NIL_P(rb_options)) {
|
153
|
-
VALUE rb_val;
|
154
|
-
|
155
145
|
force = RTEST(rb_hash_aref(rb_options, CSTR2SYM("force")));
|
156
|
-
|
157
|
-
rb_val = rb_hash_aref(rb_options, CSTR2SYM("signature"));
|
158
|
-
if (!NIL_P(rb_val))
|
159
|
-
signature = rugged_signature_get(rb_val, repo);
|
160
|
-
|
161
|
-
rb_val = rb_hash_aref(rb_options, CSTR2SYM("message"));
|
162
|
-
if (!NIL_P(rb_val))
|
163
|
-
log_message = StringValueCStr(rb_val);
|
164
146
|
}
|
165
147
|
|
166
148
|
target = (git_commit *)rugged_object_get(repo, rb_target, GIT_OBJ_COMMIT);
|
167
149
|
|
168
|
-
error = git_branch_create(&branch, repo, StringValueCStr(rb_name), target, force
|
150
|
+
error = git_branch_create(&branch, repo, StringValueCStr(rb_name), target, force);
|
169
151
|
|
170
152
|
git_commit_free(target);
|
171
|
-
git_signature_free(signature);
|
172
153
|
|
173
154
|
rugged_exception_check(error);
|
174
155
|
|
@@ -300,7 +281,7 @@ static VALUE rb_git_branch_collection_each_name(int argc, VALUE *argv, VALUE sel
|
|
300
281
|
*
|
301
282
|
* Delete the specified branch.
|
302
283
|
*
|
303
|
-
* If a Rugged::Branch object was passed, the object will become
|
284
|
+
* If a Rugged::Branch object was passed, the object will become
|
304
285
|
* invalidated and won't be able to be used for any other operations.
|
305
286
|
*/
|
306
287
|
static VALUE rb_git_branch_collection_delete(VALUE self, VALUE rb_name_or_branch)
|
@@ -342,12 +323,6 @@ static VALUE rb_git_branch_collection_delete(VALUE self, VALUE rb_name_or_branch
|
|
342
323
|
* Overwrites the branch with the given +name+, if it already exists,
|
343
324
|
* instead of raising an exception.
|
344
325
|
*
|
345
|
-
* :message ::
|
346
|
-
* A single line log message to be appended to the reflog.
|
347
|
-
*
|
348
|
-
* :signature ::
|
349
|
-
* The signature to be used for populating the reflog entry.
|
350
|
-
*
|
351
326
|
* If a branch with the given +new_name+ already exists and +:force+ is not +true+,
|
352
327
|
* an exception will be raised.
|
353
328
|
*
|
@@ -359,8 +334,6 @@ static VALUE rb_git_branch_collection_move(int argc, VALUE *argv, VALUE self)
|
|
359
334
|
VALUE rb_repo = rugged_owner(self), rb_name_or_branch, rb_new_branch_name, rb_options;
|
360
335
|
git_reference *old_branch = NULL, *new_branch = NULL;
|
361
336
|
git_repository *repo;
|
362
|
-
git_signature *signature = NULL;
|
363
|
-
char *log_message = NULL;
|
364
337
|
int error, force = 0;
|
365
338
|
|
366
339
|
rb_scan_args(argc, argv, "20:", &rb_name_or_branch, &rb_new_branch_name, &rb_options);
|
@@ -368,27 +341,16 @@ static VALUE rb_git_branch_collection_move(int argc, VALUE *argv, VALUE self)
|
|
368
341
|
|
369
342
|
rugged_check_repo(rb_repo);
|
370
343
|
Data_Get_Struct(rb_repo, git_repository, repo);
|
371
|
-
|
344
|
+
|
372
345
|
error = rugged_branch_lookup(&old_branch, repo, rb_name_or_branch);
|
373
346
|
rugged_exception_check(error);
|
374
347
|
|
375
348
|
if (!NIL_P(rb_options)) {
|
376
|
-
VALUE rb_val;
|
377
|
-
|
378
349
|
force = RTEST(rb_hash_aref(rb_options, CSTR2SYM("force")));
|
379
|
-
|
380
|
-
rb_val = rb_hash_aref(rb_options, CSTR2SYM("signature"));
|
381
|
-
if (!NIL_P(rb_val))
|
382
|
-
signature = rugged_signature_get(rb_val, repo);
|
383
|
-
|
384
|
-
rb_val = rb_hash_aref(rb_options, CSTR2SYM("message"));
|
385
|
-
if (!NIL_P(rb_val))
|
386
|
-
log_message = StringValueCStr(rb_val);
|
387
350
|
}
|
388
351
|
|
389
|
-
error = git_branch_move(&new_branch, old_branch, StringValueCStr(rb_new_branch_name), force
|
352
|
+
error = git_branch_move(&new_branch, old_branch, StringValueCStr(rb_new_branch_name), force);
|
390
353
|
|
391
|
-
git_signature_free(signature);
|
392
354
|
git_reference_free(old_branch);
|
393
355
|
|
394
356
|
rugged_exception_check(error);
|
data/ext/rugged/rugged_config.c
CHANGED
@@ -87,18 +87,22 @@ static VALUE rb_git_config_new(VALUE klass, VALUE rb_path)
|
|
87
87
|
static VALUE rb_git_config_get(VALUE self, VALUE rb_key)
|
88
88
|
{
|
89
89
|
git_config *config;
|
90
|
-
|
90
|
+
git_buf buf = { NULL };
|
91
91
|
int error;
|
92
|
+
VALUE rb_result;
|
92
93
|
|
93
94
|
Data_Get_Struct(self, git_config, config);
|
94
95
|
Check_Type(rb_key, T_STRING);
|
95
96
|
|
96
|
-
error =
|
97
|
+
error = git_config_get_string_buf(&buf, config, StringValueCStr(rb_key));
|
97
98
|
if (error == GIT_ENOTFOUND)
|
98
99
|
return Qnil;
|
99
100
|
|
100
101
|
rugged_exception_check(error);
|
101
|
-
|
102
|
+
rb_result = rb_str_new_utf8(buf.ptr);
|
103
|
+
git_buf_free(&buf);
|
104
|
+
|
105
|
+
return rb_result;
|
102
106
|
}
|
103
107
|
|
104
108
|
/*
|
data/ext/rugged/rugged_object.c
CHANGED
@@ -285,7 +285,7 @@ VALUE rugged_object_rev_parse(VALUE rb_repo, VALUE rb_spec, int as_obj)
|
|
285
285
|
* Find and return a single object inside +repo+ as specified by the
|
286
286
|
* git revision string +str+.
|
287
287
|
*
|
288
|
-
* See http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions or
|
288
|
+
* See http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions or
|
289
289
|
* <code>man gitrevisions</code> for information on the accepted syntax.
|
290
290
|
*
|
291
291
|
* Raises a Rugged::InvalidError if +str+ does not contain a valid revision string.
|
@@ -301,7 +301,7 @@ VALUE rb_git_object_rev_parse(VALUE klass, VALUE rb_repo, VALUE rb_spec)
|
|
301
301
|
* Find and return the id of the object inside +repo+ as specified by the
|
302
302
|
* git revision string +str+.
|
303
303
|
*
|
304
|
-
* See http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions or
|
304
|
+
* See http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions or
|
305
305
|
* <code>man gitrevisions</code> for information on the accepted syntax.
|
306
306
|
*
|
307
307
|
* Raises a Rugged::InvalidError if +str+ does not contain a valid revision string.
|
@@ -58,18 +58,8 @@ static VALUE rb_git_reference_collection_initialize(VALUE self, VALUE repo)
|
|
58
58
|
* Overwrites the reference with the given +name+, if it already exists,
|
59
59
|
* instead of raising an exception.
|
60
60
|
*
|
61
|
-
* :message ::
|
62
|
-
* A single line log message to be appended to the reflog.
|
63
|
-
*
|
64
|
-
* :signature ::
|
65
|
-
* The signature to be used for populating the reflog entry.
|
66
|
-
*
|
67
61
|
* If a reference with the given +name+ already exists and +:force+ is not +true+,
|
68
62
|
* an exception will be raised.
|
69
|
-
*
|
70
|
-
* The +:message+ and +:signature+ options are ignored if the reference does not
|
71
|
-
* belong to the standard set (+HEAD+, +refs/heads/*+, +refs/remotes/*+ or +refs/notes/*+)
|
72
|
-
* and it does not have a reflog.
|
73
63
|
*/
|
74
64
|
static VALUE rb_git_reference_collection_create(int argc, VALUE *argv, VALUE self)
|
75
65
|
{
|
@@ -77,7 +67,6 @@ static VALUE rb_git_reference_collection_create(int argc, VALUE *argv, VALUE sel
|
|
77
67
|
git_repository *repo;
|
78
68
|
git_reference *ref;
|
79
69
|
git_oid oid;
|
80
|
-
git_signature *signature = NULL;
|
81
70
|
char *log_message = NULL;
|
82
71
|
int error, force = 0;
|
83
72
|
|
@@ -89,28 +78,21 @@ static VALUE rb_git_reference_collection_create(int argc, VALUE *argv, VALUE sel
|
|
89
78
|
Check_Type(rb_target, T_STRING);
|
90
79
|
|
91
80
|
if (!NIL_P(rb_options)) {
|
92
|
-
VALUE rb_val;
|
93
|
-
|
94
|
-
force = RTEST(rb_hash_aref(rb_options, CSTR2SYM("force")));
|
95
|
-
|
96
|
-
rb_val = rb_hash_aref(rb_options, CSTR2SYM("signature"));
|
97
|
-
if (!NIL_P(rb_val))
|
98
|
-
signature = rugged_signature_get(rb_val, repo);
|
99
|
-
|
100
|
-
rb_val = rb_hash_aref(rb_options, CSTR2SYM("message"));
|
81
|
+
VALUE rb_val = rb_hash_aref(rb_options, CSTR2SYM("message"));
|
101
82
|
if (!NIL_P(rb_val))
|
102
83
|
log_message = StringValueCStr(rb_val);
|
84
|
+
|
85
|
+
force = RTEST(rb_hash_aref(rb_options, CSTR2SYM("force")));
|
103
86
|
}
|
104
87
|
|
105
88
|
if (git_oid_fromstr(&oid, StringValueCStr(rb_target)) == GIT_OK) {
|
106
89
|
error = git_reference_create(
|
107
|
-
&ref, repo, StringValueCStr(rb_name), &oid, force,
|
90
|
+
&ref, repo, StringValueCStr(rb_name), &oid, force, log_message);
|
108
91
|
} else {
|
109
92
|
error = git_reference_symbolic_create(
|
110
|
-
&ref, repo, StringValueCStr(rb_name), StringValueCStr(rb_target), force,
|
93
|
+
&ref, repo, StringValueCStr(rb_name), StringValueCStr(rb_target), force, log_message);
|
111
94
|
}
|
112
95
|
|
113
|
-
git_signature_free(signature);
|
114
96
|
rugged_exception_check(error);
|
115
97
|
|
116
98
|
return rugged_ref_new(rb_cRuggedReference, rb_repo, ref);
|
@@ -284,18 +266,8 @@ static VALUE rb_git_reference_collection_exist_p(VALUE self, VALUE rb_name_or_re
|
|
284
266
|
* Overwrites the reference with the given +name+, if it already exists,
|
285
267
|
* instead of raising an exception.
|
286
268
|
*
|
287
|
-
* :message ::
|
288
|
-
* A single line log message to be appended to the reflog.
|
289
|
-
*
|
290
|
-
* :signature ::
|
291
|
-
* The signature to be used for populating the reflog entry.
|
292
|
-
*
|
293
269
|
* If a reference with the given +new_name+ already exists and +:force+ is not +true+,
|
294
270
|
* an exception will be raised.
|
295
|
-
*
|
296
|
-
* The +:message+ and +:signature+ options are ignored if the reference does not
|
297
|
-
* belong to the standard set (+HEAD+, +refs/heads/*+, +refs/remotes/*+ or +refs/notes/*+)
|
298
|
-
* and it does not have a reflog.
|
299
271
|
*/
|
300
272
|
static VALUE rb_git_reference_collection_rename(int argc, VALUE *argv, VALUE self)
|
301
273
|
{
|
@@ -303,7 +275,6 @@ static VALUE rb_git_reference_collection_rename(int argc, VALUE *argv, VALUE sel
|
|
303
275
|
VALUE rb_repo = rugged_owner(self);
|
304
276
|
git_reference *ref, *out = NULL;
|
305
277
|
git_repository *repo;
|
306
|
-
git_signature *signature = NULL;
|
307
278
|
char *log_message = NULL;
|
308
279
|
int error, force = 0;
|
309
280
|
|
@@ -320,24 +291,17 @@ static VALUE rb_git_reference_collection_rename(int argc, VALUE *argv, VALUE sel
|
|
320
291
|
Data_Get_Struct(rb_repo, git_repository, repo);
|
321
292
|
|
322
293
|
if (!NIL_P(rb_options)) {
|
323
|
-
VALUE rb_val;
|
324
|
-
|
325
|
-
force = RTEST(rb_hash_aref(rb_options, CSTR2SYM("force")));
|
326
|
-
|
327
|
-
rb_val = rb_hash_aref(rb_options, CSTR2SYM("signature"));
|
328
|
-
if (!NIL_P(rb_val))
|
329
|
-
signature = rugged_signature_get(rb_val, repo);
|
330
|
-
|
331
|
-
rb_val = rb_hash_aref(rb_options, CSTR2SYM("message"));
|
294
|
+
VALUE rb_val = rb_hash_aref(rb_options, CSTR2SYM("message"));
|
332
295
|
if (!NIL_P(rb_val))
|
333
296
|
log_message = StringValueCStr(rb_val);
|
297
|
+
|
298
|
+
force = RTEST(rb_hash_aref(rb_options, CSTR2SYM("force")));
|
334
299
|
}
|
335
300
|
|
336
301
|
if ((error = git_reference_lookup(&ref, repo, StringValueCStr(rb_name_or_ref))) == GIT_OK)
|
337
|
-
error = git_reference_rename(&out, ref, StringValueCStr(rb_new_name), force,
|
302
|
+
error = git_reference_rename(&out, ref, StringValueCStr(rb_new_name), force, log_message);
|
338
303
|
|
339
304
|
git_reference_free(ref);
|
340
|
-
git_signature_free(signature);
|
341
305
|
|
342
306
|
rugged_exception_check(error);
|
343
307
|
|
@@ -371,7 +335,6 @@ static VALUE rb_git_reference_collection_update(int argc, VALUE *argv, VALUE sel
|
|
371
335
|
{
|
372
336
|
VALUE rb_repo = rugged_owner(self), rb_name_or_ref, rb_target, rb_options;
|
373
337
|
git_repository *repo = NULL;
|
374
|
-
git_signature *signature = NULL;
|
375
338
|
git_reference *ref = NULL, *out = NULL;
|
376
339
|
char *log_message = NULL;
|
377
340
|
int error;
|
@@ -391,13 +354,7 @@ static VALUE rb_git_reference_collection_update(int argc, VALUE *argv, VALUE sel
|
|
391
354
|
rb_raise(rb_eTypeError, "Expecting a String or Rugged::Reference instance");
|
392
355
|
|
393
356
|
if (!NIL_P(rb_options)) {
|
394
|
-
VALUE rb_val;
|
395
|
-
|
396
|
-
rb_val = rb_hash_aref(rb_options, CSTR2SYM("signature"));
|
397
|
-
if (!NIL_P(rb_val))
|
398
|
-
signature = rugged_signature_get(rb_val, repo);
|
399
|
-
|
400
|
-
rb_val = rb_hash_aref(rb_options, CSTR2SYM("message"));
|
357
|
+
VALUE rb_val = rb_hash_aref(rb_options, CSTR2SYM("message"));
|
401
358
|
if (!NIL_P(rb_val))
|
402
359
|
log_message = StringValueCStr(rb_val);
|
403
360
|
}
|
@@ -414,15 +371,14 @@ static VALUE rb_git_reference_collection_update(int argc, VALUE *argv, VALUE sel
|
|
414
371
|
error = git_oid_fromstr(&target, StringValueCStr(rb_target));
|
415
372
|
if (error) goto cleanup;
|
416
373
|
|
417
|
-
error = git_reference_set_target(&out, ref, &target,
|
374
|
+
error = git_reference_set_target(&out, ref, &target, log_message);
|
418
375
|
} else {
|
419
|
-
error = git_reference_symbolic_set_target(&out, ref, StringValueCStr(rb_target),
|
376
|
+
error = git_reference_symbolic_set_target(&out, ref, StringValueCStr(rb_target), log_message);
|
420
377
|
}
|
421
378
|
|
422
379
|
cleanup:
|
423
380
|
|
424
381
|
git_reference_free(ref);
|
425
|
-
git_signature_free(signature);
|
426
382
|
rugged_exception_check(error);
|
427
383
|
|
428
384
|
return rugged_ref_new(rb_cRuggedReference, rb_repo, out);
|
data/ext/rugged/rugged_remote.c
CHANGED
@@ -608,9 +608,6 @@ cleanup:
|
|
608
608
|
* :message ::
|
609
609
|
* The message to insert into the reflogs. Defaults to "fetch".
|
610
610
|
*
|
611
|
-
* :signature ::
|
612
|
-
* The signature to be used for updating the reflogs.
|
613
|
-
*
|
614
611
|
* Example:
|
615
612
|
*
|
616
613
|
* remote = Rugged::Remote.lookup(@repo, 'origin')
|
@@ -624,7 +621,6 @@ static VALUE rb_git_remote_fetch(int argc, VALUE *argv, VALUE self)
|
|
624
621
|
{
|
625
622
|
git_remote *remote;
|
626
623
|
git_repository *repo;
|
627
|
-
git_signature *signature = NULL;
|
628
624
|
git_strarray refspecs;
|
629
625
|
git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT;
|
630
626
|
struct rugged_remote_cb_payload payload = { Qnil, Qnil, Qnil, Qnil, Qnil, Qnil, 0 };
|
@@ -645,11 +641,7 @@ static VALUE rb_git_remote_fetch(int argc, VALUE *argv, VALUE self)
|
|
645
641
|
rugged_remote_init_callbacks_and_payload_from_options(rb_options, &callbacks, &payload);
|
646
642
|
|
647
643
|
if (!NIL_P(rb_options)) {
|
648
|
-
VALUE rb_val = rb_hash_aref(rb_options, CSTR2SYM("
|
649
|
-
if (!NIL_P(rb_val))
|
650
|
-
signature = rugged_signature_get(rb_val, repo);
|
651
|
-
|
652
|
-
rb_val = rb_hash_aref(rb_options, CSTR2SYM("message"));
|
644
|
+
VALUE rb_val = rb_hash_aref(rb_options, CSTR2SYM("message"));
|
653
645
|
if (!NIL_P(rb_val))
|
654
646
|
log_message = StringValueCStr(rb_val);
|
655
647
|
}
|
@@ -657,7 +649,7 @@ static VALUE rb_git_remote_fetch(int argc, VALUE *argv, VALUE self)
|
|
657
649
|
if ((error = git_remote_set_callbacks(remote, &callbacks)))
|
658
650
|
goto cleanup;
|
659
651
|
|
660
|
-
if ((error = git_remote_fetch(remote, &refspecs,
|
652
|
+
if ((error = git_remote_fetch(remote, &refspecs, log_message)) == GIT_OK) {
|
661
653
|
const git_transfer_progress *stats = git_remote_stats(remote);
|
662
654
|
|
663
655
|
rb_result = rb_hash_new();
|
@@ -673,7 +665,6 @@ static VALUE rb_git_remote_fetch(int argc, VALUE *argv, VALUE self)
|
|
673
665
|
cleanup:
|
674
666
|
|
675
667
|
xfree(refspecs.strings);
|
676
|
-
git_signature_free(signature);
|
677
668
|
|
678
669
|
if (payload.exception)
|
679
670
|
rb_jump_tag(payload.exception);
|
@@ -705,13 +696,6 @@ static VALUE rb_git_remote_fetch(int argc, VALUE *argv, VALUE self)
|
|
705
696
|
* A callback that will be executed each time a reference is updated remotely. It will be
|
706
697
|
* passed the +refname+, +old_oid+ and +new_oid+.
|
707
698
|
*
|
708
|
-
* :message ::
|
709
|
-
* A single line log message to be appended to the reflog of each local remote-tracking
|
710
|
-
* branch that gets updated. Defaults to: "fetch".
|
711
|
-
*
|
712
|
-
* :signature ::
|
713
|
-
* The signature to be used for populating the reflog entries.
|
714
|
-
*
|
715
699
|
* Example:
|
716
700
|
*
|
717
701
|
* remote = Rugged::Remote.lookup(@repo, 'origin')
|
@@ -719,18 +703,16 @@ static VALUE rb_git_remote_fetch(int argc, VALUE *argv, VALUE self)
|
|
719
703
|
*/
|
720
704
|
static VALUE rb_git_remote_push(int argc, VALUE *argv, VALUE self)
|
721
705
|
{
|
722
|
-
VALUE rb_refspecs, rb_options
|
706
|
+
VALUE rb_refspecs, rb_options;
|
723
707
|
VALUE rb_repo = rugged_owner(self);
|
724
708
|
|
725
709
|
git_repository *repo;
|
726
710
|
git_remote *remote;
|
727
711
|
git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT;
|
728
|
-
git_signature *signature = NULL;
|
729
712
|
git_strarray refspecs;
|
730
713
|
git_push_options opts = GIT_PUSH_OPTIONS_INIT;
|
731
714
|
|
732
715
|
int error = 0;
|
733
|
-
char *log_message = NULL;
|
734
716
|
|
735
717
|
struct rugged_remote_cb_payload payload = { Qnil, Qnil, Qnil, Qnil, Qnil, rb_hash_new(), 0 };
|
736
718
|
|
@@ -744,24 +726,13 @@ static VALUE rb_git_remote_push(int argc, VALUE *argv, VALUE self)
|
|
744
726
|
|
745
727
|
rugged_remote_init_callbacks_and_payload_from_options(rb_options, &callbacks, &payload);
|
746
728
|
|
747
|
-
if (!NIL_P(rb_options)) {
|
748
|
-
rb_val = rb_hash_aref(rb_options, CSTR2SYM("message"));
|
749
|
-
if (!NIL_P(rb_val))
|
750
|
-
log_message = StringValueCStr(rb_val);
|
751
|
-
|
752
|
-
rb_val = rb_hash_aref(rb_options, CSTR2SYM("signature"));
|
753
|
-
if (!NIL_P(rb_val))
|
754
|
-
signature = rugged_signature_get(rb_val, repo);
|
755
|
-
}
|
756
|
-
|
757
729
|
if ((error = git_remote_set_callbacks(remote, &callbacks)))
|
758
730
|
goto cleanup;
|
759
731
|
|
760
|
-
error = git_remote_push(remote, &refspecs, &opts
|
732
|
+
error = git_remote_push(remote, &refspecs, &opts);
|
761
733
|
|
762
734
|
cleanup:
|
763
735
|
xfree(refspecs.strings);
|
764
|
-
git_signature_free(signature);
|
765
736
|
|
766
737
|
if (payload.exception)
|
767
738
|
rb_jump_tag(payload.exception);
|