Skip to content

Commit 943316e

Browse files
Kristian Høgsberggitster
authored andcommitted
Export launch_editor() and make it accept ':' as a no-op editor.
Signed-off-by: Kristian Høgsberg <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d63c2fd commit 943316e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

builtin-tag.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static const char builtin_tag_usage[] =
1717

1818
static char signingkey[1000];
1919

20-
static void launch_editor(const char *path, struct strbuf *buffer)
20+
void launch_editor(const char *path, struct strbuf *buffer)
2121
{
2222
const char *editor, *terminal;
2323
struct child_process child;
@@ -42,6 +42,9 @@ static void launch_editor(const char *path, struct strbuf *buffer)
4242
if (!editor)
4343
editor = "vi";
4444

45+
if (!strcmp(editor, ":"))
46+
return;
47+
4548
memset(&child, 0, sizeof(child));
4649
child.argv = args;
4750
args[0] = editor;

strbuf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,6 @@ extern int strbuf_read_file(struct strbuf *sb, const char *path, size_t hint);
117117
extern int strbuf_getline(struct strbuf *, FILE *, int);
118118

119119
extern void stripspace(struct strbuf *buf, int skip_comments);
120+
extern void launch_editor(const char *path, struct strbuf *buffer);
120121

121122
#endif /* STRBUF_H */

0 commit comments

Comments
 (0)