rdavila-rugged 0.24.0b13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +619 -0
- data/ext/rugged/extconf.rb +105 -0
- data/ext/rugged/rugged.c +527 -0
- data/ext/rugged/rugged.h +185 -0
- data/ext/rugged/rugged_backend.c +34 -0
- data/ext/rugged/rugged_blame.c +292 -0
- data/ext/rugged/rugged_blob.c +638 -0
- data/ext/rugged/rugged_branch.c +195 -0
- data/ext/rugged/rugged_branch_collection.c +408 -0
- data/ext/rugged/rugged_commit.c +691 -0
- data/ext/rugged/rugged_config.c +404 -0
- data/ext/rugged/rugged_cred.c +148 -0
- data/ext/rugged/rugged_diff.c +686 -0
- data/ext/rugged/rugged_diff_delta.c +105 -0
- data/ext/rugged/rugged_diff_hunk.c +103 -0
- data/ext/rugged/rugged_diff_line.c +83 -0
- data/ext/rugged/rugged_index.c +1255 -0
- data/ext/rugged/rugged_note.c +376 -0
- data/ext/rugged/rugged_object.c +383 -0
- data/ext/rugged/rugged_patch.c +245 -0
- data/ext/rugged/rugged_reference.c +396 -0
- data/ext/rugged/rugged_reference_collection.c +446 -0
- data/ext/rugged/rugged_remote.c +691 -0
- data/ext/rugged/rugged_remote_collection.c +457 -0
- data/ext/rugged/rugged_repo.c +2669 -0
- data/ext/rugged/rugged_revwalk.c +495 -0
- data/ext/rugged/rugged_settings.c +155 -0
- data/ext/rugged/rugged_signature.c +106 -0
- data/ext/rugged/rugged_submodule.c +852 -0
- data/ext/rugged/rugged_submodule_collection.c +384 -0
- data/ext/rugged/rugged_tag.c +251 -0
- data/ext/rugged/rugged_tag_collection.c +347 -0
- data/ext/rugged/rugged_tree.c +919 -0
- data/lib/rugged.rb +23 -0
- data/lib/rugged/attributes.rb +41 -0
- data/lib/rugged/blob.rb +28 -0
- data/lib/rugged/branch.rb +19 -0
- data/lib/rugged/commit.rb +54 -0
- data/lib/rugged/console.rb +9 -0
- data/lib/rugged/credentials.rb +43 -0
- data/lib/rugged/diff.rb +20 -0
- data/lib/rugged/diff/delta.rb +53 -0
- data/lib/rugged/diff/hunk.rb +18 -0
- data/lib/rugged/diff/line.rb +47 -0
- data/lib/rugged/index.rb +13 -0
- data/lib/rugged/object.rb +7 -0
- data/lib/rugged/patch.rb +36 -0
- data/lib/rugged/reference.rb +7 -0
- data/lib/rugged/remote.rb +4 -0
- data/lib/rugged/repository.rb +227 -0
- data/lib/rugged/submodule_collection.rb +48 -0
- data/lib/rugged/tag.rb +50 -0
- data/lib/rugged/tree.rb +38 -0
- data/lib/rugged/version.rb +3 -0
- data/lib/rugged/walker.rb +5 -0
- metadata +146 -0
@@ -0,0 +1,457 @@
|
|
1
|
+
/*
|
2
|
+
* The MIT License
|
3
|
+
*
|
4
|
+
* Copyright (c) 2014 GitHub, Inc
|
5
|
+
*
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
11
|
+
* furnished to do so, subject to the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be included in
|
14
|
+
* all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
* THE SOFTWARE.
|
23
|
+
*/
|
24
|
+
|
25
|
+
#include "rugged.h"
|
26
|
+
|
27
|
+
extern VALUE rb_mRugged;
|
28
|
+
extern VALUE rb_cRuggedRepo;
|
29
|
+
extern VALUE rb_eRuggedError;
|
30
|
+
extern VALUE rb_cRuggedRemote;
|
31
|
+
VALUE rb_cRuggedRemoteCollection;
|
32
|
+
|
33
|
+
/*
|
34
|
+
* call-seq:
|
35
|
+
* RemoteCollection.new(repo) -> remotes
|
36
|
+
*
|
37
|
+
* Creates and returns a new collection of remotes for the given +repo+.
|
38
|
+
*/
|
39
|
+
static VALUE rb_git_remote_collection_initialize(VALUE self, VALUE repo)
|
40
|
+
{
|
41
|
+
rugged_set_owner(self, repo);
|
42
|
+
return self;
|
43
|
+
}
|
44
|
+
|
45
|
+
/*
|
46
|
+
* call-seq:
|
47
|
+
* remotes.create_anonymous(url) -> remote
|
48
|
+
*
|
49
|
+
* Return a new remote with +url+ in +repository+ , the remote is not persisted:
|
50
|
+
* - +url+: a valid remote url
|
51
|
+
*
|
52
|
+
* Returns a new Rugged::Remote object.
|
53
|
+
*
|
54
|
+
* @repo.remotes.create_anonymous('git://github.com/libgit2/libgit2.git') #=> #<Rugged::Remote:0x00000001fbfa80>
|
55
|
+
*/
|
56
|
+
static VALUE rb_git_remote_collection_create_anonymous(VALUE self, VALUE rb_url)
|
57
|
+
{
|
58
|
+
git_remote *remote;
|
59
|
+
git_repository *repo;
|
60
|
+
int error;
|
61
|
+
|
62
|
+
VALUE rb_repo = rugged_owner(self);
|
63
|
+
|
64
|
+
rugged_check_repo(rb_repo);
|
65
|
+
Data_Get_Struct(rb_repo, git_repository, repo);
|
66
|
+
|
67
|
+
Check_Type(rb_url, T_STRING);
|
68
|
+
|
69
|
+
error = git_remote_create_anonymous(
|
70
|
+
&remote,
|
71
|
+
repo,
|
72
|
+
StringValueCStr(rb_url));
|
73
|
+
|
74
|
+
rugged_exception_check(error);
|
75
|
+
|
76
|
+
return rugged_remote_new(rb_repo, remote);
|
77
|
+
}
|
78
|
+
|
79
|
+
/*
|
80
|
+
* call-seq:
|
81
|
+
* remotes.create(name, url) -> remote
|
82
|
+
*
|
83
|
+
* Add a new remote with +name+ and +url+ to +repository+
|
84
|
+
* - +url+: a valid remote url
|
85
|
+
* - +name+: a valid remote name
|
86
|
+
*
|
87
|
+
* Returns a new Rugged::Remote object.
|
88
|
+
*
|
89
|
+
* @repo.remotes.create('origin', 'git://github.com/libgit2/rugged.git') #=> #<Rugged::Remote:0x00000001fbfa80>
|
90
|
+
*/
|
91
|
+
static VALUE rb_git_remote_collection_create(VALUE self, VALUE rb_name, VALUE rb_url)
|
92
|
+
{
|
93
|
+
git_remote *remote;
|
94
|
+
git_repository *repo;
|
95
|
+
int error;
|
96
|
+
|
97
|
+
VALUE rb_repo = rugged_owner(self);
|
98
|
+
|
99
|
+
rugged_check_repo(rb_repo);
|
100
|
+
Data_Get_Struct(rb_repo, git_repository, repo);
|
101
|
+
|
102
|
+
Check_Type(rb_name, T_STRING);
|
103
|
+
Check_Type(rb_url, T_STRING);
|
104
|
+
|
105
|
+
error = git_remote_create(
|
106
|
+
&remote,
|
107
|
+
repo,
|
108
|
+
StringValueCStr(rb_name),
|
109
|
+
StringValueCStr(rb_url));
|
110
|
+
|
111
|
+
rugged_exception_check(error);
|
112
|
+
|
113
|
+
return rugged_remote_new(rb_repo, remote);
|
114
|
+
}
|
115
|
+
|
116
|
+
/*
|
117
|
+
* call-seq:
|
118
|
+
* remotes[name] -> remote or nil
|
119
|
+
*
|
120
|
+
* Lookup a remote in the collection with the given +name+.
|
121
|
+
*
|
122
|
+
* Returns a new Rugged::Remote object or +nil+ if the
|
123
|
+
* remote doesn't exist.
|
124
|
+
*
|
125
|
+
* @repo.remotes["origin"] #=> #<Rugged::Remote:0x00000001fbfa80>
|
126
|
+
*/
|
127
|
+
static VALUE rb_git_remote_collection_aref(VALUE self, VALUE rb_name)
|
128
|
+
{
|
129
|
+
git_remote *remote;
|
130
|
+
git_repository *repo;
|
131
|
+
int error;
|
132
|
+
|
133
|
+
VALUE rb_repo = rugged_owner(self);
|
134
|
+
rugged_check_repo(rb_repo);
|
135
|
+
Data_Get_Struct(rb_repo, git_repository, repo);
|
136
|
+
|
137
|
+
Check_Type(rb_name, T_STRING);
|
138
|
+
|
139
|
+
error = git_remote_lookup(&remote, repo, StringValueCStr(rb_name));
|
140
|
+
|
141
|
+
if (error == GIT_ENOTFOUND)
|
142
|
+
return Qnil;
|
143
|
+
|
144
|
+
rugged_exception_check(error);
|
145
|
+
|
146
|
+
return rugged_remote_new(rb_repo, remote);
|
147
|
+
}
|
148
|
+
|
149
|
+
static VALUE rb_git_remote_collection__each(VALUE self, int only_names)
|
150
|
+
{
|
151
|
+
git_repository *repo;
|
152
|
+
git_strarray remotes;
|
153
|
+
size_t i;
|
154
|
+
int error = 0;
|
155
|
+
int exception = 0;
|
156
|
+
|
157
|
+
VALUE rb_repo;
|
158
|
+
|
159
|
+
if (!rb_block_given_p()) {
|
160
|
+
if (only_names)
|
161
|
+
return rb_funcall(self, rb_intern("to_enum"), 1, CSTR2SYM("each_name"));
|
162
|
+
else
|
163
|
+
return rb_funcall(self, rb_intern("to_enum"), 1, CSTR2SYM("each"));
|
164
|
+
}
|
165
|
+
|
166
|
+
rb_repo = rugged_owner(self);
|
167
|
+
rugged_check_repo(rb_repo);
|
168
|
+
Data_Get_Struct(rb_repo, git_repository, repo);
|
169
|
+
|
170
|
+
error = git_remote_list(&remotes, repo);
|
171
|
+
rugged_exception_check(error);
|
172
|
+
|
173
|
+
if (only_names) {
|
174
|
+
for (i = 0; !exception && i < remotes.count; ++i) {
|
175
|
+
rb_protect(rb_yield, rb_str_new_utf8(remotes.strings[i]), &exception);
|
176
|
+
}
|
177
|
+
} else {
|
178
|
+
for (i = 0; !exception && !error && i < remotes.count; ++i) {
|
179
|
+
git_remote *remote;
|
180
|
+
|
181
|
+
if (!(error = git_remote_lookup(&remote, repo, remotes.strings[i])))
|
182
|
+
rb_protect(rb_yield, rugged_remote_new(rb_repo, remote), &exception);
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
git_strarray_free(&remotes);
|
187
|
+
|
188
|
+
if (exception)
|
189
|
+
rb_jump_tag(exception);
|
190
|
+
|
191
|
+
rugged_exception_check(error);
|
192
|
+
|
193
|
+
return Qnil;
|
194
|
+
}
|
195
|
+
|
196
|
+
|
197
|
+
/*
|
198
|
+
* call-seq:
|
199
|
+
* remotes.each { |remote| } -> nil
|
200
|
+
* remotes.each -> enumerator
|
201
|
+
*
|
202
|
+
* Iterate through all the remotes in the collection's +repository+.
|
203
|
+
*
|
204
|
+
* The given block will be called once with a Rugged::Remote
|
205
|
+
* instance for each remote.
|
206
|
+
*
|
207
|
+
* If no block is given, an enumerator will be returned.
|
208
|
+
*/
|
209
|
+
static VALUE rb_git_remote_collection_each(VALUE self)
|
210
|
+
{
|
211
|
+
return rb_git_remote_collection__each(self, 0);
|
212
|
+
}
|
213
|
+
|
214
|
+
/*
|
215
|
+
* call-seq:
|
216
|
+
* remotes.each_name { |str| } -> nil
|
217
|
+
* remotes.each_name -> enumerator
|
218
|
+
*
|
219
|
+
* Iterate through all the remote names in the collection's +repository+.
|
220
|
+
*
|
221
|
+
* The given block will be called once with the name of each remote.
|
222
|
+
*
|
223
|
+
* If no block is given, an enumerator will be returned.
|
224
|
+
*/
|
225
|
+
static VALUE rb_git_remote_collection_each_name(VALUE self)
|
226
|
+
{
|
227
|
+
return rb_git_remote_collection__each(self, 1);
|
228
|
+
}
|
229
|
+
|
230
|
+
/*
|
231
|
+
* call-seq:
|
232
|
+
* remotes.rename(remote, new_name) { |str| } -> remote
|
233
|
+
* remotes.rename(name, new_name) { |str| } -> remote
|
234
|
+
*
|
235
|
+
* Renames a remote.
|
236
|
+
*
|
237
|
+
* All remote-tracking branches and configuration settings
|
238
|
+
* for the remote are updated.
|
239
|
+
*
|
240
|
+
* Non-default refspecs cannot be renamed automatically and will be
|
241
|
+
* yielded to the given block.
|
242
|
+
*
|
243
|
+
* Anonymous, in-memory remotes created through
|
244
|
+
* +ReferenceCollection#create_anonymous+ can not be given a name through
|
245
|
+
* this method.
|
246
|
+
*
|
247
|
+
* Returns a new Rugged::Remote object with the new name.
|
248
|
+
*/
|
249
|
+
static VALUE rb_git_remote_collection_rename(VALUE self, VALUE rb_name_or_remote, VALUE rb_new_name)
|
250
|
+
{
|
251
|
+
VALUE rb_repo = rugged_owner(self);
|
252
|
+
git_repository *repo;
|
253
|
+
size_t i;
|
254
|
+
int error, exception;
|
255
|
+
git_strarray problems;
|
256
|
+
|
257
|
+
if (!rb_block_given_p())
|
258
|
+
rb_raise(rb_eArgError, "Rugged::RemoteCollection#rename must be called with a block");
|
259
|
+
|
260
|
+
Check_Type(rb_new_name, T_STRING);
|
261
|
+
|
262
|
+
if (rb_obj_is_kind_of(rb_name_or_remote, rb_cRuggedRemote))
|
263
|
+
rb_name_or_remote = rb_funcall(rb_name_or_remote, rb_intern("name"), 0);
|
264
|
+
|
265
|
+
if (TYPE(rb_name_or_remote) != T_STRING)
|
266
|
+
rb_raise(rb_eTypeError, "Expecting a String or Rugged::Remote instance");
|
267
|
+
|
268
|
+
rugged_check_repo(rb_repo);
|
269
|
+
Data_Get_Struct(rb_repo, git_repository, repo);
|
270
|
+
|
271
|
+
error = git_remote_rename(&problems, repo, StringValueCStr(rb_name_or_remote), StringValueCStr(rb_new_name));
|
272
|
+
rugged_exception_check(error);
|
273
|
+
|
274
|
+
for (i = exception = 0; !exception && i < problems.count; ++i) {
|
275
|
+
rb_protect(rb_yield, rb_str_new_utf8(problems.strings[i]), &exception);
|
276
|
+
}
|
277
|
+
|
278
|
+
git_strarray_free(&problems);
|
279
|
+
|
280
|
+
if (exception)
|
281
|
+
rb_jump_tag(exception);
|
282
|
+
|
283
|
+
return rb_git_remote_collection_aref(self, rb_new_name);
|
284
|
+
}
|
285
|
+
|
286
|
+
/*
|
287
|
+
* call-seq:
|
288
|
+
* remotes.delete(remote) -> nil
|
289
|
+
* remotes.delete(name) -> nil
|
290
|
+
*
|
291
|
+
* Delete the specified remote.
|
292
|
+
*
|
293
|
+
* repo.remotes.delete("origin")
|
294
|
+
* # Remote no longer exists in the configuration.
|
295
|
+
*/
|
296
|
+
static VALUE rb_git_remote_collection_delete(VALUE self, VALUE rb_name_or_remote)
|
297
|
+
{
|
298
|
+
VALUE rb_repo = rugged_owner(self);
|
299
|
+
git_repository *repo;
|
300
|
+
|
301
|
+
if (rb_obj_is_kind_of(rb_name_or_remote, rb_cRuggedRemote))
|
302
|
+
rb_name_or_remote = rb_funcall(rb_name_or_remote, rb_intern("name"), 0);
|
303
|
+
|
304
|
+
if (TYPE(rb_name_or_remote) != T_STRING)
|
305
|
+
rb_raise(rb_eTypeError, "Expecting a String or Rugged::Remote instance");
|
306
|
+
|
307
|
+
rugged_check_repo(rb_repo);
|
308
|
+
Data_Get_Struct(rb_repo, git_repository, repo);
|
309
|
+
|
310
|
+
rugged_exception_check(
|
311
|
+
git_remote_delete(repo, StringValueCStr(rb_name_or_remote))
|
312
|
+
);
|
313
|
+
|
314
|
+
return Qnil;
|
315
|
+
}
|
316
|
+
|
317
|
+
/*
|
318
|
+
* call-seq:
|
319
|
+
* remotes.set_url(remote, url) -> nil
|
320
|
+
* remotes.set_url(name, url) -> nil
|
321
|
+
*
|
322
|
+
* Sets the remote's url in the configuration.
|
323
|
+
* Rugged::Remote objects already in memory will not be affected.
|
324
|
+
*
|
325
|
+
* repo.remotes.set_url("origin", 'git://github.com/libgit2/rugged.git')
|
326
|
+
*/
|
327
|
+
static VALUE rb_git_remote_collection_set_url(VALUE self, VALUE rb_name_or_remote, VALUE rb_url)
|
328
|
+
{
|
329
|
+
VALUE rb_repo = rugged_owner(self);
|
330
|
+
git_repository *repo;
|
331
|
+
|
332
|
+
if (rb_obj_is_kind_of(rb_name_or_remote, rb_cRuggedRemote))
|
333
|
+
rb_name_or_remote = rb_funcall(rb_name_or_remote, rb_intern("name"), 0);
|
334
|
+
|
335
|
+
if (TYPE(rb_name_or_remote) != T_STRING)
|
336
|
+
rb_raise(rb_eTypeError, "Expecting a String or Rugged::Remote instance");
|
337
|
+
|
338
|
+
rugged_check_repo(rb_repo);
|
339
|
+
Data_Get_Struct(rb_repo, git_repository, repo);
|
340
|
+
|
341
|
+
Check_Type(rb_url, T_STRING);
|
342
|
+
|
343
|
+
rugged_exception_check(
|
344
|
+
git_remote_set_url(repo, StringValueCStr(rb_name_or_remote), StringValueCStr(rb_url))
|
345
|
+
);
|
346
|
+
|
347
|
+
return Qnil;
|
348
|
+
}
|
349
|
+
|
350
|
+
/*
|
351
|
+
* call-seq:
|
352
|
+
* remotes.set_push_url(remote, url) -> nil
|
353
|
+
* remotes.set_push_url(name, url) -> nil
|
354
|
+
*
|
355
|
+
* Sets the remote's url for pushing in the configuration.
|
356
|
+
* Rugged::Remote objects already in memory will not be affected.
|
357
|
+
*
|
358
|
+
* repo.remotes.set_push_url("origin", 'git://github.com/libgit2/rugged.git')
|
359
|
+
*/
|
360
|
+
static VALUE rb_git_remote_collection_set_push_url(VALUE self, VALUE rb_name_or_remote, VALUE rb_url)
|
361
|
+
{
|
362
|
+
VALUE rb_repo = rugged_owner(self);
|
363
|
+
git_repository *repo;
|
364
|
+
|
365
|
+
if (rb_obj_is_kind_of(rb_name_or_remote, rb_cRuggedRemote))
|
366
|
+
rb_name_or_remote = rb_funcall(rb_name_or_remote, rb_intern("name"), 0);
|
367
|
+
|
368
|
+
if (TYPE(rb_name_or_remote) != T_STRING)
|
369
|
+
rb_raise(rb_eTypeError, "Expecting a String or Rugged::Remote instance");
|
370
|
+
|
371
|
+
rugged_check_repo(rb_repo);
|
372
|
+
Data_Get_Struct(rb_repo, git_repository, repo);
|
373
|
+
|
374
|
+
Check_Type(rb_url, T_STRING);
|
375
|
+
|
376
|
+
rugged_exception_check(
|
377
|
+
git_remote_set_pushurl(repo, StringValueCStr(rb_name_or_remote), StringValueCStr(rb_url))
|
378
|
+
);
|
379
|
+
|
380
|
+
return Qnil;
|
381
|
+
}
|
382
|
+
|
383
|
+
static VALUE rb_git_remote_collection_add_refspec(VALUE self, VALUE rb_name_or_remote, VALUE rb_refspec, git_direction direction)
|
384
|
+
{
|
385
|
+
VALUE rb_repo = rugged_owner(self);
|
386
|
+
git_repository *repo;
|
387
|
+
int error = 0;
|
388
|
+
|
389
|
+
if (rb_obj_is_kind_of(rb_name_or_remote, rb_cRuggedRemote))
|
390
|
+
rb_name_or_remote = rb_funcall(rb_name_or_remote, rb_intern("name"), 0);
|
391
|
+
|
392
|
+
if (TYPE(rb_name_or_remote) != T_STRING)
|
393
|
+
rb_raise(rb_eTypeError, "Expecting a String or Rugged::Remote instance");
|
394
|
+
|
395
|
+
rugged_check_repo(rb_repo);
|
396
|
+
Data_Get_Struct(rb_repo, git_repository, repo);
|
397
|
+
|
398
|
+
Check_Type(rb_refspec, T_STRING);
|
399
|
+
|
400
|
+
if (direction == GIT_DIRECTION_FETCH)
|
401
|
+
error = git_remote_add_fetch(repo, StringValueCStr(rb_name_or_remote), StringValueCStr(rb_refspec));
|
402
|
+
else
|
403
|
+
error = git_remote_add_push(repo, StringValueCStr(rb_name_or_remote), StringValueCStr(rb_refspec));
|
404
|
+
|
405
|
+
rugged_exception_check(error);
|
406
|
+
|
407
|
+
return Qnil;
|
408
|
+
}
|
409
|
+
|
410
|
+
/*
|
411
|
+
* call-seq:
|
412
|
+
* remotes.add_fetch_refspec(remote, refspec) -> nil
|
413
|
+
* remotes.add_fetch_refspec(name, refspec) -> nil
|
414
|
+
*
|
415
|
+
* Add a fetch refspec to the remote.
|
416
|
+
*/
|
417
|
+
static VALUE rb_git_remote_collection_add_fetch_refspec(VALUE self, VALUE rb_name_or_remote, VALUE rb_refspec)
|
418
|
+
{
|
419
|
+
return rb_git_remote_collection_add_refspec(self, rb_name_or_remote, rb_refspec, GIT_DIRECTION_FETCH);
|
420
|
+
}
|
421
|
+
|
422
|
+
/*
|
423
|
+
* call-seq:
|
424
|
+
* remotes.add_push_refspec(remote, refspec) -> nil
|
425
|
+
* remotes.add_push_refspec(name, refspec) -> nil
|
426
|
+
*
|
427
|
+
* Add a push refspec to the remote.
|
428
|
+
*/
|
429
|
+
static VALUE rb_git_remote_collection_add_push_refspec(VALUE self, VALUE rb_name_or_remote, VALUE rb_refspec)
|
430
|
+
{
|
431
|
+
return rb_git_remote_collection_add_refspec(self, rb_name_or_remote, rb_refspec, GIT_DIRECTION_PUSH);
|
432
|
+
}
|
433
|
+
|
434
|
+
void Init_rugged_remote_collection(void)
|
435
|
+
{
|
436
|
+
rb_cRuggedRemoteCollection = rb_define_class_under(rb_mRugged, "RemoteCollection", rb_cObject);
|
437
|
+
rb_include_module(rb_cRuggedRemoteCollection, rb_mEnumerable);
|
438
|
+
|
439
|
+
rb_define_method(rb_cRuggedRemoteCollection, "initialize", rb_git_remote_collection_initialize, 1);
|
440
|
+
|
441
|
+
rb_define_method(rb_cRuggedRemoteCollection, "[]", rb_git_remote_collection_aref, 1);
|
442
|
+
|
443
|
+
rb_define_method(rb_cRuggedRemoteCollection, "create", rb_git_remote_collection_create, 2);
|
444
|
+
rb_define_method(rb_cRuggedRemoteCollection, "create_anonymous", rb_git_remote_collection_create_anonymous, 1);
|
445
|
+
|
446
|
+
rb_define_method(rb_cRuggedRemoteCollection, "each", rb_git_remote_collection_each, 0);
|
447
|
+
rb_define_method(rb_cRuggedRemoteCollection, "each_name", rb_git_remote_collection_each_name, 0);
|
448
|
+
|
449
|
+
rb_define_method(rb_cRuggedRemoteCollection, "set_url", rb_git_remote_collection_set_url, 2);
|
450
|
+
rb_define_method(rb_cRuggedRemoteCollection, "set_push_url", rb_git_remote_collection_set_push_url, 2);
|
451
|
+
|
452
|
+
rb_define_method(rb_cRuggedRemoteCollection, "add_push_refspec", rb_git_remote_collection_add_push_refspec, 2);
|
453
|
+
rb_define_method(rb_cRuggedRemoteCollection, "add_fetch_refspec", rb_git_remote_collection_add_fetch_refspec, 2);
|
454
|
+
|
455
|
+
rb_define_method(rb_cRuggedRemoteCollection, "rename", rb_git_remote_collection_rename, 2);
|
456
|
+
rb_define_method(rb_cRuggedRemoteCollection, "delete", rb_git_remote_collection_delete, 1);
|
457
|
+
}
|