Commit c57a3494 authored by Johannes Sixt's avatar Johannes Sixt Committed by Junio C Hamano

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: default avatarJohannes Sixt <johannes.sixt@telecom.at>
Acked-by: Johannes Schindelin's avatarJohannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
parent d54276f2
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment