filter-branch: prevent filters from reading from stdin

stdin is the list of commits when the env, tree and index
filter are executed.  The filters are not supposed to read
anything from stdin so the best is to give them /dev/null
for reading.

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Matthias Lederhofer 2007-06-05 16:12:08 +02:00 committed by Junio C Hamano
parent aee078bf81
commit 350d857529

View File

@ -349,21 +349,21 @@ while read commit; do
eval "$(set_ident AUTHOR <../commit)" eval "$(set_ident AUTHOR <../commit)"
eval "$(set_ident COMMITTER <../commit)" eval "$(set_ident COMMITTER <../commit)"
eval "$filter_env" eval "$filter_env" < /dev/null
if [ "$filter_tree" ]; then if [ "$filter_tree" ]; then
git-checkout-index -f -u -a git-checkout-index -f -u -a
# files that $commit removed are now still in the working tree; # files that $commit removed are now still in the working tree;
# remove them, else they would be added again # remove them, else they would be added again
git-ls-files -z --others | xargs -0 rm -f git-ls-files -z --others | xargs -0 rm -f
eval "$filter_tree" eval "$filter_tree" < /dev/null
git-diff-index -r $commit | cut -f 2- | tr '\n' '\0' | \ git-diff-index -r $commit | cut -f 2- | tr '\n' '\0' | \
xargs -0 git-update-index --add --replace --remove xargs -0 git-update-index --add --replace --remove
git-ls-files -z --others | \ git-ls-files -z --others | \
xargs -0 git-update-index --add --replace --remove xargs -0 git-update-index --add --replace --remove
fi fi
eval "$filter_index" eval "$filter_index" < /dev/null
parentstr= parentstr=
for parent in $(get_parents $commit); do for parent in $(get_parents $commit); do