We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c740e1d + dd973b9 commit c27981cCopy full SHA for c27981c
index.go
@@ -145,6 +145,20 @@ func (v *Index) Path() string {
145
return ret
146
}
147
148
+// Clear clears the index object in memory; changes must be explicitly
149
+// written to disk for them to take effect persistently
150
+func (v *Index) Clear() error {
151
+ runtime.LockOSThread()
152
+ defer runtime.UnlockOSThread()
153
+
154
+ err := C.git_index_clear(v.ptr)
155
+ runtime.KeepAlive(v)
156
+ if err < 0 {
157
+ return MakeGitError(err)
158
+ }
159
+ return nil
160
+}
161
162
// Add adds or replaces the given entry to the index, making a copy of
163
// the data
164
func (v *Index) Add(entry *IndexEntry) error {
0 commit comments