diff options
author | Stephan Beyer <s-beyer@gmx.net> | 2008-07-25 18:28:42 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-07-25 17:09:38 -0700 |
commit | 7198203ae37c11327c0d01f1e37f3e74381755a9 (patch) | |
tree | 85943c2eca8abf5458105626471f517a340cc5a2 /builtin-commit.c | |
parent | d82f33e20dcf068e679eff2a16ecf8fe7b10fb31 (diff) | |
download | git-7198203ae37c11327c0d01f1e37f3e74381755a9.tar.gz git-7198203ae37c11327c0d01f1e37f3e74381755a9.tar.xz |
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>
Diffstat (limited to 'builtin-commit.c')
-rw-r--r-- | builtin-commit.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin-commit.c b/builtin-commit.c index 6a9dc0e30..9a11ca0bc 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -646,7 +646,11 @@ static int prepare_to_commit(const char *index_file, const char *prefix) char index[PATH_MAX]; const char *env[2] = { index, NULL }; snprintf(index, sizeof(index), "GIT_INDEX_FILE=%s", index_file); - launch_editor(git_path(commit_editmsg), NULL, env); + if (launch_editor(git_path(commit_editmsg), NULL, env)) { + fprintf(stderr, + "Please supply the message using either -m or -F option.\n"); + exit(1); + } } if (!no_verify && |