From 90c2c9353958c976fd28dc2d07ba43b209ce5c35 Mon Sep 17 00:00:00 2001 From: David de la Iglesia Castro Date: Mon, 13 Feb 2023 18:35:18 +0100 Subject: [PATCH] stash_workspace: Add reinstate_index arg --- src/scmrepo/git/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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()