commit
c68241c3f0
15
index.go
15
index.go
|
@ -114,6 +114,21 @@ func (v *Index) AddByPath(path string) error {
|
||||||
return nil
|
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) {
|
func (v *Index) WriteTreeTo(repo *Repository) (*Oid, error) {
|
||||||
oid := new(Oid)
|
oid := new(Oid)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue