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
84 changes: 34 additions & 50 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies = [
"build (>=1.2.1,<2.0.0)",
"cachecontrol[filecache] (>=0.14.0,<0.15.0)",
"cleo (>=2.1.0,<3.0.0)",
"dulwich (>=0.22.6,<0.23.0)",
"dulwich (>=0.24.0,<0.25.0)",
"fastjsonschema (>=2.18.0,<3.0.0)",
# <8.7 because .metadata() (and Distribution.metadata) can now return None,
# which requires some adaptions to our code.
Expand Down
2 changes: 1 addition & 1 deletion src/poetry/vcs/git/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def _clone(cls, url: str, refspec: GitRefSpec, target: Path) -> Repo:

try:
with local:
local.reset_index()
local.get_worktree().reset_index()
except (AssertionError, KeyError) as e:
# this implies the ref we need does not exist or is invalid
if isinstance(e, KeyError):
Expand Down
13 changes: 7 additions & 6 deletions tests/vcs/git/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
def temp_repo(tmp_path: Path) -> TempRepoFixture:
"""Temporary repository with 2 commits"""
repo = dulwich.repo.Repo.init(str(tmp_path))
worktree = repo.get_worktree()

# init commit
(tmp_path / "foo").write_text("foo", encoding="utf-8")
repo.stage(["foo"])
worktree.stage(["foo"])

init_commit = repo.do_commit(
init_commit = worktree.commit(
committer=b"User <[email protected]>",
author=b"User <[email protected]>",
message=b"init",
Expand All @@ -30,8 +31,8 @@ def temp_repo(tmp_path: Path) -> TempRepoFixture:

# one commit which is not "head"
(tmp_path / "bar").write_text("bar", encoding="utf-8")
repo.stage(["bar"])
middle_commit = repo.do_commit(
worktree.stage(["bar"])
middle_commit = worktree.commit(
committer=b"User <[email protected]>",
author=b"User <[email protected]>",
message=b"extra",
Expand All @@ -40,9 +41,9 @@ def temp_repo(tmp_path: Path) -> TempRepoFixture:

# extra commit
(tmp_path / "third").write_text("third file", encoding="utf-8")
repo.stage(["third"])
worktree.stage(["third"])

head_commit = repo.do_commit(
head_commit = worktree.commit(
committer=b"User <[email protected]>",
author=b"User <[email protected]>",
message=b"extra",
Expand Down