commit - 73e7eb7d1cfead096b0297377490aeaac95a73f5
commit + 0d5bb27670e5cdef181f8073984fd02be5a42d53
blob - 6d427879bfb75db1dd06c1c4b0eb326ddd18ffc0
blob + a25e4752c753ed41ccef89d82be94cb91863bc50
--- got/got.c
+++ got/got.c
static const struct got_error *
edit_logmsg(char **logmsg, const char *editor, const char *logmsg_path,
- const char *initial_content, size_t initial_content_len)
+ const char *initial_content, size_t initial_content_len, int check_comments)
{
const struct got_error *err = NULL;
char *line = NULL;
"commit message cannot be empty, aborting");
goto done;
}
- if (strcmp(*logmsg, initial_content_stripped) == 0)
+ if (check_comments && strcmp(*logmsg, initial_content_stripped) == 0)
err = got_error_msg(GOT_ERR_COMMIT_MSG_EMPTY,
"no changes made to commit message, aborting");
done:
}
err = edit_logmsg(logmsg, editor, *logmsg_path, initial_content,
- initial_content_len);
+ initial_content_len, 1);
done:
if (fd != -1 && close(fd) == -1 && err == NULL)
err = got_error_from_errno2("close", *logmsg_path);
if (err)
goto done;
err = edit_logmsg(tagmsg, editor, *tagmsg_path, initial_content,
- initial_content_len);
+ initial_content_len, 1);
done:
free(initial_content);
free(template);
}
err = edit_logmsg(logmsg, a->editor, a->logmsg_path, initial_content,
- initial_content_len);
+ initial_content_len, 1);
done:
free(initial_content);
free(template);
goto done;
err = edit_logmsg(&hle->logmsg, editor, logmsg_path, logmsg,
- logmsg_len);
+ logmsg_len, 0);
if (err) {
if (err->code != GOT_ERR_COMMIT_MSG_EMPTY)
goto done;