- /* edit command */
-
- if (msg.given || msgfile) {
- if (msg.given && msgfile) {
- error("mixing -m and -F options is not allowed.");
- usage_with_options(git_notes_usage, options);
- }
- if (msg.given)
- strbuf_addbuf(&buf, &(msg.buf));
- else {
- if (!strcmp(msgfile, "-")) {
- if (strbuf_read(&buf, 0, 1024) < 0)
- die_errno("cannot read '%s'", msgfile);
- } else {
- if (strbuf_read_file(&buf, msgfile, 1024) < 0)
- die_errno("could not open or read '%s'",
- msgfile);
- }
- }
+ /* edit/remove command */
+
+ if (remove)
+ strbuf_reset(&buf);
+ else if (msg.given)
+ strbuf_addbuf(&buf, &(msg.buf));
+ else if (msgfile) {
+ if (!strcmp(msgfile, "-")) {
+ if (strbuf_read(&buf, 0, 1024) < 0)
+ die_errno("cannot read '%s'", msgfile);
+ } else if (strbuf_read_file(&buf, msgfile, 1024) < 0)
+ die_errno("could not open or read '%s'", msgfile);