(path string)
| 189 | } |
| 190 | |
| 191 | func (v *Index) AddByPath(path string) error { |
| 192 | cstr := C.CString(path) |
| 193 | defer C.free(unsafe.Pointer(cstr)) |
| 194 | |
| 195 | runtime.LockOSThread() |
| 196 | defer runtime.UnlockOSThread() |
| 197 | |
| 198 | ret := C.git_index_add_bypath(v.ptr, cstr) |
| 199 | runtime.KeepAlive(v) |
| 200 | if ret < 0 { |
| 201 | return MakeGitError(ret) |
| 202 | } |
| 203 | |
| 204 | return nil |
| 205 | } |
| 206 | |
| 207 | // AddFromBuffer adds or replaces an index entry from a buffer in memory |
| 208 | func (v *Index) AddFromBuffer(entry *IndexEntry, buffer []byte) error { |