interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / t5812-proto-disable-http.sh

38 lines · 1107 bytes Raw Blame History
1#!/bin/sh
2
3test_description='test disabling of git-over-http in clone/fetch'
4
5. ./test-lib.sh
6. "$TEST_DIRECTORY/lib-proto-disable.sh"
7. "$TEST_DIRECTORY/lib-httpd.sh"
8start_httpd
9
10test_expect_success 'create git-accessible repo' '
11 bare="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
12 test_commit one &&
13 git --bare init "$bare" &&
14 git push "$bare" HEAD &&
15 git -C "$bare" config http.receivepack true
16'
17
18test_proto "smart http" http "$HTTPD_URL/smart/repo.git"
19
20test_expect_success 'http(s) transport respects GIT_ALLOW_PROTOCOL' '
21 test_must_fail env GIT_ALLOW_PROTOCOL=http:https \
22 GIT_SMART_HTTP=0 \
23 git clone "$HTTPD_URL/ftp-redir/repo.git" 2>stderr &&
24 test_grep -E "(ftp.*disabled|your curl version is too old)" stderr
25'
26
27test_expect_success 'curl limits redirects' '
28 test_must_fail git clone "$HTTPD_URL/loop-redir/smart/repo.git"
29'
30
31test_expect_success 'http can be limited to from-user' '
32 git -c protocol.http.allow=user \
33 clone "$HTTPD_URL/smart/repo.git" plain.git &&
34 test_must_fail git -c protocol.http.allow=user \
35 clone "$HTTPD_URL/smart-redir-perm/repo.git" redir.git
36'
37
38test_done