diff options
-rwxr-xr-x | src/fedpkg.py | 4 | ||||
-rw-r--r-- | src/pyfedpkg/__init__.py | 16 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/fedpkg.py b/src/fedpkg.py index ecfbbf8..04b8073 100755 --- a/src/fedpkg.py +++ b/src/fedpkg.py @@ -620,14 +620,14 @@ def prep(args): def pull(args): try: - pyfedpkg.pull() + pyfedpkg.pull(path=args.path) except pyfedpkg.FedpkgError, e: log.error('Could not push: %s' % e) sys.exit(1) def push(args): try: - pyfedpkg.push() + pyfedpkg.push(path=args.path) except pyfedpkg.FedpkgError, e: log.error('Could not push: %s' % e) sys.exit(1) 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): |