Merge branch 'kn/reflog-symref-fix'

reflog entries for symbolic ref updates were broken, which has been
corrected.

* kn/reflog-symref-fix:
  refs: fix creation of reflog entries for symrefs
maint
Junio C Hamano 2025-01-29 14:05:09 -08:00
commit d205f06ae0
2 changed files with 9 additions and 3 deletions

View File

@ -2615,9 +2615,6 @@ static int lock_ref_for_update(struct files_ref_store *refs,

update->backend_data = lock;

if (update->flags & REF_LOG_ONLY)
goto out;

if (update->type & REF_ISSYMREF) {
if (update->flags & REF_NO_DEREF) {
/*

View File

@ -2068,4 +2068,13 @@ do

done

test_expect_success 'update-ref should also create reflog for HEAD' '
test_commit to-rewind &&
git rev-parse HEAD >expect &&
head=$(git symbolic-ref HEAD) &&
git update-ref --create-reflog "$head" HEAD~ &&
git rev-parse HEAD@{1} >actual &&
test_cmp expect actual
'

test_done