|
@@ -69,6 +69,9 @@ from dulwich.archive import (
|
|
|
from dulwich.client import (
|
|
|
get_transport_and_path,
|
|
|
)
|
|
|
+from dulwich.config import (
|
|
|
+ StackedConfig,
|
|
|
+ )
|
|
|
from dulwich.diff_tree import (
|
|
|
CHANGE_ADD,
|
|
|
CHANGE_DELETE,
|
|
@@ -283,7 +286,9 @@ def clone(source, target=None, bare=False, checkout=None,
|
|
|
checkout = (not bare)
|
|
|
if checkout and bare:
|
|
|
raise ValueError("checkout and bare are incompatible")
|
|
|
- client, host_path = get_transport_and_path(source)
|
|
|
+
|
|
|
+ config = StackedConfig.default()
|
|
|
+ client, host_path = get_transport_and_path(source, config=config)
|
|
|
|
|
|
if target is None:
|
|
|
target = host_path.split("/")[-1]
|
|
@@ -742,7 +747,8 @@ def push(repo, remote_location, refspecs,
|
|
|
with open_repo_closing(repo) as r:
|
|
|
|
|
|
# Get the client and path
|
|
|
- client, path = get_transport_and_path(remote_location)
|
|
|
+ client, path = get_transport_and_path(
|
|
|
+ remote_location, config=r.get_config_stack())
|
|
|
|
|
|
selected_refs = []
|
|
|
|
|
@@ -796,7 +802,8 @@ def pull(repo, remote_location=None, refspecs=None,
|
|
|
selected_refs.extend(
|
|
|
parse_reftuples(remote_refs, r.refs, refspecs))
|
|
|
return [remote_refs[lh] for (lh, rh, force) in selected_refs]
|
|
|
- client, path = get_transport_and_path(remote_location)
|
|
|
+ client, path = get_transport_and_path(
|
|
|
+ remote_location, config=r.get_config_stack())
|
|
|
remote_refs = client.fetch(
|
|
|
path, r, progress=errstream.write, determine_wants=determine_wants)
|
|
|
for (lh, rh, force) in selected_refs:
|
|
@@ -1032,7 +1039,8 @@ def fetch(repo, remote_location, outstream=sys.stdout,
|
|
|
:return: Dictionary with refs on the remote
|
|
|
"""
|
|
|
with open_repo_closing(repo) as r:
|
|
|
- client, path = get_transport_and_path(remote_location)
|
|
|
+ client, path = get_transport_and_path(
|
|
|
+ remote_location, config=r.get_config_stack())
|
|
|
remote_refs = client.fetch(path, r, progress=errstream.write)
|
|
|
return remote_refs
|
|
|
|
|
@@ -1043,7 +1051,8 @@ def ls_remote(remote):
|
|
|
:param remote: Remote repository location
|
|
|
:return: Dictionary with remote refs
|
|
|
"""
|
|
|
- client, host_path = get_transport_and_path(remote)
|
|
|
+ config = StackedConfig.default()
|
|
|
+ client, host_path = get_transport_and_path(remote, config=config)
|
|
|
return client.get_refs(host_path)
|
|
|
|
|
|
|