Skip to content

Commit 0309191

Browse files
committed
stash_workspace: Add reinstate_index arg
1 parent 4eac7a9 commit 0309191

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/scmrepo/git/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def detach_head(
410410
self.reset()
411411

412412
@contextmanager
413-
def stash_workspace(self, **kwargs):
413+
def stash_workspace(self, reinstate_index=False, **kwargs):
414414
"""Stash and restore any workspace changes.
415415
416416
Yields revision of the stash commit. Yields None if there were no
@@ -423,7 +423,7 @@ def stash_workspace(self, **kwargs):
423423
finally:
424424
if rev:
425425
logger.debug("Restoring stashed workspace")
426-
self.stash.pop()
426+
self.stash.pop(reinstate_index=reinstate_index)
427427

428428
def _reset(self) -> None:
429429
self.backends.reset_all()

0 commit comments

Comments
 (0)