Re: [PATCHv3] filter-branch: Add more error-handling
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 11, 2009, 20:48 UTC
- Message-ID
- <alpine.DEB.1.00.0902112145400.10279@pacific.mpi-cbg.de>
- In-Reply-To
- <1234382600-7801-1-git-send-email-git@randomhacks.net>
Hi,
On Wed, 11 Feb 2009, Eric Kidd wrote:
> charon on #git helped with pipeline error handling.
JFYI charon is the nick of Thomas Rast.
Show 10 quoted lines
> diff --git a/git-filter-branch.sh b/git-filter-branch.sh > index 86eef56..27b57b8 100755 > --- a/git-filter-branch.sh > +++ b/git-filter-branch.sh > @@ -221,7 +221,7 @@ die "" > trap 'cd ../..; rm -rf "$tempdir"' 0 > > # Make sure refs/original is empty > -git for-each-ref > "$tempdir"/backup-refs > +git for-each-ref > "$tempdir"/backup-refs || exit
I haven't checked, but is "$tempdir" not the working directory? If so, this would lead to funny interaction with --tree-filter. Rather, I'd write the file into "$GIT_DIR". Likewise the other files.
> +test_must_fail 'Fail if commit filter fails' ' > + git filter-branch -f --commit-filter "exit 1" HEAD > +' > +
That's not how it is supposed to be used. Rather,
test_expect_success $LABEL ' test_must_fail git filter-branc $OPTIONS '
Thanks, Dscho