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

Method Drop

stash.go:298–308  ·  view source on GitHub ↗

Drop removes a single stashed state from the stash list. 'index' is the position within the stash list. 0 points to the most recent stashed state. Returns error code ErrorCodeNotFound if there's no stashed state for the given index.

(index int)

Source from the content-addressed store, hash-verified

296// Returns error code ErrorCodeNotFound if there's no stashed
297// state for the given index.
298func (c *StashCollection) Drop(index int) error {
299 runtime.LockOSThread()
300 defer runtime.UnlockOSThread()
301
302 ret := C.git_stash_drop(c.repo.ptr, C.size_t(index))
303 runtime.KeepAlive(c)
304 if ret < 0 {
305 return MakeGitError(ret)
306 }
307 return nil
308}
309
310// Pop applies a single stashed state from the stash list
311// and removes it from the list if successful.

Callers 1

TestStashFunction · 0.80

Calls 1

MakeGitErrorFunction · 0.85

Tested by 1

TestStashFunction · 0.64