X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7003-filter-branch.sh;h=329c851685b1c663ee88d45a5d21d452a293fa8e;hb=b13fd5c1a2bd450cdf7b853e0c4861f361882a18;hp=8537bf91606282161ab92b6f2f7367c9a3c016fc;hpb=f18e6bef23809d2823c1a687f375b22c6af0e735;p=git.git diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh index 8537bf916..329c85168 100755 --- a/t/t7003-filter-branch.sh +++ b/t/t7003-filter-branch.sh @@ -39,13 +39,31 @@ test_expect_success 'result is really identical' ' ' test_expect_success 'rewrite bare repository identically' ' - (git config core.bare true && cd .git && git filter-branch branch) + (git config core.bare true && cd .git && + git filter-branch branch > filter-output 2>&1 && + ! fgrep fatal filter-output) ' git config core.bare false test_expect_success 'result is really identical' ' test $H = $(git rev-parse HEAD) ' +TRASHDIR=$(pwd) +test_expect_success 'correct GIT_DIR while using -d' ' + mkdir drepo && + ( cd drepo && + git init && + test_commit drepo && + git filter-branch -d "$TRASHDIR/dfoo" \ + --index-filter "cp \"$TRASHDIR\"/dfoo/backup-refs \"$TRASHDIR\"" \ + ) && + grep drepo "$TRASHDIR/backup-refs" +' + +test_expect_success 'Fail if commit filter fails' ' + test_must_fail git filter-branch -f --commit-filter "exit 1" HEAD +' + test_expect_success 'rewrite, renaming a specific file' ' git filter-branch -f --tree-filter "mv d doh || :" HEAD '