vendor/libgit2/src/transaction.c in rugged-0.28.4.1 vs vendor/libgit2/src/transaction.c in rugged-0.28.5
- old
+ new
@@ -337,10 +337,16 @@
if (node->reflog) {
if ((error = tx->db->backend->reflog_write(tx->db->backend, node->reflog)) < 0)
return error;
}
- if (node->ref_type != GIT_REFERENCE_INVALID) {
+ if (node->ref_type == GIT_REFERENCE_INVALID) {
+ /* ref was locked but not modified */
+ if ((error = git_refdb_unlock(tx->db, node->payload, false, false, NULL, NULL, NULL)) < 0) {
+ return error;
+ }
+ node->committed = true;
+ } else {
if ((error = update_target(tx->db, node)) < 0)
return error;
}
});