Skip to content

Commit a227ddd

Browse files
committed
Do not use shell=True
1 parent 2b884c4 commit a227ddd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

jupyterlab_git/git.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ def pull(self, curr_fb_path, auth=None):
616616
if (auth):
617617
env["GIT_TERMINAL_PROMPT"] = "1"
618618
p = git_auth_input_wrapper(
619-
command = 'git pull --no-commit',
619+
command = ['git', 'pull', '--no-commit'],
620620
cwd = os.path.join(self.root_dir, curr_fb_path),
621621
env = env,
622622
username = auth['username'],
@@ -626,11 +626,12 @@ def pull(self, curr_fb_path, auth=None):
626626
else:
627627
env["GIT_TERMINAL_PROMPT"] = "0"
628628
p = subprocess.Popen(
629-
['git pull --no-commit'],
629+
['git', 'pull', '--no-commit'],
630630
stdout=PIPE,
631631
stderr=PIPE,
632632
env = env,
633633
cwd=os.path.join(self.root_dir, curr_fb_path),
634+
env = env,
634635
)
635636
_, error = p.communicate()
636637

@@ -649,7 +650,7 @@ def push(self, remote, branch, curr_fb_path, auth=None):
649650
if (auth):
650651
env["GIT_TERMINAL_PROMPT"] = "1"
651652
p = git_auth_input_wrapper(
652-
command = 'git push {} {}'.format(remote, branch),
653+
command = ['git', 'push', remote, branch],
653654
cwd = os.path.join(self.root_dir, curr_fb_path),
654655
env = env,
655656
username = auth['username'],
@@ -659,11 +660,12 @@ def push(self, remote, branch, curr_fb_path, auth=None):
659660
else:
660661
env["GIT_TERMINAL_PROMPT"] = "0"
661662
p = subprocess.Popen(
662-
['git push {} {}'.format(remote, branch)],
663+
['git', 'push', remote, branch],
663664
stdout=PIPE,
664665
stderr=PIPE,
665666
env = env,
666667
cwd=os.path.join(self.root_dir, curr_fb_path),
668+
env = env,
667669
)
668670
_, error = p.communicate()
669671

0 commit comments

Comments
 (0)