Method: Rugged::Reference#type

Defined in:
ext/rugged/rugged_reference.c

#typeObject

Return whether the reference is :symbolic or :direct



190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'ext/rugged/rugged_reference.c', line 190

static VALUE rb_git_ref_type(VALUE self)
{
	git_reference *ref;
	Data_Get_Struct(self, git_reference, ref);

	switch (git_reference_type(ref)) {
		case GIT_REF_OID:
			return CSTR2SYM("direct");
		case GIT_REF_SYMBOLIC:
			return CSTR2SYM("symbolic");
		default:
			return Qnil;
	}
}