parse_color: support 24-bit RGB values
[gitweb.git] / t / t4119-apply-config.sh
index 65571e05496eb3710cb89d93f5b95d34b77d1998..a9a05838119c85bc017f1404b134d393029843b2 100755 (executable)
@@ -19,12 +19,12 @@ test_expect_success setup '
 '
 
 # Also handcraft GNU diff output; note this has trailing whitespace.
-cat >gpatch.file <<\EOF &&
+tr '_' ' ' >gpatch.file <<\EOF &&
 --- file1      2007-02-21 01:04:24.000000000 -0800
 +++ file1+     2007-02-21 01:07:44.000000000 -0800
 @@ -1 +1 @@
 -A
-+B
++B_
 EOF
 
 sed -e 's|file1|sub/&|' gpatch.file >gpatch-sub.file &&
@@ -68,12 +68,12 @@ test_expect_success 'apply --whitespace=strip from config' '
        check_result sub/file1
 '
 
-D=`pwd`
+D=$(pwd)
 
 test_expect_success 'apply --whitespace=strip in subdir' '
 
        cd "$D" &&
-       git config --unset-all apply.whitespace
+       git config --unset-all apply.whitespace &&
        rm -f sub/file1 &&
        cp saved sub/file1 &&
        git update-index --refresh &&
@@ -159,4 +159,21 @@ test_expect_success 'same but with traditional patch input of depth 2' '
        check_result sub/file1
 '
 
+test_expect_success 'in subdir with traditional patch input' '
+       cd "$D" &&
+       git config apply.whitespace strip &&
+       cat >.gitattributes <<-EOF &&
+       /* whitespace=blank-at-eol
+       sub/* whitespace=-blank-at-eol
+       EOF
+       rm -f sub/file1 &&
+       cp saved sub/file1 &&
+       git update-index --refresh &&
+
+       cd sub &&
+       git apply ../gpatch.file &&
+       echo "B " >expect &&
+       test_cmp expect file1
+'
+
 test_done