summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2011-05-21 21:25:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-05-26 23:47:15 (GMT)
commitdd555d8bed255c7949620e6551ea5afd2213bae0 (patch)
treed1eeeee66bc0d116d4f6db9739dc5f0252b8f250
parenta265a7f95e6e3ebd81df0c6813b17d61a5ab890a (diff)
downloadgit-dd555d8bed255c7949620e6551ea5afd2213bae0.zip
git-dd555d8bed255c7949620e6551ea5afd2213bae0.tar.gz
git-dd555d8bed255c7949620e6551ea5afd2213bae0.tar.bz2
t0021-conversion.sh: fix NoTerminatingSymbolAtEOF test
The last line of the test file "expanded-keywords" ended in a newline, which is a valid terminator for ident. Use printf instead of echo to omit it and thus really test if a file that ends unexpectedly in the middle of an ident tag is handled properly. Also take the oppertunity to calculate the expected ID dynamically instead of hardcoding it into the test script. This should make future changes easier. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t0021-conversion.sh23
1 files changed, 12 insertions, 11 deletions
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index 9078b84..275421e 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -66,25 +66,26 @@ test_expect_success expanded_in_repo '
echo "\$Id:NoSpaceAtEitherEnd\$"
echo "\$Id: NoTerminatingSymbol"
echo "\$Id: Foreign Commit With Spaces \$"
- echo "\$Id: NoTerminatingSymbolAtEOF"
+ printf "\$Id: NoTerminatingSymbolAtEOF"
} > expanded-keywords &&
+ git add expanded-keywords &&
+ git commit -m "File with keywords expanded" &&
+ id=$(git rev-parse --verify :expanded-keywords) &&
+
{
echo "File with expanded keywords"
- echo "\$Id: fd0478f5f1486f3d5177d4c3f6eb2765e8fc56b9 \$"
- echo "\$Id: fd0478f5f1486f3d5177d4c3f6eb2765e8fc56b9 \$"
- echo "\$Id: fd0478f5f1486f3d5177d4c3f6eb2765e8fc56b9 \$"
- echo "\$Id: fd0478f5f1486f3d5177d4c3f6eb2765e8fc56b9 \$"
- echo "\$Id: fd0478f5f1486f3d5177d4c3f6eb2765e8fc56b9 \$"
- echo "\$Id: fd0478f5f1486f3d5177d4c3f6eb2765e8fc56b9 \$"
+ echo "\$Id: $id \$"
+ echo "\$Id: $id \$"
+ echo "\$Id: $id \$"
+ echo "\$Id: $id \$"
+ echo "\$Id: $id \$"
+ echo "\$Id: $id \$"
echo "\$Id: NoTerminatingSymbol"
echo "\$Id: Foreign Commit With Spaces \$"
- echo "\$Id: NoTerminatingSymbolAtEOF"
+ printf "\$Id: NoTerminatingSymbolAtEOF"
} > expected-output &&
- git add expanded-keywords &&
- git commit -m "File with keywords expanded" &&
-
echo "expanded-keywords ident" >> .gitattributes &&
rm -f expanded-keywords &&