MCPcopy Create free account
hub / github.com/libgit2/git2go / Clear

Method Clear

index.go:159–169  ·  view source on GitHub ↗

Clear clears the index object in memory; changes must be explicitly written to disk for them to take effect persistently

()

Source from the content-addressed store, hash-verified

157// Clear clears the index object in memory; changes must be explicitly
158// written to disk for them to take effect persistently
159func (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

Callers 1

ShutdownFunction · 0.45

Calls 1

MakeGitErrorFunction · 0.85

Tested by

no test coverage detected