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 <johannes.sixt@telecom.at> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Sixt committed
Jul 4, 2007 at 14:08 UTC
c57a3494c135ffb7ab5d070afecfcc42a3922edc
1 file changed
+6
-2
git-filter-branch.sh
+6
-2
@@ -16,8 +16,12 @@ USAGE="git-filter-branch [-d TEMPDIR] [FILTERS] DESTBRANCH [REV-RANGE]"
16
map()
17
{
18
# if it was not rewritten, take the original
19
- test -r "$workdir/../map/$1" || echo "$1"
20
- cat "$workdir/../map/$1"
19
+ if test -r "$workdir/../map/$1"
20
+ then
21
+ cat "$workdir/../map/$1"
22
+ else
23
+ echo "$1"
24
+ fi
25
}
26
27
# When piped a commit, output a script to set the ident of either