From: Kristian Høgsberg Date: Fri, 2 Nov 2007 15:33:08 +0000 (-0400) Subject: Export launch_editor() and make it accept ':' as a no-op editor. X-Git-Tag: v1.5.4-rc0~78^2~31 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=943316e96ca2dad67086af2f945e42467a27ddd6;p=git.git Export launch_editor() and make it accept ':' as a no-op editor. Signed-off-by: Kristian Høgsberg Signed-off-by: Junio C Hamano --- diff --git a/builtin-tag.c b/builtin-tag.c index cbb0f04e8..88a5449e6 100644 --- a/builtin-tag.c +++ b/builtin-tag.c @@ -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; diff --git a/strbuf.h b/strbuf.h index 13919123d..8334a9bad 100644 --- 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 */