editor.c: Libify launch_editor()
This patch removes exit()/die() calls and builtin-specific messages from launch_editor(), so that it can be used as a general libgit.a function to launch an editor. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
d82f33e20d
commit
7198203ae3
@ -295,7 +295,11 @@ static void create_tag(const unsigned char *object, const char *tag,
|
||||
write_or_die(fd, tag_template, strlen(tag_template));
|
||||
close(fd);
|
||||
|
||||
launch_editor(path, buf, NULL);
|
||||
if (launch_editor(path, buf, NULL)) {
|
||||
fprintf(stderr,
|
||||
"Please supply the message using either -m or -F option.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
unlink(path);
|
||||
free(path);
|
||||
|
||||
Reference in New Issue
Block a user