summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-08-24 11:31:00 -0700
committerJesse Keating <jkeating@redhat.com>2010-08-24 11:31:00 -0700
commit380d1e993c18e93b0f5b4442f99e71b1f447f6c2 (patch)
tree0837d6c632f9126040efe6235db7ca1d51a955e9
parent990439c99bc73eda79113d9a98bc64515dc638b0 (diff)
downloadfedora-packager-380d1e993c18e93b0f5b4442f99e71b1f447f6c2.zip
fedora-packager-380d1e993c18e93b0f5b4442f99e71b1f447f6c2.tar.gz
fedora-packager-380d1e993c18e93b0f5b4442f99e71b1f447f6c2.tar.xz
Fix setting push.default when cloning with dirs
-rw-r--r--src/pyfedpkg/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index 1e8b798..65e64bc 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -382,8 +382,9 @@ def clone(module, user, path=None, branch=None, bare_dir=None):
_run_command(cmd)
# Set push.default to "tracking"
- repo = git.Repo(module)
- repo.git.config('--add', 'push.default', 'tracking')
+ if not bare_dir:
+ repo = git.Repo(os.path.join(path, module))
+ repo.git.config('--add', 'push.default', 'tracking')
return
def clone_with_dirs(module, user, path=None):
@@ -429,6 +430,7 @@ def clone_with_dirs(module, user, path=None):
branch_git = git.Git(branch_path)
branch_git.config("--replace-all", "remote.origin.url",
GITBASEURL % {'user': user, 'module': module})
+ branch_git.config('--add', 'push.default', 'tracking')
except (git.GitCommandError, OSError), e:
raise FedpkgError('Could not locally clone %s from %s: %s' %
(branch, repo_path, e))