]> git.ipfire.org Git - thirdparty/git.git/commit
refs: use transaction in `refs_create_symref()`
authorKarthik Nayak <karthik.188@gmail.com>
Tue, 7 May 2024 12:58:57 +0000 (14:58 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 7 May 2024 15:51:50 +0000 (08:51 -0700)
commit300b38e46f951bab8c6c5cb779b59322be321081
treef8d52c2cabd8d11ee5b63ef668353b1a0be3ac3a
parent644daf7785d6f2fa74330fc246d2bd4d3f8bbab2
refs: use transaction in `refs_create_symref()`

The `refs_create_symref()` function updates a symref to a given new
target. To do this, it uses a ref-backend specific function
`create_symref()`.

In the previous commits, we introduced symref support in transactions.
This means we can now use transactions to perform symref updates and
don't have to resort to `create_symref()`. Doing this allows us to
remove and cleanup `create_symref()`, which we will do in the following
commit.

Modify the expected error message for a test in
't/t0610-reftable-basics.sh', since the error is now thrown from
'refs.c'. This is because in transactional updates, F/D conflicts are
caught before we're in the reference backend.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
t/t0610-reftable-basics.sh
t/t1416-ref-transaction-hooks.sh