summaryrefslogtreecommitdiff
path: root/index.go
diff options
context:
space:
mode:
Diffstat (limited to 'index.go')
-rw-r--r--index.go6
1 files changed, 6 insertions, 0 deletions
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 {