Skip to content

Commit 963a277

Browse files
committed
Merge branch 'ps/reftable-repo-init-fix'
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
2 parents ce65a18 + e0795e2 commit 963a277

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

refs/reftable-backend.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,7 @@ static int reftable_be_transaction_prepare(struct ref_store *ref_store,
781781
&head_referent, &head_type);
782782
if (ret < 0)
783783
goto done;
784+
ret = 0;
784785

785786
for (i = 0; i < transaction->nr; i++) {
786787
struct ref_update *u = transaction->updates[i];

t/t0610-reftable-basics.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,18 @@ test_expect_success 'ref transaction: writes are synced' '
328328
EOF
329329
'
330330

331+
test_expect_success 'ref transaction: empty transaction in empty repo' '
332+
test_when_finished "rm -rf repo" &&
333+
git init repo &&
334+
test_commit -C repo --no-tag A &&
335+
git -C repo update-ref -d refs/heads/main &&
336+
test-tool -C repo ref-store main delete-refs REF_NO_DEREF msg HEAD &&
337+
git -C repo update-ref --stdin <<-EOF
338+
prepare
339+
commit
340+
EOF
341+
'
342+
331343
test_expect_success 'pack-refs: compacts tables' '
332344
test_when_finished "rm -rf repo" &&
333345
git init repo &&

0 commit comments

Comments
 (0)