]> asedeno.scripts.mit.edu Git - git.git/blobdiff - t/t5541-http-push.sh
t/lib-pager.sh: remove unnecessary '^' from 'expr' regular expression
[git.git] / t / t5541-http-push.sh
index 7873d9429ab86292c03f7704b5b0d919e1a7f029..17e1bdc5a81ce4802f5074ddb9c1996c68fc97be 100755 (executable)
@@ -38,7 +38,7 @@ 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
 EOF
-test_expect_failure 'no empty path components' '
+test_expect_success 'no empty path components' '
        # In the URL, add a trailing slash, and see if git appends yet another
        # slash.
        cd "$ROOT_PATH" &&
@@ -115,26 +115,8 @@ test_expect_success 'used receive-pack service' '
        test_cmp exp act
 '
 
-test_expect_success 'non-fast-forward push fails' '
-       cd "$ROOT_PATH"/test_repo_clone &&
-       git checkout master &&
-       echo "changed" > path2 &&
-       git commit -a -m path2 --amend &&
-
-       HEAD=$(git rev-parse --verify HEAD) &&
-       !(git push -v origin >output 2>&1) &&
-       (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
-        test $HEAD != $(git rev-parse --verify HEAD))
-'
-
-test_expect_success 'non-fast-forward push show ref status' '
-       grep "^ ! \[rejected\][ ]*master -> master (non-fast-forward)$" output
-'
-
-test_expect_success 'non-fast-forward push shows help message' '
-       grep "To prevent you from losing history, non-fast-forward updates were rejected" \
-               output
-'
+test_http_push_nonff "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git \
+       "$ROOT_PATH"/test_repo_clone master
 
 test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper' '
        # create a dissimilarly-named remote ref so that git is unable to match the