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>
Matthias Lederhofer committed
Jun 5, 2007 at 16:12 UTC
350d8575293dc3f25b0c6ec4bbfd9303a0eebd76
1 file changed
+3
-3
git-filter-branch.sh
+3
-3
@@ -349,21 +349,21 @@ while read commit; do
349
350
eval "$(set_ident AUTHOR <../commit)"
351
eval "$(set_ident COMMITTER <../commit)"
352
- eval "$filter_env"
352
+ eval "$filter_env" < /dev/null
353
354
if [ "$filter_tree" ]; then
355
git-checkout-index -f -u -a
356
# files that $commit removed are now still in the working tree;
357
# remove them, else they would be added again
358
git-ls-files -z --others | xargs -0 rm -f
359
- eval "$filter_tree"
359
+ eval "$filter_tree" < /dev/null
360
git-diff-index -r $commit | cut -f 2- | tr '\n' '\0' | \
361
xargs -0 git-update-index --add --replace --remove
362
git-ls-files -z --others | \
363
xargs -0 git-update-index --add --replace --remove
364
fi
365
366
- eval "$filter_index"
366
+ eval "$filter_index" < /dev/null
367
368
parentstr=
369
for parent in $(get_parents $commit); do