Skip to content

Commit 5c776c9

Browse files
authored
Fix push/pull to not use shell=True (#362)
A previous commit, #344, started passing env variables as a parameter. This broke the behaviour of "shell=True" which expects a string.
1 parent ffa0b0c commit 5c776c9

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

jupyterlab_git/git.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,6 @@ def pull(self, curr_fb_path):
456456
env['GIT_TERMINAL_PROMPT'] = '0'
457457
p = subprocess.Popen(
458458
['git', 'pull', '--no-commit'],
459-
shell=True,
460459
stdout=PIPE,
461460
stderr=PIPE,
462461
cwd=os.path.join(self.root_dir, curr_fb_path),
@@ -481,7 +480,6 @@ def push(self, remote, branch, curr_fb_path):
481480
env['GIT_TERMINAL_PROMPT'] = '0'
482481
p = subprocess.Popen(
483482
['git', 'push', remote, branch],
484-
shell=True,
485483
stdout=PIPE,
486484
stderr=PIPE,
487485
cwd=os.path.join(self.root_dir, curr_fb_path),

tests/unit/test_pushpull.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def test_git_pull_fail(mock_subproc_popen):
2727
stdout=PIPE,
2828
stderr=PIPE,
2929
cwd='/bin/test_curr_path',
30-
shell=True,
3130
env={'TEST': 'test', 'GIT_TERMINAL_PROMPT': '0'},
3231
),
3332
call().communicate()
@@ -57,7 +56,6 @@ def test_git_pull_success(mock_subproc_popen):
5756
stdout=PIPE,
5857
stderr=PIPE,
5958
cwd='/bin/test_curr_path',
60-
shell=True,
6159
env={'TEST': 'test', 'GIT_TERMINAL_PROMPT': '0'},
6260
),
6361
call().communicate()
@@ -87,7 +85,6 @@ def test_git_push_fail(mock_subproc_popen):
8785
stdout=PIPE,
8886
stderr=PIPE,
8987
cwd='/bin/test_curr_path',
90-
shell=True,
9188
env={'TEST': 'test', 'GIT_TERMINAL_PROMPT': '0'},
9289
),
9390
call().communicate()
@@ -117,7 +114,6 @@ def test_git_push_success(mock_subproc_popen):
117114
stdout=PIPE,
118115
stderr=PIPE,
119116
cwd='/bin/test_curr_path',
120-
shell=True,
121117
env={'TEST': 'test', 'GIT_TERMINAL_PROMPT': '0'},
122118
),
123119
call().communicate()

0 commit comments

Comments
 (0)