t5407: Fix line-ending dependency in post-rewrite.args

On msysGit creating the post-rewrite.args file using 'echo' has different
line endings from the expected comparison. Using perl normalizes the line
endings for each generated file.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
This commit is contained in:
Pat Thoyts 2011-05-01 14:47:09 +01:00 committed by Johannes Schindelin
parent 39ad164d02
commit 6ae3abf159

View file

@ -20,9 +20,13 @@ test_expect_success 'setup' '
mkdir .git/hooks
cat >.git/hooks/post-rewrite <<EOF
#!/bin/sh
echo \$@ > "$TRASH_DIRECTORY"/post-rewrite.args
cat > "$TRASH_DIRECTORY"/post-rewrite.data
#!/usr/bin/perl
open (AR, ">$TRASH_DIRECTORY/post-rewrite.args");
print AR \$_,"\n" foreach @ARGV;
open (DAT, ">$TRASH_DIRECTORY/post-rewrite.data");
while(<STDIN>) {
print DAT;
}
EOF
chmod u+x .git/hooks/post-rewrite