Fix commit-msg hook to allow editing
The old git-commit.sh script allowed the commit-msg hook to not only prevent a commit from proceding, but also to edit the commit message on the fly and allow it to proceed. So here we teach builtin-commit to do the same. This is based on Wincent's patch, but redone with a clarified logic. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
@ -53,6 +53,8 @@ void launch_editor(const char *path, struct strbuf *buffer, const char *const *e
|
||||
die("There was a problem with the editor %s.", editor);
|
||||
}
|
||||
|
||||
if (!buffer)
|
||||
return;
|
||||
if (strbuf_read_file(buffer, path, 0) < 0)
|
||||
die("could not read message file '%s': %s",
|
||||
path, strerror(errno));
|
||||
|
Reference in New Issue
Block a user