test: consolidate definition of $LF
authorJunio C Hamano <gitster@pobox.com>
Mon, 8 Aug 2011 18:51:00 +0000 (11:51 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Aug 2011 20:02:47 +0000 (13:02 -0700)
As we seem to need this variable that holds a single LF character
in many places, define it in test-lib.sh and let the test scripts
use it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1013-loose-object-format.sh
t/t1020-subdirectory.sh
t/t3902-quoted.sh
t/t7800-difftool.sh
t/test-lib.sh

index f45702c45c38dcf75e45051e1ba3842533551f0a..0a9cedd374012f6cdb5b2658639c4168a8cdf159 100755 (executable)
@@ -26,8 +26,6 @@ standard format, deflated with 4KB window size: Agit/JGit on Android
 '
 
 . ./test-lib.sh
-LF='
-'
 
 assert_blob_equals() {
        printf "%s" "$2" >expected &&
index f6a44c9ee07329c8909662d2a807acf0dd6a8e43..7e7996122850500de57e2740731b15a0703b03a4 100755 (executable)
@@ -17,8 +17,6 @@ test_expect_success setup '
        cp one original.one &&
        cp dir/two original.two
 '
-LF='
-'
 
 test_expect_success 'update-index and ls-files' '
        git update-index --add one &&
index da82b655b3b33520b2c39d3992bc40368bf652be..534ee08a44b9d8501b234f228302e9a266d67f8c 100755 (executable)
@@ -10,8 +10,6 @@ test_description='quoted output'
 FN='濱野'
 GN='純'
 HT='   '
-LF='
-'
 DQ='"'
 
 echo foo 2>/dev/null > "Name and an${HT}HT"
index 4048d106d4936ae1eef2ca3788a147e659bda65d..395adfc8a946bfd67b8a61cbef1366b78d9d855e 100755 (executable)
@@ -10,9 +10,6 @@ Testing basic diff tool invocation
 
 . ./test-lib.sh
 
-LF='
-'
-
 remove_config_vars()
 {
        # Unset all config variables used by git-difftool
index df25f1792923a65aab2c4ce88e7b528effb381f5..9d746b051cfa1d936d651210ffe444ea79603e39 100644 (file)
@@ -92,6 +92,10 @@ _x40="$_x05$_x05$_x05$_x05$_x05$_x05$_x05$_x05"
 # Zero SHA-1
 _z40=0000000000000000000000000000000000000000
 
+# Line feed
+LF='
+'
+
 # Each test should start with something like this, after copyright notices:
 #
 # test_description='Description of this test...