Skip to content

Commit

Permalink
Merge branch 'ps/reftable-repo-init-fix'
Browse files Browse the repository at this point in the history
Clear the fallout from a fix for 2.44 regression.

* ps/reftable-repo-init-fix:
  t0610: remove unused variable assignment
  refs/reftable: don't fail empty transactions in repo without HEAD
  • Loading branch information
gitster committed Mar 7, 2024
2 parents ce65a18 + e0795e2 commit 963a277
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions refs/reftable-backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,7 @@ static int reftable_be_transaction_prepare(struct ref_store *ref_store,
&head_referent, &head_type);
if (ret < 0)
goto done;
ret = 0;

for (i = 0; i < transaction->nr; i++) {
struct ref_update *u = transaction->updates[i];
Expand Down
12 changes: 12 additions & 0 deletions t/t0610-reftable-basics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,18 @@ test_expect_success 'ref transaction: writes are synced' '
EOF
'

test_expect_success 'ref transaction: empty transaction in empty repo' '
test_when_finished "rm -rf repo" &&
git init repo &&
test_commit -C repo --no-tag A &&
git -C repo update-ref -d refs/heads/main &&
test-tool -C repo ref-store main delete-refs REF_NO_DEREF msg HEAD &&
git -C repo update-ref --stdin <<-EOF
prepare
commit
EOF
'

test_expect_success 'pack-refs: compacts tables' '
test_when_finished "rm -rf repo" &&
git init repo &&
Expand Down

0 comments on commit 963a277

Please sign in to comment.