Skip to content

Commit

Permalink
use a default ref-prefix when fetching with git protocol v2
Browse files Browse the repository at this point in the history
Github's SSH git protocol v2 server returns a useless reference list which
only contains "HEAD" unless we explicitly ask for the "refs/" prefix.

Fixes issue jelmer#1389
  • Loading branch information
stspdotname committed Oct 30, 2024
1 parent 8ccaacf commit 2447376
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dulwich/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ def clone(
branch=None,
progress=None,
depth=None,
ref_prefix=[],
ref_prefix=[b"HEAD", b"refs/"],
filter_spec=None,
protocol_version: Optional[int] = None,
) -> Repo:
Expand Down Expand Up @@ -928,7 +928,7 @@ def fetch(
] = None,
progress: Optional[Callable[[bytes], None]] = None,
depth: Optional[int] = None,
ref_prefix: Optional[List[bytes]] = [],
ref_prefix: Optional[List[bytes]] = [b"HEAD", b"refs/"],
filter_spec: Optional[bytes] = None,
protocol_version: Optional[int] = None,
) -> FetchPackResult:
Expand Down Expand Up @@ -1009,7 +1009,7 @@ def fetch_pack(
*,
progress: Optional[Callable[[bytes], None]] = None,
depth: Optional[int] = None,
ref_prefix=[],
ref_prefix=[b"HEAD", b"refs/"],
filter_spec=None,
protocol_version: Optional[int] = None,
):
Expand Down Expand Up @@ -1311,7 +1311,7 @@ def fetch_pack(
pack_data,
progress=None,
depth=None,
ref_prefix=[],
ref_prefix=[b"HEAD", b"refs/"],
filter_spec=None,
protocol_version: Optional[int] = None,
):
Expand Down Expand Up @@ -1791,7 +1791,7 @@ def fetch(
determine_wants=None,
progress=None,
depth=None,
ref_prefix=[],
ref_prefix=[b"HEAD", b"refs/"],
filter_spec=None,
**kwargs,
):
Expand Down Expand Up @@ -1836,7 +1836,7 @@ def fetch_pack(
pack_data,
progress=None,
depth=None,
ref_prefix: Optional[List[bytes]] = [],
ref_prefix: Optional[List[bytes]] = [b"HEAD", b"refs/"],
filter_spec: Optional[bytes] = None,
protocol_version: Optional[int] = None,
) -> FetchPackResult:
Expand Down Expand Up @@ -2574,7 +2574,7 @@ def fetch_pack(
pack_data,
progress=None,
depth=None,
ref_prefix=[],
ref_prefix=[b"HEAD", b"refs/"],
filter_spec=None,
protocol_version: Optional[int] = None,
):
Expand Down

0 comments on commit 2447376

Please sign in to comment.