diff options
author | Eric Kidd <git@randomhacks.net> | 2009-02-11 16:10:41 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-02-11 18:26:52 -0800 |
commit | 0ea29cce4d099d2fa6613ec66c080776cfe869d5 (patch) | |
tree | 1d7efa6cea53dc291579a7299cd30a553ea6e60d /t/t7003-filter-branch.sh | |
parent | Fix contrib/hooks/post-receive-email for new duplicate branch (diff) | |
download | tgif-0ea29cce4d099d2fa6613ec66c080776cfe869d5.tar.xz |
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-x | t/t7003-filter-branch.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh index cb0474336d..56b5eccdb4 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 ' |