Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- name: Lint code and check dependencies
continue-on-error: ${{ matrix.nox_pyv == '3.11' }}
run: nox -s lint safety
run: nox -s lint safety --verbose

- name: Run tests
run: nox -s tests-${{ matrix.nox_pyv || matrix.pyv }} -- --slow --cov-report=xml
Expand Down
2 changes: 1 addition & 1 deletion tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
version: '3.2'
services:
git-server:
image: ghcr.io/linuxserver/openssh-server
image: ghcr.io/linuxserver/openssh-server:9.0_p1-r2-ls100
environment:
- USER_NAME=user
- PUBLIC_KEY_FILE=/tmp/key
Expand Down
17 changes: 17 additions & 0 deletions tests/test_stash.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ def test_git_stash_workspace(tmp_dir: TmpDir, scm: Git):
assert (tmp_dir / "file").read_text() == "1"


def test_git_stash_workspace_reinstate_index(tmp_dir: TmpDir, scm: Git):
tmp_dir.gen({"modified": "init", "deleted": "deleted"})
scm.add_commit(["modified", "deleted"], "init")

tmp_dir.gen({"newfile": "nefile"})
scm.add("newfile")
tmp_dir.gen({"modified": "modified"})
scm.add("modified")
(tmp_dir / "deleted").unlink()
scm.add("deleted")

prev_status = scm.status()
with scm.stash_workspace(reinstate_index=True):
pass
assert scm.status() == prev_status


@pytest.mark.parametrize(
"ref, include_untracked",
[
Expand Down