summaryrefslogtreecommitdiff
path: root/git/cmd.py
diff options
context:
space:
mode:
authorKostis Anagnostopoulos <ankostis@gmail.com>2016-10-01 20:14:50 +0200
committerKostis Anagnostopoulos <ankostis@gmail.com>2016-10-12 23:31:43 +0200
commit8ea7e265d1549613c12cbe42a2e012527c1a97e4 (patch)
treed49cdc8f66ac7dd90a3aff91c7955c94639afe6b /git/cmd.py
parente3165753f9d0d69caabac74eee195887f3fea482 (diff)
downloadgitpython-8ea7e265d1549613c12cbe42a2e012527c1a97e4.tar.gz
repo, cmd: DROP UNEEDED Win path for chcwd & check for '~' homedir
+ Do not abspath twice when contructing cloned repo. + Add `git.repo.base` logger.
Diffstat (limited to 'git/cmd.py')
-rw-r--r--git/cmd.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/git/cmd.py b/git/cmd.py
index a92b2f3c..f1033dde 100644
--- a/git/cmd.py
+++ b/git/cmd.py
@@ -42,12 +42,12 @@ from .util import (
)
-execute_kwargs = set(('istream', 'with_keep_cwd', 'with_extended_output',
+execute_kwargs = set(('istream', 'with_extended_output',
'with_exceptions', 'as_process', 'stdout_as_string',
'output_stream', 'with_stdout', 'kill_after_timeout',
'universal_newlines', 'shell'))
-log = logging.getLogger('git.cmd')
+log = logging.getLogger(__name__)
log.addHandler(logging.NullHandler())
__all__ = ('Git',)
@@ -418,7 +418,6 @@ class Git(LazyMixin):
def execute(self, command,
istream=None,
- with_keep_cwd=False,
with_extended_output=False,
with_exceptions=True,
as_process=False,
@@ -441,11 +440,6 @@ class Git(LazyMixin):
:param istream:
Standard input filehandle passed to subprocess.Popen.
- :param with_keep_cwd:
- Whether to use the current working directory from os.getcwd().
- The cmd otherwise uses its own working_dir that it has been initialized
- with if possible.
-
:param with_extended_output:
Whether to return a (status, stdout, stderr) tuple.
@@ -518,10 +512,7 @@ class Git(LazyMixin):
log.info(' '.join(command))
# Allow the user to have the command executed in their working dir.
- if with_keep_cwd or self._working_dir is None:
- cwd = os.getcwd()
- else:
- cwd = self._working_dir
+ cwd = self._working_dir or os.getcwd()
# Start the process
env = os.environ.copy()