summaryrefslogtreecommitdiff
path: root/reference.go
diff options
context:
space:
mode:
Diffstat (limited to 'reference.go')
-rw-r--r--reference.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/reference.go b/reference.go
index 8c8b282..9a2a8e5 100644
--- a/reference.go
+++ b/reference.go
@@ -161,6 +161,14 @@ func (v *Reference) Peel(t ObjectType) (Object, error) {
return allocObject(cobj), nil
}
+// Owner returns a weak reference to the repository which owns this
+// reference.
+func (v *Reference) Owner() *Repository {
+ return &Repository{
+ ptr: C.git_reference_owner(v.ptr),
+ }
+}
+
// Cmp compares both references, retursn 0 on equality, otherwise a
// stable sorting.
func (v *Reference) Cmp(ref2 *Reference) int {