From 9a3ba09498a59651eb7c6acd716b12526b6ae382 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Fri, 20 Aug 2010 14:44:24 -0700 Subject: Make use of _run_command's cwd option. --- src/pyfedpkg/__init__.py | 8 +------- 1 file changed, 1 insertion(+), 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): -- cgit