summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-08-20 14:44:24 -0700
committerJesse Keating <jkeating@redhat.com>2010-08-20 14:44:24 -0700
commit9a3ba09498a59651eb7c6acd716b12526b6ae382 (patch)
treeac50c0224012ba9b3798d8e6e5768bc1cde20109 /src
parent64de44f9c840da0d51e9a91da08e3abb043d235a (diff)
downloadfedora-packager-9a3ba09498a59651eb7c6acd716b12526b6ae382.tar.gz
fedora-packager-9a3ba09498a59651eb7c6acd716b12526b6ae382.tar.xz
fedora-packager-9a3ba09498a59651eb7c6acd716b12526b6ae382.zip
Make use of _run_command's cwd option.
Diffstat (limited to 'src')
-rw-r--r--src/pyfedpkg/__init__.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index f4a02bf..2dfb0c4 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -453,11 +453,6 @@ def commit(path=None, message=None, file=None, files=[]):
if not message or not file:
raise FedpkgError('Must have a commit message or be on a real tty.')
- # Deal with path
- curdir = os.getcwd()
- if path:
- os.chdir(path)
-
# construct the git command
# We do this via subprocess because the git module is terrible.
cmd = ['git', 'commit']
@@ -470,8 +465,7 @@ def commit(path=None, message=None, file=None, files=[]):
else:
cmd.extend(files)
# make it so
- _run_command(cmd)
- os.chdir(curdir)
+ _run_command(cmd, cwd=path)
return
def get_latest_commit(module):