From 380d1e993c18e93b0f5b4442f99e71b1f447f6c2 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Tue, 24 Aug 2010 11:31:00 -0700 Subject: Fix setting push.default when cloning with dirs --- src/pyfedpkg/__init__.py | 6 ++++-- 1 file 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)) -- cgit