From: Johannes Sixt Date: Wed, 4 Jul 2007 12:08:17 +0000 (+0200) Subject: filter-branch: Avoid an error message in the map function. X-Git-Tag: v1.5.3-rc1~88 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c57a3494c135ffb7ab5d070afecfcc42a3922edc;p=git.git filter-branch: Avoid an error message in the map function. When the map function didn't find the rewritten commit of the passed in original id, it printed the original id, but it still fell through to the 'cat', which failed with an error message. Signed-off-by: Johannes Sixt Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- diff --git a/git-filter-branch.sh b/git-filter-branch.sh index 22fb5bf6a..5fa9b6174 100644 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -16,8 +16,12 @@ USAGE="git-filter-branch [-d TEMPDIR] [FILTERS] DESTBRANCH [REV-RANGE]" map() { # if it was not rewritten, take the original - test -r "$workdir/../map/$1" || echo "$1" - cat "$workdir/../map/$1" + if test -r "$workdir/../map/$1" + then + cat "$workdir/../map/$1" + else + echo "$1" + fi } # When piped a commit, output a script to set the ident of either