Browse Source

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>
maint
Johannes Sixt 18 years ago committed by Junio C Hamano
parent
commit
c57a3494c1
  1. 8
      git-filter-branch.sh

8
git-filter-branch.sh

@ -16,8 +16,12 @@ USAGE="git-filter-branch [-d TEMPDIR] [FILTERS] DESTBRANCH [REV-RANGE]" @@ -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

Loading…
Cancel
Save