summaryrefslogtreecommitdiff
path: root/t/t7003-filter-branch.sh
diff options
context:
space:
mode:
authorEric Kidd <git@randomhacks.net>2009-02-11 21:10:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-02-12 02:26:52 (GMT)
commit0ea29cce4d099d2fa6613ec66c080776cfe869d5 (patch)
tree1d7efa6cea53dc291579a7299cd30a553ea6e60d /t/t7003-filter-branch.sh
parente5f5050ed1481c3bc27658f625a87155aed0984f (diff)
downloadgit-0ea29cce4d099d2fa6613ec66c080776cfe869d5.zip
git-0ea29cce4d099d2fa6613ec66c080776cfe869d5.tar.gz
git-0ea29cce4d099d2fa6613ec66c080776cfe869d5.tar.bz2
filter-branch: Add more error-handling
9273b56 (filter-branch: Fix fatal error on bare repositories, 2009-02-03) fixed a missing check of return status from an underlying command in git-filter-branch, but there still are places that do not check errors. For example, the command does not pay attention to the exit status of the command given by --commit-filter. It should abort in such a case. This attempts to fix all the remaining places that fails to checks errors. In two places, I've had to break apart pipelines in order to check the error code for the first stage of the pipeline, as discussed here: http://kerneltrap.org/mailarchive/git/2009/1/28/4835614 Feedback on this patch was provided by Johannes Sixt, Johannes Schindelin and Junio C Hamano. Thomas Rast helped with pipeline error handling. Signed-off-by: Eric Kidd <git@randomhacks.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7003-filter-branch.sh')
-rwxr-xr-xt/t7003-filter-branch.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index cb04743..56b5ecc 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -48,6 +48,10 @@ test_expect_success 'result is really identical' '
test $H = $(git rev-parse HEAD)
'
+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
'