X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-filter-branch.sh;h=a324cf0596ee0f05831190ce724fe9134bc7f568;hb=fc721b699b817e9cb78994c6dd6d86e744bd2112;hp=182822a24e214fe7e93a2df68fdda3dd40b5896d;hpb=372c767610c4e4d7f4832d037ac51a62a59875a3;p=git.git diff --git a/git-filter-branch.sh b/git-filter-branch.sh index 182822a24..a324cf059 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -361,9 +361,17 @@ do ;; $_x40) echo "Ref '$ref' was rewritten" - git update-ref -m "filter-branch: rewrite" \ - "$ref" $rewritten $sha1 || - die "Could not rewrite $ref" + if ! git update-ref -m "filter-branch: rewrite" \ + "$ref" $rewritten $sha1 2>/dev/null; then + if test $(git cat-file -t "$ref") = tag; then + if test -z "$filter_tag_name"; then + warn "WARNING: You said to rewrite tagged commits, but not the corresponding tag." + warn "WARNING: Perhaps use '--tag-name-filter cat' to rewrite the tag." + fi + else + die "Could not rewrite $ref" + fi + fi ;; *) # NEEDSWORK: possibly add -Werror, making this an error