Merge branch 'js/difftool-no-index'
[gitweb.git] / t / t5541-http-push-smart.sh
index a2af693068fa455838c97df1fefe38bd630ceb2e..8ef8763e063cf30da8af4a80079458cf8e18c56d 100755 (executable)
@@ -38,25 +38,21 @@ GET  /smart/test_repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
 POST /smart/test_repo.git/git-upload-pack HTTP/1.1 200
 EOF
 test_expect_success 'no empty path components' '
+       # Clear the log, so that it does not affect the "used receive-pack
+       # service" test which reads the log too.
+       test_when_finished ">\"\$HTTPD_ROOT_PATH\"/access.log" &&
+
        # In the URL, add a trailing slash, and see if git appends yet another
        # slash.
        cd "$ROOT_PATH" &&
        git clone $HTTPD_URL/smart/test_repo.git/ test_repo_clone &&
 
-       sed -e "
-               s/^.* \"//
-               s/\"//
-               s/ [1-9][0-9]*\$//
-               s/^GET /GET  /
-       " >act <"$HTTPD_ROOT_PATH"/access.log &&
-
-       # Clear the log, so that it does not affect the "used receive-pack
-       # service" test which reads the log too.
-       #
-       # We do this before the actual comparison to ensure the log is cleared.
-       echo > "$HTTPD_ROOT_PATH"/access.log &&
-
-       test_cmp exp act
+       # NEEDSWORK: If the overspecification of the expected result is reduced, we
+       # might be able to run this test in all protocol versions.
+       if test -z "$GIT_TEST_PROTOCOL_VERSION"
+       then
+               check_access_log exp
+       fi
 '
 
 test_expect_success 'clone remote repository' '
@@ -124,7 +120,6 @@ test_expect_success 'rejected update prints status' '
 rm -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/hooks/update"
 
 cat >exp <<EOF
-
 GET  /smart/test_repo.git/info/refs?service=git-upload-pack HTTP/1.1 200
 POST /smart/test_repo.git/git-upload-pack HTTP/1.1 200
 GET  /smart/test_repo.git/info/refs?service=git-receive-pack HTTP/1.1 200
@@ -138,13 +133,12 @@ GET  /smart/test_repo.git/info/refs?service=git-receive-pack HTTP/1.1 200
 POST /smart/test_repo.git/git-receive-pack HTTP/1.1 200
 EOF
 test_expect_success 'used receive-pack service' '
-       sed -e "
-               s/^.* \"//
-               s/\"//
-               s/ [1-9][0-9]*\$//
-               s/^GET /GET  /
-       " >act <"$HTTPD_ROOT_PATH"/access.log &&
-       test_cmp exp act
+       # NEEDSWORK: If the overspecification of the expected result is reduced, we
+       # might be able to run this test in all protocol versions.
+       if test -z "$GIT_TEST_PROTOCOL_VERSION"
+       then
+               check_access_log exp
+       fi
 '
 
 test_http_push_nonff "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git \
@@ -226,7 +220,7 @@ test_expect_success TTY 'push --quiet silences status and progress' '
        cd "$ROOT_PATH"/test_repo_clone &&
        test_commit quiet &&
        test_terminal git push --quiet >output 2>&1 &&
-       test_cmp /dev/null output
+       test_must_be_empty output
 '
 
 test_expect_success TTY 'push --no-progress silences progress but not status' '
@@ -389,5 +383,4 @@ test_expect_success 'colorize errors/hints' '
        test_i18ngrep ! "^hint: " decoded
 '
 
-stop_httpd
 test_done