summaryrefslogtreecommitdiff
path: root/t/t7003-filter-branch.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-05-06 02:16:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-05-06 02:16:20 (GMT)
commite9dd7518666ae8bfb3d7ddbca1a00c018d2e79e8 (patch)
tree0c5f257be4726f4760bd4d63dfb3585ea667c090 /t/t7003-filter-branch.sh
parente2e2defc14a79ea5b4aaae23e33072f29c5965eb (diff)
parent1bf6551e42c79a594689a356a9b14759d55f3cf5 (diff)
downloadgit-e9dd7518666ae8bfb3d7ddbca1a00c018d2e79e8.zip
git-e9dd7518666ae8bfb3d7ddbca1a00c018d2e79e8.tar.gz
git-e9dd7518666ae8bfb3d7ddbca1a00c018d2e79e8.tar.bz2
Merge branch 'bc/filter-branch'
* bc/filter-branch: filter-branch.sh: support nearly proper tag name filtering
Diffstat (limited to 't/t7003-filter-branch.sh')
-rwxr-xr-xt/t7003-filter-branch.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index efd658a..16df3d4 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -219,4 +219,36 @@ test_expect_success 'Subdirectory filter with disappearing trees' '
test $(git rev-list master | wc -l) = 3
'
+test_expect_success 'Tag name filtering retains tag message' '
+ git tag -m atag T &&
+ git cat-file tag T > expect &&
+ git filter-branch -f --tag-name-filter cat &&
+ git cat-file tag T > actual &&
+ git diff expect actual
+'
+
+faux_gpg_tag='object XXXXXX
+type commit
+tag S
+tagger T A Gger <tagger@example.com> 1206026339 -0500
+
+This is a faux gpg signed tag.
+-----BEGIN PGP SIGNATURE-----
+Version: FauxGPG v0.0.0 (FAUX/Linux)
+
+gdsfoewhxu/6l06f1kxyxhKdZkrcbaiOMtkJUA9ITAc1mlamh0ooasxkH1XwMbYQ
+acmwXaWET20H0GeAGP+7vow=
+=agpO
+-----END PGP SIGNATURE-----
+'
+test_expect_success 'Tag name filtering strips gpg signature' '
+ sha1=$(git rev-parse HEAD) &&
+ sha1t=$(echo "$faux_gpg_tag" | sed -e s/XXXXXX/$sha1/ | git mktag) &&
+ git update-ref "refs/tags/S" "$sha1t" &&
+ echo "$faux_gpg_tag" | sed -e s/XXXXXX/$sha1/ | head -n 6 > expect &&
+ git filter-branch -f --tag-name-filter cat &&
+ git cat-file tag S > actual &&
+ git diff expect actual
+'
+
test_done