diff options
| author | Daniel Kertesz <[email protected]> | 2014-08-23 16:55:36 +0200 |
|---|---|---|
| committer | Daniel Kertesz <[email protected]> | 2014-09-07 12:45:52 +0200 |
| commit | c2f6381252c93f97b4a47a2b56faff26f1244d9d (patch) | |
| tree | e3e3decb1391fcbb66042d110954ad8874c91142 | |
| parent | 756c8a7e8bc8e4688565634bd1b1889b3e2dcac2 (diff) | |
add Index#RemoveByPath.
| -rw-r--r-- | index.go | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -114,6 +114,21 @@ func (v *Index) AddByPath(path string) error { return nil } +func (v *Index) RemoveByPath(path string) error { + cstr := C.CString(path) + defer C.free(unsafe.Pointer(cstr)) + + runtime.LockOSThread() + defer runtime.UnlockOSThread() + + ret := C.git_index_remove_bypath(v.ptr, cstr) + if ret < 0 { + return MakeGitError(ret) + } + + return nil +} + func (v *Index) WriteTreeTo(repo *Repository) (*Oid, error) { oid := new(Oid) |
