-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git: fix edit command when using extra args
The user can include extra arguments to the git core.editor configuration option or the GIT_EDITOR env var, however, in the current way that editorCMD() is coded, all the extra arguments are passed to the actual editor executable as a single argument: argv[0] == exec, argv[1] == all arguments, instead of splitting them in separated argv[] fields. Although some editors are fine with this behavior, because they split the argv array before actually using it, some others don't. Since splitting all the args, one per argv field, is the standard across the industry, we should do the same. This patch refactors the editorCMD() code to ease its understanding, split each arg in one argv field, and also to solve an issue, found during the refactoring, for when the user hasn't set neither git core.editor nor GIT_EDITOR. Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
- Loading branch information
Showing
2 changed files
with
24 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters