daemon: fix off-by-one in logging extended attributes
[gitweb.git] / t / t5570-git-daemon.sh
index f92ebc5cd587b2e83f45d75907ffcdc8be783a01..359af3994af904e6cc5951a6c19fb9e7e9b82d4c 100755 (executable)
@@ -183,5 +183,16 @@ test_expect_success 'hostname cannot break out of directory' '
                git ls-remote "$GIT_DAEMON_URL/escape.git"
 '
 
+test_expect_success 'daemon log records hostnames' '
+       cat >expect <<-\EOF &&
+       Extended attributes (15 bytes) exist <host=localhost>
+       EOF
+       >daemon.log &&
+       GIT_OVERRIDE_VIRTUAL_HOST=localhost \
+               git ls-remote "$GIT_DAEMON_URL/interp.git" &&
+       grep -i extended.attribute daemon.log | cut -d" " -f2- >actual &&
+       test_cmp expect actual
+'
+
 stop_git_daemon
 test_done