MCPcopy Create free account
hub / github.com/libgit2/pygit2 / stash_pop

Method stash_pop

pygit2/repository.py:1373–1390  ·  view source on GitHub ↗

Apply a stashed state and remove it from the stash list. For arguments, see Repository.stash_apply().

(
        self,
        index: int = 0,
        reinstate_index: bool = False,
        strategy: CheckoutStrategy | None = None,
        callbacks: StashApplyCallbacks | None = None,
    )

Source from the content-addressed store, hash-verified

1371 check_error(C.git_stash_drop(self._repo, index))
1372
1373 def stash_pop(
1374 self,
1375 index: int = 0,
1376 reinstate_index: bool = False,
1377 strategy: CheckoutStrategy | None = None,
1378 callbacks: StashApplyCallbacks | None = None,
1379 ) -> None:
1380 """Apply a stashed state and remove it from the stash list.
1381
1382 For arguments, see Repository.stash_apply().
1383 """
1384 with git_stash_apply_options(
1385 reinstate_index=reinstate_index,
1386 strategy=strategy,
1387 callbacks=callbacks,
1388 ) as payload:
1389 err = C.git_stash_pop(self._repo, index, payload.stash_apply_options)
1390 payload.check_error(err)
1391
1392 #
1393 # Utility for writing a tree into an archive

Callers 2

test_stashFunction · 0.80

Calls 2

check_errorMethod · 0.80
git_stash_apply_optionsFunction · 0.70

Tested by 2

test_stashFunction · 0.64