From 3810d8d56a046206628c9d906d561e2931367bf2 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Mon, 20 Sep 2010 14:05:26 -0700 Subject: Handle paths with push/pull --- src/pyfedpkg/__init__.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/pyfedpkg/__init__.py') diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index 9e15057..bb7449f 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -676,18 +676,22 @@ def new(path=None): log.debug('Diffing from tag %s' % tag) return repo.git.diff('-M', tag) -def pull(): - """Pull changes from the main repository""" +def pull(path=None): + """Pull changes from the main repository using optional path""" + if not path: + path = os.getcwd() cmd = ['git', 'pull'] - _run_command(cmd) + _run_command(cmd, cwd=path) return -def push(): - """Push changes to the main repository""" +def push(path=None): + """Push changes to the main repository using optional path""" + if not path: + path = os.getcwd() cmd = ['git', 'push'] - _run_command(cmd) + _run_command(cmd, cwd=path) return def sources(path, outdir=None): -- cgit