Skip to content

Commit b2f6ff8

Browse files
authored
Merge pull request #478 from telamonian/fix-add-multiple
followup #448: fix git add multiple files
2 parents 1311bb4 + 8cd3fc5 commit b2f6ff8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

jupyterlab_git/git.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,11 +535,12 @@ def add(self, filename, top_repo_path):
535535
Execute git add<filename> command & return the result.
536536
"""
537537
if not isinstance(filename, str):
538-
# assume filename is a sequence
539-
filename = ' '.join(filename)
538+
# assume filename is a sequence of str
539+
cmd = ["git", "add"] + list(filename)
540+
else:
541+
cmd = ["git", "add", filename]
540542

541-
my_output = subprocess.check_output(["git", "add", filename], cwd=top_repo_path)
542-
return my_output
543+
return subprocess.check_output(cmd, cwd=top_repo_path)
543544

544545
def add_all(self, top_repo_path):
545546
"""

0 commit comments

Comments
 (0)