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)
| 296 | // Returns error code ErrorCodeNotFound if there's no stashed |
| 297 | // state for the given index. |
| 298 | func (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. |