Method: Rugged::Tree#path

Defined in:
ext/rugged/rugged_tree.c

#path(path) ⇒ Object

Retrieve and return a tree entry by its relative path.



324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'ext/rugged/rugged_tree.c', line 324

static VALUE rb_git_tree_path(VALUE self, VALUE rb_path)
{
	int error;
	git_tree *tree;
	git_tree_entry *entry;
	VALUE rb_entry;
	TypedData_Get_Struct(self, git_tree, &rugged_object_type, tree);
	Check_Type(rb_path, T_STRING);

	error = git_tree_entry_bypath(&entry, tree, StringValueCStr(rb_path));
	rugged_exception_check(error);

	rb_entry = rb_git_treeentry_fromC(entry);
	git_tree_entry_free(entry);

	return rb_entry;
}