Round-down years in "years+months" relative date view
[git/dscho.git] / t / t5540-http-push.sh
blob10e5fd0d5a5c38eaa102d88e607f2585e1157526
1 #!/bin/sh
3 # Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>
6 test_description='test http-push
8 This test runs various sanity checks on http-push.'
10 . ./test-lib.sh
12 ROOT_PATH="$PWD"
13 LIB_HTTPD_DAV=t
15 if git http-push > /dev/null 2>&1 || [ $? -eq 128 ]
16 then
17 say "skipping test, USE_CURL_MULTI is not defined"
18 test_done
19 exit
22 . "$TEST_DIRECTORY"/lib-httpd.sh
24 if ! start_httpd >&3 2>&4
25 then
26 say "skipping test, web server setup failed"
27 test_done
28 exit
31 test_expect_success 'setup remote repository' '
32 cd "$ROOT_PATH" &&
33 mkdir test_repo &&
34 cd test_repo &&
35 git init &&
36 : >path1 &&
37 git add path1 &&
38 test_tick &&
39 git commit -m initial &&
40 cd - &&
41 git clone --bare test_repo test_repo.git &&
42 cd test_repo.git &&
43 git --bare update-server-info &&
44 mv hooks/post-update.sample hooks/post-update &&
45 cd - &&
46 mv test_repo.git "$HTTPD_DOCUMENT_ROOT_PATH"
49 test_expect_success 'clone remote repository' '
50 cd "$ROOT_PATH" &&
51 git clone $HTTPD_URL/test_repo.git test_repo_clone
54 test_expect_failure 'push to remote repository with packed refs' '
55 cd "$ROOT_PATH"/test_repo_clone &&
56 : >path2 &&
57 git add path2 &&
58 test_tick &&
59 git commit -m path2 &&
60 HEAD=$(git rev-parse --verify HEAD) &&
61 git push &&
62 (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
63 test $HEAD = $(git rev-parse --verify HEAD))
66 test_expect_success ' push to remote repository with unpacked refs' '
67 (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
68 rm packed-refs &&
69 git update-ref refs/heads/master \
70 0c973ae9bd51902a28466f3850b543fa66a6aaf4) &&
71 git push &&
72 (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
73 test $HEAD = $(git rev-parse --verify HEAD))
76 test_expect_success 'create and delete remote branch' '
77 cd "$ROOT_PATH"/test_repo_clone &&
78 git checkout -b dev &&
79 : >path3 &&
80 git add path3 &&
81 test_tick &&
82 git commit -m dev &&
83 git push origin dev &&
84 git fetch &&
85 git push origin :dev &&
86 git branch -d -r origin/dev &&
87 git fetch &&
88 test_must_fail git show-ref --verify refs/remotes/origin/dev
91 test_expect_success 'MKCOL sends directory names with trailing slashes' '
93 ! grep "\"MKCOL.*[^/] HTTP/[^ ]*\"" < "$HTTPD_ROOT_PATH"/access.log
97 x1="[0-9a-f]"
98 x2="$x1$x1"
99 x5="$x1$x1$x1$x1$x1"
100 x38="$x5$x5$x5$x5$x5$x5$x5$x1$x1$x1"
101 x40="$x38$x2"
103 test_expect_success 'PUT and MOVE sends object to URLs with SHA-1 hash suffix' '
104 sed -e "s/PUT /OP /" -e "s/MOVE /OP /" "$HTTPD_ROOT_PATH"/access.log |
105 grep -e "\"OP .*/objects/$x2/${x38}_$x40 HTTP/[.0-9]*\" 20[0-9] "
109 stop_httpd
111 test_done