class Rugged::Tag
Public Instance Methods
annotated?()
click to toggle source
static VALUE rb_git_tag_annotated_p(VALUE self) { return RTEST(rb_git_tag_annotation(self)) ? Qtrue : Qfalse; }
annotation → annotation or nil
click to toggle source
static VALUE rb_git_tag_annotation(VALUE self) { git_reference *ref, *resolved_ref; git_repository *repo; git_object *target; int error; VALUE rb_repo = rugged_owner(self); rugged_check_repo(rb_repo); Data_Get_Struct(self, git_reference, ref); Data_Get_Struct(rb_repo, git_repository, repo); error = git_reference_resolve(&resolved_ref, ref); rugged_exception_check(error); error = git_object_lookup(&target, repo, git_reference_target(resolved_ref), GIT_OBJ_TAG); git_reference_free(resolved_ref); if (error == GIT_ENOTFOUND) return Qnil; return rugged_object_new(rb_repo, target); }
name()
click to toggle source
# File lib/rugged/tag.rb, line 3 def name canonical_name.sub(%r{^refs/tags/}, "") end
target → git_object
click to toggle source
static VALUE rb_git_tag_target(VALUE self) { git_reference *ref, *resolved_ref; git_repository *repo; git_object *target; int error; VALUE rb_repo = rugged_owner(self); rugged_check_repo(rb_repo); Data_Get_Struct(self, git_reference, ref); Data_Get_Struct(rb_repo, git_repository, repo); error = git_reference_resolve(&resolved_ref, ref); rugged_exception_check(error); error = git_object_lookup(&target, repo, git_reference_target(resolved_ref), GIT_OBJ_ANY); git_reference_free(resolved_ref); rugged_exception_check(error); if (git_object_type(target) == GIT_OBJ_TAG) { git_object *annotation_target; error = git_tag_target(&annotation_target, (git_tag *)target); git_object_free(target); rugged_exception_check(error); return rugged_object_new(rb_repo, annotation_target); } else { return rugged_object_new(rb_repo, target); } }