Method: Rugged::Repository#each_note
- Defined in:
- ext/rugged/rugged_note.c
permalink #each_note(notes_ref = "refs/notes/commits") {|note_blob, annotated_object| ... } ⇒ Object #each_note(notes_ref = "refs/notes/commits") ⇒ Object
Call the given block once for each note_blob/annotated_object pair in repository
-
notes_ref
: (optional): canonical name of the reference to use defaults to “refs/notes/commits”
If no block is given, an Enumerator
is returned.
@repo.each_note do |note_blob, annotated_object|
puts "#{note_blob.oid} => #{annotated_object.oid}"
end
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'ext/rugged/rugged_note.c', line 294
static VALUE rb_git_note_each(int argc, VALUE *argv, VALUE self)
{
git_repository *repo;
const char *notes_ref = NULL;
int error;
struct rugged_cb_payload payload = { self, 0 };
VALUE rb_notes_ref;
RETURN_ENUMERATOR(self, argc, argv);
rb_scan_args(argc, argv, "01", &rb_notes_ref);
if (!NIL_P(rb_notes_ref)) {
Check_Type(rb_notes_ref, T_STRING);
notes_ref = StringValueCStr(rb_notes_ref);
}
Data_Get_Struct(self, git_repository, repo);
error = git_note_foreach(repo, notes_ref, &cb_note__each, &payload);
if (payload.exception)
rb_jump_tag(payload.exception);
rugged_exception_check(error);
return Qnil;
}
|