summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>2018-02-06 08:36:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-02-07 20:46:48 (GMT)
commit9eed6e40c0ec9cbe89efd7303c3facd16fa1364f (patch)
tree697eb7f65f64ff2cdbdb06f5f4fcc0c9a0bb57b6 /t
parent2512f15446149235156528dafbe75930c712b29e (diff)
downloadgit-9eed6e40c0ec9cbe89efd7303c3facd16fa1364f.zip
git-9eed6e40c0ec9cbe89efd7303c3facd16fa1364f.tar.gz
git-9eed6e40c0ec9cbe89efd7303c3facd16fa1364f.tar.bz2
tag: add --edit option
Add a --edit option whichs allows modifying the messages provided by -m or -F, the same way git commit --edit does. Signed-off-by: Nicolas Morey-Chaisemartin <NMoreyChaisemartin@suse.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7004-tag.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index a9af2de..2aac77a 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