return error("unable to fdopen %s: %s",
lock->lk->tempfile.filename.buf, strerror(errno));
+ update_symref_reflog(lock, refname, target, logmsg);
+
/* no error check; commit_ref will check ferror */
fprintf(lock->lk->tempfile.fp, "ref: %s\n", target);
if (commit_ref(lock) < 0)
return error("unable to write symref for %s: %s", refname,
strerror(errno));
- update_symref_reflog(lock, refname, target, logmsg);
return 0;
}