Merge branch 'jk/unused-params-final-batch'
[gitweb.git] / t / t1020-subdirectory.sh
index 8e22b03cdd132bd54f9db44d362c15d129415651..c2df75e4953d897acee5cf590b9c358e5a0b77c2 100755 (executable)
@@ -141,14 +141,14 @@ test_expect_success 'GIT_PREFIX for !alias' '
 test_expect_success 'GIT_PREFIX for built-ins' '
        # Use GIT_EXTERNAL_DIFF to test that the "diff" built-in
        # receives the GIT_PREFIX variable.
-       printf "dir/" >expect &&
-       printf "#!/bin/sh\n" >diff &&
-       printf "printf \"\$GIT_PREFIX\"" >>diff &&
-       chmod +x diff &&
+       echo "dir/" >expect &&
+       write_script diff <<-\EOF &&
+       printf "%s\n" "$GIT_PREFIX"
+       EOF
        (
                cd dir &&
-               printf "change" >two &&
-               GIT_EXTERNAL_DIFF=./diff git diff >../actual
+               echo "change" >two &&
+               GIT_EXTERNAL_DIFF=./diff git diff >../actual &&
                git checkout -- two
        ) &&
        test_cmp expect actual