]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t7003-filter-branch.sh
filter-branch: provide the convenience functions also for commit filters
[thirdparty/git.git] / t / t7003-filter-branch.sh
index bc6e2ddb19093fbdc9e4f94cbec71d369f0251ed..c79853d986ab31da6813576fe003f8a5885e0b64 100755 (executable)
@@ -159,4 +159,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