do_for_each_reflog(): return early on error
[gitweb.git] / t / t9802-git-p4-filetype.sh
index 3b358ef8d8fa485d9d43fe680b13f3961c5c79f8..21924dfd7db4fd5b8c0eb2c2823580ae33e73cc1 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-test_description='git-p4 p4 filetype tests'
+test_description='git p4 filetype tests'
 
 . ./lib-git-p4.sh
 
@@ -37,7 +37,7 @@ test_expect_success 'utf-16 file create' '
 
 test_expect_success 'utf-16 file test' '
        test_when_finished cleanup_git &&
-       "$GITP4" clone --dest="$git" //depot@all &&
+       git p4 clone --dest="$git" //depot@all &&
        (
                cd "$git" &&
 
@@ -84,7 +84,7 @@ test_expect_success 'keyword file test' '
        build_smush &&
        test_when_finished rm -f k_smush.py ko_smush.py &&
        test_when_finished cleanup_git &&
-       "$GITP4" clone --dest="$git" //depot@all &&
+       git p4 clone --dest="$git" //depot@all &&
        (
                cd "$git" &&
 
@@ -94,13 +94,44 @@ test_expect_success 'keyword file test' '
                "$PYTHON_PATH" "$TRASH_DIRECTORY/ko_smush.py" <"$cli/k-text-ko" >cli-k-text-ko-smush &&
                test_cmp cli-k-text-ko-smush k-text-ko &&
 
-               # utf16, even though p4 expands keywords, git-p4 does not
+               # utf16, even though p4 expands keywords, git p4 does not
                # try to undo that
                test_cmp "$cli/k-utf16-k" k-utf16-k &&
                test_cmp "$cli/k-utf16-ko" k-utf16-ko
        )
 '
 
+build_gendouble() {
+       cat >gendouble.py <<-\EOF
+       import sys
+       import struct
+       import array
+
+       s = array.array("c", '\0' * 26)
+       struct.pack_into(">L", s,  0, 0x00051607)  # AppleDouble
+       struct.pack_into(">L", s,  4, 0x00020000)  # version 2
+       s.tofile(sys.stdout)
+       EOF
+}
+
+test_expect_success 'ignore apple' '
+       test_when_finished rm -f gendouble.py &&
+       build_gendouble &&
+       (
+               cd "$cli" &&
+               test-genrandom apple 1024 >double.png &&
+               "$PYTHON_PATH" "$TRASH_DIRECTORY/gendouble.py" >%double.png &&
+               p4 add -t apple double.png &&
+               p4 submit -d appledouble
+       ) &&
+       test_when_finished cleanup_git &&
+       git p4 clone --dest="$git" //depot@all &&
+       (
+               cd "$git" &&
+               test ! -f double.png
+       )
+'
+
 test_expect_success 'kill p4d' '
        kill_p4d
 '