summaryrefslogtreecommitdiff
path: root/git-filter-branch.sh
diff options
context:
space:
mode:
authorJohannes Sixt <J.Sixt@eudaptics.com>2007-07-04 12:08:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-07-04 19:41:10 (GMT)
commitc57a3494c135ffb7ab5d070afecfcc42a3922edc (patch)
tree412789a10b98b75192b5d46594a9388b46e30df7 /git-filter-branch.sh
parentd54276f207081e35174c5d742e378cfff6e9843f (diff)
downloadgit-c57a3494c135ffb7ab5d070afecfcc42a3922edc.zip
git-c57a3494c135ffb7ab5d070afecfcc42a3922edc.tar.gz
git-c57a3494c135ffb7ab5d070afecfcc42a3922edc.tar.bz2
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>
Diffstat (limited to 'git-filter-branch.sh')
-rw-r--r--git-filter-branch.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 22fb5bf..5fa9b61 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