var: allow GIT_EDITOR to return null

The handling to die early when there is no EDITOR is valuable when
used in normal code (i.e., editor.c). In git-var, where
null/empty-string is a perfectly valid value to return, it doesn't
make as much sense.

Remove this handling from `git var GIT_EDITOR` so that it does not
fail so noisily when there is no defined editor.

Signed-off-by: Sean Allred <allred.sean@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Sean Allred
2022-11-26 14:17:57 +00:00
committed by Junio C Hamano
parent 26b8abc7b1
commit 2ad150e35e
2 changed files with 63 additions and 6 deletions

View File

@ -11,12 +11,7 @@ static const char var_usage[] = "git var (-l | <variable>)";
static const char *editor(int flag)
{
const char *pgm = git_editor();
if (!pgm && flag & IDENT_STRICT)
die("Terminal is dumb, but EDITOR unset");
return pgm;
return git_editor();
}
static const char *pager(int flag)