Export launch_editor() and make it accept ':' as a no-op editor.
authorKristian Høgsberg <krh@redhat.com>
Fri, 2 Nov 2007 15:33:08 +0000 (11:33 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 23 Nov 2007 01:05:02 +0000 (17:05 -0800)
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-tag.c
strbuf.h

index cbb0f04e85627a5509bb2ba8cbf04a54d4d20c41..88a5449e67c9220564fe3461b9f99dc1fd41e9b4 100644 (file)
@@ -17,7 +17,7 @@ static const char builtin_tag_usage[] =
 
 static char signingkey[1000];
 
-static void launch_editor(const char *path, struct strbuf *buffer)
+void launch_editor(const char *path, struct strbuf *buffer)
 {
        const char *editor, *terminal;
        struct child_process child;
@@ -42,6 +42,9 @@ static void launch_editor(const char *path, struct strbuf *buffer)
        if (!editor)
                editor = "vi";
 
+       if (!strcmp(editor, ":"))
+               return;
+
        memset(&child, 0, sizeof(child));
        child.argv = args;
        args[0] = editor;
index 13919123dc5261e7b8e4a4fdfc696f2355482b6c..8334a9bad00ddf3e66c18c37020f9ab08691cffa 100644 (file)
--- a/strbuf.h
+++ b/strbuf.h
@@ -117,5 +117,6 @@ extern int strbuf_read_file(struct strbuf *sb, const char *path, size_t hint);
 extern int strbuf_getline(struct strbuf *, FILE *, int);
 
 extern void stripspace(struct strbuf *buf, int skip_comments);
+extern void launch_editor(const char *path, struct strbuf *buffer);
 
 #endif /* STRBUF_H */