[Python-modules-commits] [dulwich] 07/19: Properly use origin parameter in porcelain.clone()

Jelmer Vernooij jelmer at moszumanska.debian.org
Sun Oct 29 17:22:27 UTC 2017


This is an automated email from the git hooks/post-receive script.

jelmer pushed a commit to branch master
in repository dulwich.

commit e5be01acb5c1c15e0de020aa27250bf37b987c86
Author: Kenneth Lareau <kenneth.lareau at couchbase.com>
Date:   Wed Oct 18 14:05:56 2017 -0700

    Properly use origin parameter in porcelain.clone()
    
    The 'origin' parameter in porcelain.clone() wasn't being fully properly
    used, as the actual remote was still being set to the default name of
    'origin'.  Make the code use the paramter instead at the proper places.
---
 dulwich/porcelain.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/dulwich/porcelain.py b/dulwich/porcelain.py
index 0c25cbf..31682be 100644
--- a/dulwich/porcelain.py
+++ b/dulwich/porcelain.py
@@ -276,6 +276,7 @@ def clone(source, target=None, bare=False, checkout=None,
     :param checkout: Whether or not to check-out HEAD after cloning
     :param errstream: Optional stream to write progress to
     :param outstream: Optional stream to write progress to (deprecated)
+    :param origin: Name of remote from the repository used to clone
     :return: The new repository
     """
     if outstream is not None:
@@ -323,10 +324,10 @@ def clone(source, target=None, bare=False, checkout=None,
         target_config = r.get_config()
         if not isinstance(source, bytes):
             source = source.encode(DEFAULT_ENCODING)
-        target_config.set((b'remote', b'origin'), b'url', source)
+        target_config.set((b'remote', origin), b'url', source)
         target_config.set(
-            (b'remote', b'origin'), b'fetch',
-            b'+refs/heads/*:refs/remotes/origin/*')
+            (b'remote', origin), b'fetch',
+            b'+refs/heads/*:refs/remotes/' + origin + b'/*')
         target_config.write_to_path()
         if checkout and b"HEAD" in r.refs:
             errstream.write(b'Checking out HEAD\n')

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/dulwich.git



More information about the Python-modules-commits mailing list