diff options
author | Jesse Keating <jkeating@redhat.com> | 2010-08-24 11:31:00 -0700 |
---|---|---|
committer | Jesse Keating <jkeating@redhat.com> | 2010-08-24 11:31:00 -0700 |
commit | 380d1e993c18e93b0f5b4442f99e71b1f447f6c2 (patch) | |
tree | 0837d6c632f9126040efe6235db7ca1d51a955e9 | |
parent | 990439c99bc73eda79113d9a98bc64515dc638b0 (diff) | |
download | fedora-packager-380d1e993c18e93b0f5b4442f99e71b1f447f6c2.tar.gz fedora-packager-380d1e993c18e93b0f5b4442f99e71b1f447f6c2.tar.xz fedora-packager-380d1e993c18e93b0f5b4442f99e71b1f447f6c2.zip |
Fix setting push.default when cloning with dirs
-rw-r--r-- | src/pyfedpkg/__init__.py | 6 |
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)) |