summaryrefslogtreecommitdiff
path: root/builtin/notes.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-10-26 15:55:20 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-10-26 15:55:20 -0700
commit1ad7c0f6896bf0fa0b1b4965d7395b7ba2695fdc (patch)
tree8ac018758924a1b437895974529dccbe8bae664c /builtin/notes.c
parentMerge branch 'rt/placeholder-in-usage' (diff)
parentstripspace: use parse-options for command-line parsing (diff)
downloadtgif-1ad7c0f6896bf0fa0b1b4965d7395b7ba2695fdc.tar.xz
Merge branch 'tk/stripspace'
The internal stripspace() function has been moved to where it logically belongs to, i.e. strbuf API, and the command line parser of "git stripspace" has been updated to use the parse_options API. * tk/stripspace: stripspace: use parse-options for command-line parsing strbuf: make stripspace() part of strbuf
Diffstat (limited to 'builtin/notes.c')
-rw-r--r--builtin/notes.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/notes.c b/builtin/notes.c
index 13c0af9155..515cebbeb8 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -192,7 +192,7 @@ static void prepare_note_data(const unsigned char *object, struct note_data *d,
if (launch_editor(d->edit_path, &d->buf, NULL)) {
die(_("Please supply the note contents using either -m or -F option"));
}
- stripspace(&d->buf, 1);
+ strbuf_stripspace(&d->buf, 1);
}
}
@@ -215,7 +215,7 @@ static int parse_msg_arg(const struct option *opt, const char *arg, int unset)
if (d->buf.len)
strbuf_addch(&d->buf, '\n');
strbuf_addstr(&d->buf, arg);
- stripspace(&d->buf, 0);
+ strbuf_stripspace(&d->buf, 0);
d->given = 1;
return 0;
@@ -232,7 +232,7 @@ static int parse_file_arg(const struct option *opt, const char *arg, int unset)
die_errno(_("cannot read '%s'"), arg);
} else if (strbuf_read_file(&d->buf, arg, 1024) < 0)
die_errno(_("could not open or read '%s'"), arg);
- stripspace(&d->buf, 0);
+ strbuf_stripspace(&d->buf, 0);
d->given = 1;
return 0;