|
@@ -832,7 +832,7 @@ class GitClient:
|
|
|
branch=None,
|
|
|
progress=None,
|
|
|
depth=None,
|
|
|
- ref_prefix=[b"HEAD", b"refs/"],
|
|
|
+ ref_prefix: Optional[list[Ref]] = None,
|
|
|
filter_spec=None,
|
|
|
protocol_version: Optional[int] = None,
|
|
|
) -> Repo:
|
|
@@ -928,7 +928,7 @@ class GitClient:
|
|
|
] = None,
|
|
|
progress: Optional[Callable[[bytes], None]] = None,
|
|
|
depth: Optional[int] = None,
|
|
|
- ref_prefix: Optional[List[bytes]] = [b"HEAD", b"refs/"],
|
|
|
+ ref_prefix: Optional[list[Ref]] = None,
|
|
|
filter_spec: Optional[bytes] = None,
|
|
|
protocol_version: Optional[int] = None,
|
|
|
) -> FetchPackResult:
|
|
@@ -1009,7 +1009,7 @@ class GitClient:
|
|
|
*,
|
|
|
progress: Optional[Callable[[bytes], None]] = None,
|
|
|
depth: Optional[int] = None,
|
|
|
- ref_prefix=[b"HEAD", b"refs/"],
|
|
|
+ ref_prefix: Optional[list[Ref]] = None,
|
|
|
filter_spec=None,
|
|
|
protocol_version: Optional[int] = None,
|
|
|
):
|
|
@@ -1311,7 +1311,7 @@ class TraditionalGitClient(GitClient):
|
|
|
pack_data,
|
|
|
progress=None,
|
|
|
depth=None,
|
|
|
- ref_prefix=[b"HEAD", b"refs/"],
|
|
|
+ ref_prefix: Optional[list[Ref]] = None,
|
|
|
filter_spec=None,
|
|
|
protocol_version: Optional[int] = None,
|
|
|
):
|
|
@@ -1379,6 +1379,11 @@ class TraditionalGitClient(GitClient):
|
|
|
proto.write(b"0001") # delim-pkt
|
|
|
proto.write_pkt_line(b"symrefs")
|
|
|
proto.write_pkt_line(b"peel")
|
|
|
+ if ref_prefix is None:
|
|
|
+ # GitHub defaults to just sending HEAD if no ref-prefix is
|
|
|
+ # specified, so explicitly request all refs to match
|
|
|
+ # behaviour with v1 when no ref-prefix is specified.
|
|
|
+ ref_prefix = [b"HEAD", b"refs/"]
|
|
|
for prefix in ref_prefix:
|
|
|
proto.write_pkt_line(b"ref-prefix " + prefix)
|
|
|
proto.write_pkt_line(None)
|
|
@@ -1795,7 +1800,7 @@ class LocalGitClient(GitClient):
|
|
|
determine_wants=None,
|
|
|
progress=None,
|
|
|
depth=None,
|
|
|
- ref_prefix=[b"HEAD", b"refs/"],
|
|
|
+ ref_prefix: Optional[list[Ref]] = None,
|
|
|
filter_spec=None,
|
|
|
**kwargs,
|
|
|
):
|
|
@@ -1840,7 +1845,7 @@ class LocalGitClient(GitClient):
|
|
|
pack_data,
|
|
|
progress=None,
|
|
|
depth=None,
|
|
|
- ref_prefix: Optional[List[bytes]] = [b"HEAD", b"refs/"],
|
|
|
+ ref_prefix: Optional[List[Ref]] = None,
|
|
|
filter_spec: Optional[bytes] = None,
|
|
|
protocol_version: Optional[int] = None,
|
|
|
) -> FetchPackResult:
|
|
@@ -2579,7 +2584,7 @@ class AbstractHttpGitClient(GitClient):
|
|
|
pack_data,
|
|
|
progress=None,
|
|
|
depth=None,
|
|
|
- ref_prefix=[b"HEAD", b"refs/"],
|
|
|
+ ref_prefix: Optional[list[Ref]] = None,
|
|
|
filter_spec=None,
|
|
|
protocol_version: Optional[int] = None,
|
|
|
):
|