aboutsummaryrefslogtreecommitdiff
path: root/builtin-commit.c
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2008-02-05 11:01:45 +0100
committerJunio C Hamano <gitster@pobox.com>2008-02-06 02:26:02 -0800
commit406400ce4f69e79b544dd3539a71b85d99331820 (patch)
treeba11111ec74340689bc94ec0689dd628852dfdce /builtin-commit.c
parent3473f3035d04957ca24d3ccc232f4263b26d6bb8 (diff)
downloadgit-406400ce4f69e79b544dd3539a71b85d99331820.tar.gz
git-406400ce4f69e79b544dd3539a71b85d99331820.tar.xz
git-commit: set GIT_EDITOR=: if editor will not be launched
This is a preparatory patch that provides a simple way for the future prepare-commit-msg hook to discover if the editor will be launched. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-commit.c')
-rw-r--r--builtin-commit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-commit.c b/builtin-commit.c
index ec00134f9..90ddbaebf 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -599,6 +599,8 @@ static int parse_and_validate_options(int argc, const char *argv[],
use_editor = 0;
if (edit_flag)
use_editor = 1;
+ if (!use_editor)
+ setenv("GIT_EDITOR", ":", 1);
if (get_sha1("HEAD", head_sha1))
initial_commit = 1;