Merge branch 'mz/pull-rebase-rebased'
[gitweb.git] / t / t5551-http-fetch.sh
index eb0c03932318f12ddc2dc6da187a38a411c8ce37..26d355725f5e8d317c71cb466ea091ec8f741d63 100755 (executable)
@@ -4,7 +4,7 @@ test_description='test smart fetching over http via http-backend'
 . ./test-lib.sh
 
 if test -n "$NO_CURL"; then
-       say 'skipping test, git built without http support'
+       skip_all='skipping test, git built without http support'
        test_done
 fi
 
@@ -31,23 +31,19 @@ cat >exp <<EOF
 > GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1
 > Accept: */*
 > Pragma: no-cache
-
 < HTTP/1.1 200 OK
 < Pragma: no-cache
 < Cache-Control: no-cache, max-age=0, must-revalidate
 < Content-Type: application/x-git-upload-pack-advertisement
-< 
 > POST /smart/repo.git/git-upload-pack HTTP/1.1
 > Accept-Encoding: deflate, gzip
 > Content-Type: application/x-git-upload-pack-request
-> Accept: application/x-git-upload-pack-response
+> Accept: application/x-git-upload-pack-result
 > Content-Length: xxx
-
 < HTTP/1.1 200 OK
 < Pragma: no-cache
 < Cache-Control: no-cache, max-age=0, must-revalidate
 < Content-Type: application/x-git-upload-pack-result
-< 
 EOF
 test_expect_success 'clone http repository' '
        GIT_CURL_VERBOSE=1 git clone --quiet $HTTPD_URL/smart/repo.git clone 2>err &&
@@ -56,6 +52,8 @@ test_expect_success 'clone http repository' '
        sed -e "
                s/Q\$//
                /^[*] /d
+               /^$/d
+               /^< $/d
 
                /^[^><]/{
                        s/^/> /
@@ -63,7 +61,12 @@ test_expect_success 'clone http repository' '
 
                /^> User-Agent: /d
                /^> Host: /d
+               /^> POST /,$ {
+                       /^> Accept: [*]\\/[*]/d
+               }
                s/^> Content-Length: .*/> Content-Length: xxx/
+               /^> 00..want /d
+               /^> 00.*done/d
 
                /^< Server: /d
                /^< Expires: /d
@@ -98,5 +101,13 @@ test_expect_success 'used upload-pack service' '
        test_cmp exp act
 '
 
+test_expect_success 'follow redirects (301)' '
+       git clone $HTTPD_URL/smart-redir-perm/repo.git --quiet repo-p
+'
+
+test_expect_success 'follow redirects (302)' '
+       git clone $HTTPD_URL/smart-redir-temp/repo.git --quiet repo-t
+'
+
 stop_httpd
 test_done