diff options
author | Ricky Zhou <ricky@fedoraproject.org> | 2010-12-05 20:07:07 -0500 |
---|---|---|
committer | Jesse Keating <jkeating@redhat.com> | 2011-01-21 14:31:54 -0800 |
commit | a1e7754c630b0d7cea8eeaec87f956f6555517e4 (patch) | |
tree | 4a8963ca56207bfd9802ea2b22533a9bf2ad9b07 /src | |
parent | e50d2677e6d9ab661b791097dde3086ecf21c16f (diff) | |
download | fedora-packager-a1e7754c630b0d7cea8eeaec87f956f6555517e4.tar.gz fedora-packager-a1e7754c630b0d7cea8eeaec87f956f6555517e4.tar.xz fedora-packager-a1e7754c630b0d7cea8eeaec87f956f6555517e4.zip |
Handle anonymous clones in clone_with_dirs. (#660183)
Diffstat (limited to 'src')
-rw-r--r-- | src/pyfedpkg/__init__.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index a1edb35..16dc291 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -430,6 +430,12 @@ def clone_with_dirs(module, user, path=None): top_git = git.Git(top_path) repo_path = os.path.join(top_path, 'fedpkg.git') + # construct the git url + if user: + giturl = GITBASEURL % {'user': user, 'module': module} + else: + giturl = ANONGITURL % {'module': module} + # Create our new top directory try: os.mkdir(top_path) @@ -455,8 +461,7 @@ def clone_with_dirs(module, user, path=None): # Set the origin correctly branch_path = os.path.join(top_path, branch.split('/master')[0]) branch_git = git.Git(branch_path) - branch_git.config("--replace-all", "remote.origin.url", - GITBASEURL % {'user': user, 'module': module}) + branch_git.config("--replace-all", "remote.origin.url", giturl) branch_git.config('--add', 'push.default', 'tracking') except (git.GitCommandError, OSError), e: raise FedpkgError('Could not locally clone %s from %s: %s' % |