Skip to content

Commit

Permalink
filter-branch: Avoid an error message in the map function.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Sixt authored and Junio C Hamano committed Jul 4, 2007
1 parent d54276f commit c57a349
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions git-filter-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c57a349

Please sign in to comment.