Skip to content

Commit 5f5314f

Browse files
committed
Last minute fixes due newest version of dulwich changed a method's parameter's type signature
1 parent b49ad1e commit 5f5314f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

wfexs_backend/fetchers/git.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@
8686
import dulwich.porcelain
8787
import dulwich.repo
8888

89+
from dulwich import __version__ as dulwich_version
90+
8991
from . import (
9092
AbstractSchemeRepoFetcher,
9193
DocumentedStatefulProtocolFetcher,
@@ -296,9 +298,14 @@ def _find_git_repo_in_uri(
296298
# Possible sha in repoTag
297299
memory_repo = dulwich.repo.MemoryRepo()
298300
transport, path = get_transport_and_path(remote_uri_anc)
299-
fetch_pack_result = transport.fetch(
300-
path, cast("dulwich.repo.Repo", memory_repo)
301-
)
301+
if dulwich_version < (0, 24, 6):
302+
fetch_pack_result = transport.fetch(
303+
path, cast("dulwich.repo.Repo", memory_repo) # type: ignore[arg-type]
304+
)
305+
else:
306+
fetch_pack_result = transport.fetch(
307+
path.encode("utf-8"), cast("dulwich.repo.Repo", memory_repo) # type: ignore[arg-type]
308+
)
302309
try:
303310
memory_repo.get_object(repoTag.encode("utf-8"))
304311
b_default_repo_tag = repoTag

0 commit comments

Comments
 (0)