Re: [PATCH] filter-branch: Avoid an error message in the map function.
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jul 4, 2007, 11:08 UTC
- Message-ID
- <Pine.LNX.4.64.0707041205250.4071@racer.site>
- In-Reply-To
- <11835356473029-git-send-email-johannes.sixt@telecom.at>
Hi,
On Wed, 4 Jul 2007, Johannes Sixt wrote:
Show 5 quoted lines
> - test -r "$workdir/../map/$1" || echo "$1" > - cat "$workdir/../map/$1" > + test -r "$workdir/../map/$1" && > + cat "$workdir/../map/$1" || > + echo "$1"
I think this does not do what you want. If I read it correctly, it will not do anything if $workdir/../map/$1 is not readable. I think you need this:
(test -r "$workdir/../map/$1" && cat "$workdir/../map/$1") || echo "$1"
But that is a little too cute, so I personally would prefer an if-then-else-fi, because that is the idea of that code snippet.
Ciao, Dscho