commit - 8279ab8c66b2cff381b52f3b30118c624c93088f
commit + beb452e226a6110ef7ace94ab1c804f8e5287e04
blob - ebb83e1f7c48d140c5018cc14b0f4154252b80d6
blob + db215a3dfb509c965b6cad95da9e863781b562eb
--- got/got.c
+++ got/got.c
TAILQ_INIT(&refs);
- err = got_opentemp_named(logmsg_path, &f, "got-commit-logmsg", "");
- if (err)
- goto done;
+ *logmsg_path = NULL;
err = got_worktree_get_uuid(&uuidstr, worktree);
if (err)
goto done;
if (add_logmsg) {
+ if (f == NULL) {
+ err = got_opentemp_named(logmsg_path, &f,
+ "got-commit-logmsg", "");
+ if (err)
+ goto done;
+ }
err = cat_logmsg(f, commit, refname, type,
added_logmsg);
if (err)