diff --git a/src/scmrepo/git/__init__.py b/src/scmrepo/git/__init__.py index 5dd3667b..e96bc765 100644 --- a/src/scmrepo/git/__init__.py +++ b/src/scmrepo/git/__init__.py @@ -410,7 +410,7 @@ def detach_head( self.reset() @contextmanager - def stash_workspace(self, **kwargs): + def stash_workspace(self, reinstate_index=False, **kwargs): """Stash and restore any workspace changes. Yields revision of the stash commit. Yields None if there were no @@ -423,7 +423,7 @@ def stash_workspace(self, **kwargs): finally: if rev: logger.debug("Restoring stashed workspace") - self.stash.pop() + self.stash.pop(reinstate_index=reinstate_index) def _reset(self) -> None: self.backends.reset_all()