Merge branch 'bc/filter-branch'

* bc/filter-branch:
  filter-branch.sh: support nearly proper tag name filtering
This commit is contained in:
Junio C Hamano
2008-05-05 19:16:20 -07:00
3 changed files with 58 additions and 6 deletions

View File

@ -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