X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7003-filter-branch.sh;h=e935b2000ac6589a4940f585616f8bf3be95223b;hb=da0204df587ae76cd291bc7e495fc60d873c2f20;hp=bc6e2ddb19093fbdc9e4f94cbec71d369f0251ed;hpb=a6954452ecf757523b31d6eaaf7e00c7a2d91e46;p=git.git diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh index bc6e2ddb1..e935b2000 100755 --- a/t/t7003-filter-branch.sh +++ b/t/t7003-filter-branch.sh @@ -138,13 +138,7 @@ test_expect_success "remove a certain author's commits" ' git-filter-branch -f --commit-filter "\ if [ \"\$GIT_AUTHOR_NAME\" = \"B V Uips\" ];\ then\ - shift;\ - while [ -n \"\$1\" ];\ - do\ - shift;\ - echo \"\$1\";\ - shift;\ - done;\ + skip_commit \"\$@\"; else\ git commit-tree \"\$@\";\ fi" removed-author && @@ -159,4 +153,14 @@ test_expect_success 'barf on invalid name' ' ! git filter-branch -f HEAD^ ' +test_expect_success '"map" works in commit filter' ' + git filter-branch -f --commit-filter "\ + parent=\$(git rev-parse \$GIT_COMMIT^) && + mapped=\$(map \$parent) && + actual=\$(echo \"\$@\" | sed \"s/^.*-p //\") && + test \$mapped = \$actual && + git commit-tree \"\$@\";" master~2..master && + git rev-parse --verify master +' + test_done