connect.c: mark more strings for translation
[gitweb.git] / t / t5702-protocol-v2.sh
index 25bf046b36c94856c3c3b2487d7d26e4ecad2689..a4fe6508bdd73784758b2ea80ab81752e15c01b3 100755 (executable)
@@ -154,6 +154,22 @@ test_expect_success 'ref advertisment is filtered with ls-remote using protocol
        test_cmp actual expect
 '
 
+test_expect_success 'server-options are sent when using ls-remote' '
+       test_when_finished "rm -f log" &&
+
+       GIT_TRACE_PACKET="$(pwd)/log" git -c protocol.version=2 \
+               ls-remote -o hello -o world "file://$(pwd)/file_parent" master >actual &&
+
+       cat >expect <<-EOF &&
+       $(git -C file_parent rev-parse refs/heads/master)$(printf "\t")refs/heads/master
+       EOF
+
+       test_cmp actual expect &&
+       grep "server-option=hello" log &&
+       grep "server-option=world" log
+'
+
+
 test_expect_success 'clone with file:// using protocol v2' '
        test_when_finished "rm -f log" &&
 
@@ -201,6 +217,22 @@ test_expect_success 'ref advertisment is filtered during fetch using protocol v2
        ! grep "refs/tags/three" log
 '
 
+test_expect_success 'server-options are sent when fetching' '
+       test_when_finished "rm -f log" &&
+
+       test_commit -C file_parent four &&
+
+       GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \
+               fetch -o hello -o world origin master &&
+
+       git -C file_child log -1 --format=%s origin/master >actual &&
+       git -C file_parent log -1 --format=%s >expect &&
+       test_cmp expect actual &&
+
+       grep "server-option=hello" log &&
+       grep "server-option=world" log
+'
+
 test_expect_success 'upload-pack respects config using protocol v2' '
        git init server &&
        write_script server/.git/hook <<-\EOF &&
@@ -313,6 +345,20 @@ test_expect_success 'even with handcrafted request, filter does not work if not
        git -C server serve --stateless-rpc <in >/dev/null
 '
 
+test_expect_success 'default refspec is used to filter ref when fetchcing' '
+       test_when_finished "rm -f log" &&
+
+       GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \
+               fetch origin &&
+
+       git -C file_child log -1 --format=%s three >actual &&
+       git -C file_parent log -1 --format=%s three >expect &&
+       test_cmp expect actual &&
+
+       grep "ref-prefix refs/heads/" log &&
+       grep "ref-prefix refs/tags/" log
+'
+
 # Test protocol v2 with 'http://' transport
 #
 . "$TEST_DIRECTORY"/lib-httpd.sh