Clear clears the index object in memory; changes must be explicitly written to disk for them to take effect persistently
()
| 157 | // Clear clears the index object in memory; changes must be explicitly |
| 158 | // written to disk for them to take effect persistently |
| 159 | func (v *Index) Clear() error { |
| 160 | runtime.LockOSThread() |
| 161 | defer runtime.UnlockOSThread() |
| 162 | |
| 163 | err := C.git_index_clear(v.ptr) |
| 164 | runtime.KeepAlive(v) |
| 165 | if err < 0 { |
| 166 | return MakeGitError(err) |
| 167 | } |
| 168 | return nil |
| 169 | } |
| 170 | |
| 171 | // Add adds or replaces the given entry to the index, making a copy of |
| 172 | // the data |
no test coverage detected