commit - 003cc5a3616707763b05246329fd137ad887c3b9
commit + e2af0fd164e80777a70ea292bb5871329a0f8cd2
blob - 2d491b86591c59df3a408119c74dfa30aa5287e8
blob + 0476470fdaf1cd3d39c311d297a739bb61922472
--- got/got.c
+++ got/got.c
err = edit_logmsg(logmsg, a->editor, a->logmsg_path, initial_content);
done:
- unlink(a->logmsg_path);
- free(a->logmsg_path);
+ if (err == NULL || err->code == GOT_ERR_COMMIT_MSG_EMPTY) {
+ unlink(a->logmsg_path);
+ free(a->logmsg_path);
+ a->logmsg_path = NULL;
+ }
free(initial_content);
free(template);