diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-03-06 23:53:59 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-06 23:53:59 +0100 |
commit | 05d290e1dbd2ed424cd3c872c5b20390100fa5f7 (patch) | |
tree | 4c5dddfbfd8cebb208550cf423ace1576150b8ac /t | |
parent | Sixth batch for 2.17 (diff) | |
parent | tag: add --edit option (diff) | |
download | git-05d290e1dbd2ed424cd3c872c5b20390100fa5f7.tar.xz git-05d290e1dbd2ed424cd3c872c5b20390100fa5f7.zip |
Merge branch 'nm/tag-edit'
"git tag" learned an explicit "--edit" option that allows the
message given via "-m" and "-F" to be further edited.
* nm/tag-edit:
tag: add --edit option
Diffstat (limited to 't')
-rwxr-xr-x | t/t7004-tag.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index a9af2de996..2aac77af70 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -452,6 +452,21 @@ test_expect_success \ test_cmp expect actual ' +get_tag_header annotated-tag-edit $commit commit $time >expect +echo "An edited message" >>expect +test_expect_success 'set up editor' ' + write_script fakeeditor <<-\EOF + sed -e "s/A message/An edited message/g" <"$1" >"$1-" + mv "$1-" "$1" + EOF +' +test_expect_success \ + 'creating an annotated tag with -m message --edit should succeed' ' + GIT_EDITOR=./fakeeditor git tag -m "A message" --edit annotated-tag-edit && + get_tag_msg annotated-tag-edit >actual && + test_cmp expect actual +' + cat >msgfile <<EOF Another message in a file. @@ -465,6 +480,21 @@ test_expect_success \ test_cmp expect actual ' +get_tag_header file-annotated-tag-edit $commit commit $time >expect +sed -e "s/Another message/Another edited message/g" msgfile >>expect +test_expect_success 'set up editor' ' + write_script fakeeditor <<-\EOF + sed -e "s/Another message/Another edited message/g" <"$1" >"$1-" + mv "$1-" "$1" + EOF +' +test_expect_success \ + 'creating an annotated tag with -F messagefile --edit should succeed' ' + GIT_EDITOR=./fakeeditor git tag -F msgfile --edit file-annotated-tag-edit && + get_tag_msg file-annotated-tag-edit >actual && + test_cmp expect actual +' + cat >inputmsg <<EOF A message from the standard input |