We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
test_git_stash_workspace_reinstate_index
1 parent 0309191 commit 17ab5efCopy full SHA for 17ab5ef
tests/test_stash.py
@@ -19,6 +19,23 @@ def test_git_stash_workspace(tmp_dir: TmpDir, scm: Git):
19
assert (tmp_dir / "file").read_text() == "1"
20
21
22
+def test_git_stash_workspace_reinstate_index(tmp_dir: TmpDir, scm: Git):
23
+ tmp_dir.gen({"modified": "init", "deleted": "deleted"})
24
+ scm.add_commit(["modified", "deleted"], "init")
25
+
26
+ tmp_dir.gen({"newfile": "nefile"})
27
+ scm.add("newfile")
28
+ tmp_dir.gen({"modified": "modified"})
29
+ scm.add("modified")
30
+ (tmp_dir / "deleted").unlink()
31
+ scm.add("deleted")
32
33
+ prev_status = scm.status()
34
+ with scm.stash_workspace(reinstate_index=True):
35
+ pass
36
+ assert scm.status() == prev_status
37
38
39
@pytest.mark.parametrize(
40
"ref, include_untracked",
41
[
0 commit comments