summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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):