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:

committed by
Junio C Hamano

parent
26b8abc7b1
commit
2ad150e35e
@ -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)
|
||||
|
Reference in New Issue
Block a user