From: Kristoffer Haugsbakk Date: Sun, 14 May 2023 13:17:59 GMT Subject: [PATCH 2/3] t/t7004-tag: add failing tag message file test Message-ID: <1f24aa43f70b16381ef0cfb4f1d482706161554d.1684067644.git.code@khaugsbakk.name> In-Reply-To: Signed-off-by: Kristoffer Haugsbakk --- t/t7004-tag.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index 550b5b1cce..1e512dbe06 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -2136,4 +2136,14 @@ test_expect_success 'If tag is created then tag message file is unlinked' ' ! test -e .git/TAG_EDITMSG ' +test_expect_success 'If tag cannot be created then tag message file is not unlinked' ' + test_when_finished "git tag -d foo/bar" && + write_script fakeeditor <<-\EOF && + echo Message >.git/TAG_EDITMSG + EOF + git tag foo/bar && + ! GIT_EDITOR=./fakeeditor git tag -a foo && + test -e .git/TAG_EDITMSG +' + test_done -- 2.40.1