summaryrefslogtreecommitdiff
path: root/git-filter-branch.sh
diff options
context:
space:
mode:
authorIan Campbell <ijc@hellion.org.uk>2017-09-21 07:49:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-09-22 03:57:45 (GMT)
commitb2c1ca6b4baa31c674c86dae38d27ebab4b69e39 (patch)
tree675dbc67be5b5ec741de282ff7c2ac1441377826 /git-filter-branch.sh
parentbd2c79fbfef894d788c256d45cef05d99442407a (diff)
downloadgit-b2c1ca6b4baa31c674c86dae38d27ebab4b69e39.zip
git-b2c1ca6b4baa31c674c86dae38d27ebab4b69e39.tar.gz
git-b2c1ca6b4baa31c674c86dae38d27ebab4b69e39.tar.bz2
filter-branch: use hash-object instead of mktag
This allows us to recreate even historical tags which would now be consider invalid, such as v2.6.12-rc2..v2.6.13-rc3 in the Linux kernel source tree which lack the `tagger` header. $ git rev-parse v2.6.12-rc2 9e734775f7c22d2f89943ad6c745571f1930105f $ git cat-file tag v2.6.12-rc2 | git mktag error: char76: could not find "tagger " fatal: invalid tag signature file $ git cat-file tag v2.6.12-rc2 | git hash-object -t tag -w --stdin 9e734775f7c22d2f89943ad6c745571f1930105f Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-filter-branch.sh')
-rwxr-xr-xgit-filter-branch.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 956869b..3365a3b 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -561,7 +561,7 @@ if [ "$filter_tag_name" ]; then
}' \
-e '/^-----BEGIN PGP SIGNATURE-----/q' \
-e 'p' ) |
- git mktag) ||
+ git hash-object -t tag -w --stdin) ||
die "Could not create new tag object for $ref"
if git cat-file tag "$ref" | \
sane_grep '^-----BEGIN PGP SIGNATURE-----' >/dev/null 2>&1