Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 94d2dfc

Browse files
committed
Fixed env args
1 parent 19a8c58 commit 94d2dfc

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

git/cmd.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,16 +331,25 @@ def execute(self, command,
331331
else:
332332
cwd=self._working_dir
333333

334-
if command[1] == 'pull' or command[1] == 'reset':
335-
cwd += '/.git'
336-
334+
import logging
335+
log = logging.getLogger(u"cratejoy")
336+
log.debug(u"Running command {} in {}".format(command, cwd))
337+
338+
env = os.environ.copy()
339+
if env.get('GIT_DIR'):
340+
del env['GIT_DIR']
341+
342+
#log.debug(env)
343+
#log.debug(u"Args {}".format(subprocess_kwargs))
344+
337345
# Start the process
338346
proc = Popen(command,
339347
cwd=cwd,
340348
stdin=istream,
341349
stderr=PIPE,
342350
stdout=PIPE,
343351
close_fds=(os.name=='posix'),# unsupported on linux
352+
env=env,
344353
**subprocess_kwargs
345354
)
346355
if as_process:

0 commit comments

Comments
 (0)