From 72c19f73c9170720780839cd1561486e075d35a8 Mon Sep 17 00:00:00 2001 From: Carlos Martín Nieto Date: Tue, 19 May 2015 15:05:00 +0200 Subject: Index: Add Path() accessor --- index.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'index.go') diff --git a/index.go b/index.go index 2082ebd..1a899f1 100644 --- a/index.go +++ b/index.go @@ -114,6 +114,12 @@ func OpenIndex(path string) (*Index, error) { return &Index{ptr: ptr}, nil } +// Path returns the index' path on disk or an empty string if it +// exists only in memory. +func (v *Index) Path() string { + return C.GoString(C.git_index_path(v.ptr)) +} + // Add adds or replaces the given entry to the index, making a copy of // the data func (v *Index) Add(entry *IndexEntry) error { -- cgit v1.2.3