Skip to content

Commit

Permalink
Export launch_editor() and make it accept ':' as a no-op editor.
Browse files Browse the repository at this point in the history
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Kristian Høgsberg authored and gitster committed Nov 23, 2007
1 parent d63c2fd commit 943316e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion builtin-tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions strbuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 943316e

Please sign in to comment.