(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: { (SQ <"test WebDAV http-push\n"> <"\n"> <"This test runs various sanity checks on http-push."> ) } spids: [13] ) ] spids: [13] ) (C {(.)} {(./test-lib.sh)}) (If arms: [ (if_arm cond: [ (AndOr children: [ (SimpleCommand words: [{(git)} {(http-push)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [32] ) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[36]) ] ) (C {(Lit_Other "[")} {($ VSub_QMark "$?")} {(-eq)} {(128)} {(Lit_Other "]")}) ] op_id: Op_DPipe ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:skip_all) op: Equal rhs: {(DQ ("skipping test, USE_CURL_MULTI is not defined"))} spids: [54] ) ] spids: [54] ) (C {(test_done)}) ] spids: [-1 51] ) ] spids: [-1 62] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:LIB_HTTPD_DAV) op:Equal rhs:{(t)} spids:[65])] spids: [65] ) (C {(.)} {(DQ ($ VSub_Name "$TEST_DIRECTORY")) (/lib-httpd.sh)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ROOT_PATH) op: Equal rhs: {(DQ ($ VSub_Name "$PWD"))} spids: [75] ) ] spids: [75] ) (C {(start_httpd)}) (C {(test_expect_success)} {(SQ <"setup remote repository">)} { (SQ <"\n"> <"\tcd \"$ROOT_PATH\" &&\n"> <"\tmkdir test_repo &&\n"> <"\tcd test_repo &&\n"> <"\tgit init &&\n"> <"\t: >path1 &&\n"> <"\tgit add path1 &&\n"> <"\ttest_tick &&\n"> <"\tgit commit -m initial &&\n"> <"\tcd - &&\n"> <"\tgit clone --bare test_repo test_repo.git &&\n"> <"\tcd test_repo.git &&\n"> <"\tgit --bare update-server-info &&\n"> <"\tmv hooks/post-update.sample hooks/post-update &&\n"> <"\tORIG_HEAD=$(git rev-parse --verify HEAD) &&\n"> <"\tcd - &&\n"> <"\tmv test_repo.git \"$HTTPD_DOCUMENT_ROOT_PATH\"\n"> ) } ) (C {(test_expect_success)} {(SQ <"create password-protected repository">)} { (SQ <"\n"> <"\tmkdir -p \"$HTTPD_DOCUMENT_ROOT_PATH/auth/dumb\" &&\n"> <"\tcp -Rf \"$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git\" \\\n"> <"\t \"$HTTPD_DOCUMENT_ROOT_PATH/auth/dumb/test_repo.git\"\n"> ) } ) (C {(setup_askpass_helper)}) (C {(test_expect_success)} {(SQ <"clone remote repository">)} { (SQ <"\n"> <"\tcd \"$ROOT_PATH\" &&\n"> <"\tgit clone $HTTPD_URL/dumb/test_repo.git test_repo_clone\n"> ) } ) (C {(test_expect_success)} {(SQ <"push to remote repository with packed refs">)} { (SQ <"\n"> <"\tcd \"$ROOT_PATH\"/test_repo_clone &&\n"> <"\t: >path2 &&\n"> <"\tgit add path2 &&\n"> <"\ttest_tick &&\n"> <"\tgit commit -m path2 &&\n"> <"\tHEAD=$(git rev-parse --verify HEAD) &&\n"> <"\tgit push &&\n"> <"\t(cd \"$HTTPD_DOCUMENT_ROOT_PATH\"/test_repo.git &&\n"> <"\t test $HEAD = $(git rev-parse --verify HEAD))\n"> ) } ) (C {(test_expect_success)} {(SQ <"push already up-to-date">)} {(SQ <"\n"> <"\tgit push\n">)}) (C {(test_expect_success)} {(SQ <"push to remote repository with unpacked refs">)} { (SQ <"\n"> <"\t(cd \"$HTTPD_DOCUMENT_ROOT_PATH\"/test_repo.git &&\n"> <"\t rm packed-refs &&\n"> <"\t git update-ref refs/heads/master $ORIG_HEAD &&\n"> <"\t git --bare update-server-info) &&\n"> <"\tgit push &&\n"> <"\t(cd \"$HTTPD_DOCUMENT_ROOT_PATH\"/test_repo.git &&\n"> <"\t test $HEAD = $(git rev-parse --verify HEAD))\n"> ) } ) (C {(test_expect_success)} {(SQ <"http-push fetches unpacked objects">)} { (SQ <"\n"> <"\tcp -R \"$HTTPD_DOCUMENT_ROOT_PATH\"/test_repo.git \\\n"> <"\t\t\"$HTTPD_DOCUMENT_ROOT_PATH\"/test_repo_unpacked.git &&\n"> <"\n"> <"\tgit clone $HTTPD_URL/dumb/test_repo_unpacked.git \\\n"> <"\t\t\"$ROOT_PATH\"/fetch_unpacked &&\n"> <"\n"> <"\t# By reset, we force git to retrieve the object\n"> <"\t(cd \"$ROOT_PATH\"/fetch_unpacked &&\n"> <"\t git reset --hard HEAD^ &&\n"> <"\t git remote rm origin &&\n"> <"\t git reflog expire --expire=0 --all &&\n"> <"\t git prune &&\n"> <"\t git push -f -v $HTTPD_URL/dumb/test_repo_unpacked.git master)\n"> ) } ) (C {(test_expect_success)} {(SQ <"http-push fetches packed objects">)} { (SQ <"\n"> <"\tcp -R \"$HTTPD_DOCUMENT_ROOT_PATH\"/test_repo.git \\\n"> <"\t\t\"$HTTPD_DOCUMENT_ROOT_PATH\"/test_repo_packed.git &&\n"> <"\n"> <"\tgit clone $HTTPD_URL/dumb/test_repo_packed.git \\\n"> <"\t\t\"$ROOT_PATH\"/test_repo_clone_packed &&\n"> <"\n"> <"\t(cd \"$HTTPD_DOCUMENT_ROOT_PATH\"/test_repo_packed.git &&\n"> <"\t git --bare repack &&\n"> <"\t git --bare prune-packed) &&\n"> <"\n"> <"\t# By reset, we force git to retrieve the packed object\n"> <"\t(cd \"$ROOT_PATH\"/test_repo_clone_packed &&\n"> <"\t git reset --hard HEAD^ &&\n"> <"\t git remote remove origin &&\n"> <"\t git reflog expire --expire=0 --all &&\n"> <"\t git prune &&\n"> <"\t git push -f -v $HTTPD_URL/dumb/test_repo_packed.git master)\n"> ) } ) (C {(test_expect_success)} {(SQ <"create and delete remote branch">)} { (SQ <"\n"> <"\tcd \"$ROOT_PATH\"/test_repo_clone &&\n"> <"\tgit checkout -b dev &&\n"> <"\t: >path3 &&\n"> <"\tgit add path3 &&\n"> <"\ttest_tick &&\n"> <"\tgit commit -m dev &&\n"> <"\tgit push origin dev &&\n"> <"\tgit push origin :dev &&\n"> <"\ttest_must_fail git show-ref --verify refs/remotes/origin/dev\n"> ) } ) (C {(test_expect_success)} {(SQ <"MKCOL sends directory names with trailing slashes">)} { (SQ <"\n"> <"\n"> <"\t! grep \"\\\"MKCOL.*[^/] HTTP/[^ ]*\\\"\" < \"$HTTPD_ROOT_PATH\"/access.log\n"> <"\n"> ) } ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:x1) op:Equal rhs:{(DQ ("[0-9a-f]"))} spids:[276])] spids: [276] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:x2) op: Equal rhs: {(DQ ($ VSub_Name "$x1") ($ VSub_Name "$x1"))} spids: [281] ) ] spids: [281] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:x5) op: Equal rhs: { (DQ ($ VSub_Name "$x1") ($ VSub_Name "$x1") ($ VSub_Name "$x1") ($ VSub_Name "$x1") ($ VSub_Name "$x1") ) } spids: [287] ) ] spids: [287] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:x38) op: Equal rhs: { (DQ ($ VSub_Name "$x5") ($ VSub_Name "$x5") ($ VSub_Name "$x5") ($ VSub_Name "$x5") ($ VSub_Name "$x5") ($ VSub_Name "$x5") ($ VSub_Name "$x5") ($ VSub_Name "$x1") ($ VSub_Name "$x1") ($ VSub_Name "$x1") ) } spids: [296] ) ] spids: [296] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:x40) op: Equal rhs: {(DQ ($ VSub_Name "$x38") ($ VSub_Name "$x2"))} spids: [310] ) ] spids: [310] ) (C {(test_expect_success)} {(SQ <"PUT and MOVE sends object to URLs with SHA-1 hash suffix">)} { (SQ <"\n"> <"\tsed \\\n"> <"\t\t-e \"s/PUT /OP /\" \\\n"> <"\t\t-e \"s/MOVE /OP /\" \\\n"> <"\t -e \"s|/objects/$x2/${x38}_$x40|WANTED_PATH_REQUEST|\" \\\n"> <"\t\t\"$HTTPD_ROOT_PATH\"/access.log |\n"> <"\tgrep -e \"\\\"OP .*WANTED_PATH_REQUEST HTTP/[.0-9]*\\\" 20[0-9] \"\n"> <"\n"> ) } ) (C {(test_http_push_nonff)} {(DQ ($ VSub_Name "$HTTPD_DOCUMENT_ROOT_PATH")) (/test_repo.git)} {(DQ ($ VSub_Name "$ROOT_PATH")) (/test_repo_clone)} {(master)} ) (C {(test_expect_success)} {(SQ <"push to password-protected repository (user in URL)">)} { (SQ <"\n"> <"\ttest_commit pw-user &&\n"> <"\tset_askpass user@host pass@host &&\n"> <"\tgit push \"$HTTPD_URL_USER/auth/dumb/test_repo.git\" HEAD &&\n"> <"\tgit rev-parse --verify HEAD >expect &&\n"> <"\tgit --git-dir=\"$HTTPD_DOCUMENT_ROOT_PATH/auth/dumb/test_repo.git\" \\\n"> <"\t\trev-parse --verify HEAD >actual &&\n"> <"\ttest_cmp expect actual\n"> ) } ) (C {(test_expect_failure)} {(SQ <"user was prompted only once for password">)} {(SQ <"\n"> <"\texpect_askpass pass user@host\n">)} ) (C {(test_expect_failure)} {(SQ <"push to password-protected repository (no user in URL)">)} { (SQ <"\n"> <"\ttest_commit pw-nouser &&\n"> <"\tset_askpass user@host pass@host &&\n"> <"\tgit push \"$HTTPD_URL/auth/dumb/test_repo.git\" HEAD &&\n"> <"\texpect_askpass both user@host &&\n"> <"\tgit rev-parse --verify HEAD >expect &&\n"> <"\tgit --git-dir=\"$HTTPD_DOCUMENT_ROOT_PATH/auth/dumb/test_repo.git\" \\\n"> <"\t\trev-parse --verify HEAD >actual &&\n"> <"\ttest_cmp expect actual\n"> ) } ) (C {(stop_httpd)}) (C {(test_done)}) ] )