diff options
Diffstat (limited to 'builtin/notes.c')
| -rw-r--r-- | builtin/notes.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/builtin/notes.c b/builtin/notes.c index 00268e949c..9f38863dd5 100644 --- a/builtin/notes.c +++ b/builtin/notes.c @@ -7,14 +7,17 @@ * and builtin/tag.c by Kristian Høgsberg and Carlos Rica. */ -#include "cache.h" -#include "alloc.h" -#include "config.h" #include "builtin.h" +#include "config.h" +#include "alloc.h" +#include "editor.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "notes.h" -#include "object-store.h" +#include "object-name.h" +#include "object-store-ll.h" +#include "path.h" #include "repository.h" #include "blob.h" #include "pretty.h" @@ -178,7 +181,7 @@ static void write_commented_object(int fd, const struct object_id *object) if (strbuf_read(&buf, show.out, 0) < 0) die_errno(_("could not read 'show' output")); - strbuf_add_commented_lines(&cbuf, buf.buf, buf.len); + strbuf_add_commented_lines(&cbuf, buf.buf, buf.len, comment_line_char); write_or_die(fd, cbuf.buf, cbuf.len); strbuf_release(&cbuf); @@ -206,9 +209,10 @@ static void prepare_note_data(const struct object_id *object, struct note_data * copy_obj_to_fd(fd, old_note); strbuf_addch(&buf, '\n'); - strbuf_add_commented_lines(&buf, "\n", strlen("\n")); - strbuf_add_commented_lines(&buf, _(note_template), strlen(_(note_template))); - strbuf_add_commented_lines(&buf, "\n", strlen("\n")); + strbuf_add_commented_lines(&buf, "\n", strlen("\n"), comment_line_char); + strbuf_add_commented_lines(&buf, _(note_template), strlen(_(note_template)), + comment_line_char); + strbuf_add_commented_lines(&buf, "\n", strlen("\n"), comment_line_char); write_or_die(fd, buf.buf, buf.len); write_commented_object(fd, object); @@ -221,7 +225,7 @@ static void prepare_note_data(const struct object_id *object, struct note_data * die(_("please supply the note contents using either -m or -F option")); } if (d->stripspace) - strbuf_stripspace(&d->buf, 1); + strbuf_stripspace(&d->buf, comment_line_char); } } |
