Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 0b1bee0

Browse files
committed
fix: Resolve bug with writing no extra args
When prompting for extra args, if no arguments were given, it would pass an empty string to subprocess which would throw an error about a pathspec issue. This resolves by doing a special check to see if the string returned by the extra args check is empty.
1 parent 3cd1176 commit 0b1bee0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gitcommit/gitcommit.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,11 @@ def run():
399399
argv_passthrough = sys.argv[1:] # overwrite default list
400400
existing_args = " ".join(argv_passthrough)
401401
text = Ansi.colour(Ansi.fg.bright_yellow, "Extra args for git commit: ")
402-
argv_passthrough = prompt(ANSI(text), default=existing_args).split(" ")
402+
extra_args_str = prompt(ANSI(text), default=existing_args)
403+
if extra_args_str != "":
404+
argv_passthrough = extra_args_str.split(" ")
405+
else:
406+
argv_passthrough = []
403407

404408
# Ask for confirmation to commit
405409
confirmation_validator = YesNoValidator(answer_required=True)

0 commit comments

Comments
 (0)