|
@@ -486,7 +486,7 @@ def init(path=".", *, bare=False, symlinks: Optional[bool] = None):
|
|
|
return Repo.init(path, symlinks=symlinks)
|
|
|
|
|
|
|
|
|
-def encode_refspecs(refspecs, refspec_encoding):
|
|
|
+def encode_refspecs(refspecs):
|
|
|
if refspecs is None:
|
|
|
return [b"HEAD"]
|
|
|
|
|
@@ -494,7 +494,7 @@ def encode_refspecs(refspecs, refspec_encoding):
|
|
|
if isinstance(ref, bytes):
|
|
|
return ref
|
|
|
else:
|
|
|
- return ref.encode(refspec_encoding)
|
|
|
+ return ref.encode(DEFAULT_ENCODING)
|
|
|
|
|
|
encoded_refs = []
|
|
|
if isinstance(refspecs, bytes) or isinstance(refspecs, str):
|
|
@@ -517,8 +517,6 @@ def clone(
|
|
|
depth: Optional[int] = None,
|
|
|
branch: Optional[Union[str, bytes]] = None,
|
|
|
config: Optional[Config] = None,
|
|
|
- refspecs=None,
|
|
|
- refspec_encoding=DEFAULT_ENCODING,
|
|
|
filter_spec=None,
|
|
|
protocol_version: Optional[int] = None,
|
|
|
**kwargs,
|
|
@@ -539,8 +537,6 @@ def clone(
|
|
|
config: Configuration to use
|
|
|
refspecs: refspecs to fetch. Can be a bytestring, a string, or a list of
|
|
|
bytestring/string.
|
|
|
- refspec_encoding: Character encoding of bytestrings provided in the refspecs parameter.
|
|
|
- If not specified, the internal default encoding will be used.
|
|
|
filter_spec: A git-rev-list-style object filter spec, as an ASCII string.
|
|
|
Only used if the server supports the Git protocol-v2 'filter'
|
|
|
feature, and ignored otherwise.
|
|
@@ -566,8 +562,6 @@ def clone(
|
|
|
if checkout and bare:
|
|
|
raise Error("checkout and bare are incompatible")
|
|
|
|
|
|
- encoded_refs = encode_refspecs(refspecs, refspec_encoding)
|
|
|
-
|
|
|
if target is None:
|
|
|
target = source.split("/")[-1]
|
|
|
|
|
@@ -591,7 +585,6 @@ def clone(
|
|
|
branch=branch,
|
|
|
progress=errstream.write,
|
|
|
depth=depth,
|
|
|
- ref_prefix=encoded_refs,
|
|
|
filter_spec=filter_spec,
|
|
|
protocol_version=protocol_version,
|
|
|
)
|
|
@@ -1279,7 +1272,6 @@ def pull(
|
|
|
errstream=default_bytes_err_stream,
|
|
|
fast_forward=True,
|
|
|
force=False,
|
|
|
- refspec_encoding=DEFAULT_ENCODING,
|
|
|
filter_spec=None,
|
|
|
protocol_version=None,
|
|
|
**kwargs,
|
|
@@ -1293,8 +1285,6 @@ def pull(
|
|
|
bytestring/string.
|
|
|
outstream: A stream file to write to output
|
|
|
errstream: A stream file to write to errors
|
|
|
- refspec_encoding: Character encoding of bytestrings provided in the refspecs parameter.
|
|
|
- If not specified, the internal default encoding will be used.
|
|
|
filter_spec: A git-rev-list-style object filter spec, as an ASCII string.
|
|
|
Only used if the server supports the Git protocol-v2 'filter'
|
|
|
feature, and ignored otherwise.
|
|
@@ -1305,7 +1295,7 @@ def pull(
|
|
|
with open_repo_closing(repo) as r:
|
|
|
(remote_name, remote_location) = get_remote_repo(r, remote_location)
|
|
|
|
|
|
- encoded_refs = encode_refspecs(refspecs, refspec_encoding)
|
|
|
+ encoded_refs = encode_refspecs(refspecs)
|
|
|
selected_refs = []
|
|
|
|
|
|
def determine_wants(remote_refs, **kwargs):
|