]> git.99rst.org Git - git.git/commit
tag: keep the message file in case ref transaction fails
authorKristoffer Haugsbakk <redacted>
Tue, 16 May 2023 17:55:46 +0000 (19:55 +0200)
committerJunio C Hamano <redacted>
Tue, 16 May 2023 18:38:14 +0000 (11:38 -0700)
commit08c12ec1d0444c9ea7cf24b7157aa158f3f641f4
treeb2c76d08612fd5a3537c3eea934db564f015608e
parent669c11de85d0071a31de0e49f6e5b602fd54a9ef
tag: keep the message file in case ref transaction fails

The ref transaction can fail after the user has written their tag
message. In particular, if there exists a tag `foo/bar` and `git tag -a
foo` is said then the command will only fail once it tries to write
`refs/tags/foo`, which is after the file has been unlinked.

Hold on to the message file for a little longer so that it is not
unlinked before the fatal error occurs.

Signed-off-by: Kristoffer Haugsbakk <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/tag.c
t/t7004-tag.sh
git clone https://git.99rst.org/PROJECT