diff: --color-moved: rename "dimmed_zebra" to "dimmed-zebra"
[gitweb.git] / t / t5570-git-daemon.sh
index 359af3994af904e6cc5951a6c19fb9e7e9b82d4c..755b05a8ae9de940be8d9ad4c89473d836dcdf20 100755 (executable)
@@ -183,16 +183,33 @@ test_expect_success 'hostname cannot break out of directory' '
                git ls-remote "$GIT_DAEMON_URL/escape.git"
 '
 
-test_expect_success 'daemon log records hostnames' '
+test_expect_success 'daemon log records all attributes' '
        cat >expect <<-\EOF &&
-       Extended attributes (15 bytes) exist <host=localhost>
+       Extended attribute "host": localhost
+       Extended attribute "protocol": version=1
        EOF
        >daemon.log &&
        GIT_OVERRIDE_VIRTUAL_HOST=localhost \
-               git ls-remote "$GIT_DAEMON_URL/interp.git" &&
+               git -c protocol.version=1 \
+                       ls-remote "$GIT_DAEMON_URL/interp.git" &&
        grep -i extended.attribute daemon.log | cut -d" " -f2- >actual &&
        test_cmp expect actual
 '
 
+test_expect_success FAKENC 'hostname interpolation works after LF-stripping' '
+       {
+               printf "git-upload-pack /interp.git\n\0host=localhost" | packetize
+               printf "0000"
+       } >input &&
+       fake_nc "$GIT_DAEMON_HOST_PORT" <input >output &&
+       depacketize <output >output.raw &&
+
+       # just pick out the value of master, which avoids any protocol
+       # particulars
+       perl -lne "print \$1 if m{^(\\S+) refs/heads/master}" <output.raw >actual &&
+       git -C "$repo" rev-parse master >expect &&
+       test_cmp expect actual
+'
+
 stop_git_daemon
 test_done