diff options
| author | Carlos Martín Nieto <[email protected]> | 2015-05-19 15:05:00 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <[email protected]> | 2015-05-19 15:05:00 +0200 |
| commit | 72c19f73c9170720780839cd1561486e075d35a8 (patch) | |
| tree | 55f48583cec75d41265679ccad2075730ab2b786 /index.go | |
| parent | d7a0495000e35d06993605a9a31a5f9823292f8a (diff) | |
Index: Add Path() accessor
Diffstat (limited to 'index.go')
| -rw-r--r-- | index.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 { |
