summaryrefslogtreecommitdiffstats
path: root/src/pyfedpkg/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/pyfedpkg/__init__.py')
-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))