format-patch: respect --stat in cover letter's diffstat
[gitweb.git] / t / t5615-alternate-env.sh
index eec4137ca5b392743e29068f4fffae1ffb78d812..b4905b822c07048ddfbc43cfd39265bd2116f197 100755 (executable)
@@ -7,9 +7,9 @@ check_obj () {
        alt=$1; shift
        while read obj expect
        do
-               echo "$obj" >&3 &&
-               echo "$obj $expect" >&4
-       done 3>input 4>expect &&
+               echo "$obj" >&5 &&
+               echo "$obj $expect" >&6
+       done 5>input 6>expect &&
        GIT_ALTERNATE_OBJECT_DIRECTORIES=$alt \
                git "$@" cat-file --batch-check='%(objectname) %(objecttype)' \
                <input >actual &&
@@ -68,4 +68,23 @@ test_expect_success 'access alternate via relative path (subdir)' '
        EOF
 '
 
+# set variables outside test to avoid quote insanity; the \057 is '/',
+# which doesn't need quoting, but just confirms that de-quoting
+# is working.
+quoted='"one.git\057objects"'
+unquoted='two.git/objects'
+test_expect_success 'mix of quoted and unquoted alternates' '
+       check_obj "$quoted:$unquoted" <<-EOF
+       $one blob
+       $two blob
+       EOF
+'
+
+test_expect_success !MINGW 'broken quoting falls back to interpreting raw' '
+       mv one.git \"one.git &&
+       check_obj \"one.git/objects <<-EOF
+       $one blob
+       EOF
+'
+
 test_done