Files
git/builtin
Johannes Schindelin 3bf6fd75ed config: propagate launch_editor() failure in show_editor()
show_editor() calls launch_editor() to open the user's editor on
the configuration file, but discards the return value and
unconditionally returns 0 (success). When the editor fails to
launch (e.g., $EDITOR is not found, or the editor exits with a
nonzero status), the caller receives no indication that anything
went wrong.

This affects "git config edit" and "git config --edit": the
command silently succeeds even when the editor could not be
started. In contrast, other editor-launching paths in git (such
as "git commit" and "git rebase --edit-todo") properly propagate
editor failures and exit with an error.

Check the return value and propagate the failure by returning -1.
The two callers (cmd_config_edit at line 1315 and the legacy
cmd_config at line 1478) both propagate this return to
handle_builtin, which translates negative returns into an error
exit.

Pointed out by Coverity.

Assisted-by: Claude Opus 4.6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-08-05 13:08:35 -07:00
..
2026-04-10 07:58:53 -07:00
2026-07-06 15:50:21 -07:00
2026-07-06 15:50:19 -07:00
2026-07-13 08:27:27 -07:00
2026-05-27 14:15:44 +09:00
2026-06-15 07:42:00 -07:00
2026-03-23 08:33:10 -07:00
2026-03-31 20:43:14 -07:00
2026-07-06 15:50:21 -07:00
2026-07-06 15:50:23 -07:00
2026-02-20 08:13:58 -08:00
2026-03-31 20:43:14 -07:00
2026-05-06 09:48:28 +09:00
2026-04-10 07:58:53 -07:00