summaryrefslogtreecommitdiff
path: root/git-filter-branch.sh
diff options
context:
space:
mode:
authorMatthias Lederhofer <matled@gmx.net>2007-06-05 14:12:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-06-06 07:29:47 (GMT)
commit350d8575293dc3f25b0c6ec4bbfd9303a0eebd76 (patch)
treef1440fc24d1d7028ad565975cef6eca0e5ba6535 /git-filter-branch.sh
parentaee078bf81d5810cb461e86950f6807d2d45befa (diff)
downloadgit-350d8575293dc3f25b0c6ec4bbfd9303a0eebd76.zip
git-350d8575293dc3f25b0c6ec4bbfd9303a0eebd76.tar.gz
git-350d8575293dc3f25b0c6ec4bbfd9303a0eebd76.tar.bz2
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>
Diffstat (limited to 'git-filter-branch.sh')
-rw-r--r--git-filter-branch.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 0c8a7df..73e7c01 100644
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -349,21 +349,21 @@ while read commit; do
eval "$(set_ident AUTHOR <../commit)"
eval "$(set_ident COMMITTER <../commit)"
- eval "$filter_env"
+ eval "$filter_env" < /dev/null
if [ "$filter_tree" ]; then
git-checkout-index -f -u -a
# files that $commit removed are now still in the working tree;
# remove them, else they would be added again
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' | \
xargs -0 git-update-index --add --replace --remove
git-ls-files -z --others | \
xargs -0 git-update-index --add --replace --remove
fi
- eval "$filter_index"
+ eval "$filter_index" < /dev/null
parentstr=
for parent in $(get_parents $commit); do