X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-filter-branch.sh;h=81392add0b852f51f63a470727c33e0c306260d8;hb=20f7a39825e30891056ab00ea620eaffda6aa451;hp=2688254af399ddc452b120734d41b41292b0ed69;hpb=e910ce30e41ae4ddc20a64661e8cf2702433e5db;p=git.git diff --git a/git-filter-branch.sh b/git-filter-branch.sh index 2688254af..81392add0 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -412,15 +412,17 @@ if [ "$filter_tag_name" ]; then echo "$ref -> $new_ref ($sha1 -> $new_sha1)" if [ "$type" = "tag" ]; then - new_sha1=$(git cat-file tag "$ref" | + new_sha1=$( ( printf 'object %s\ntype commit\ntag %s\n' \ + "$new_sha1" "$new_ref" + git cat-file tag "$ref" | sed -n \ -e "1,/^$/{ - s/^object .*/object $new_sha1/ - s/^type .*/type commit/ - s/^tag .*/tag $new_ref/ + /^object /d + /^type /d + /^tag /d }" \ -e '/^-----BEGIN PGP SIGNATURE-----/q' \ - -e 'p' | + -e 'p' ) | git mktag) || die "Could not create new tag object for $ref" if git cat-file tag "$ref" | \