]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5540-http-push-webdav.sh
Merge branch 'bc/http-push-flagsfix'
[thirdparty/git.git] / t / t5540-http-push-webdav.sh
index d476c335098eef1e61aa8c7b8951fe760e8d13c1..450321fddbbf6aeb90ec8a257fd657d28a32cbf9 100755 (executable)
@@ -126,6 +126,22 @@ test_expect_success 'create and delete remote branch' '
        test_must_fail git show-ref --verify refs/remotes/origin/dev
 '
 
+test_expect_success 'non-force push fails if not up to date' '
+       git init --bare "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo_conflict.git &&
+       git -C "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo_conflict.git update-server-info &&
+       git clone $HTTPD_URL/dumb/test_repo_conflict.git "$ROOT_PATH"/c1 &&
+       git clone $HTTPD_URL/dumb/test_repo_conflict.git "$ROOT_PATH"/c2 &&
+       test_commit -C "$ROOT_PATH/c1" path1 &&
+       git -C "$ROOT_PATH/c1" push origin HEAD &&
+       git -C "$ROOT_PATH/c2" pull &&
+       test_commit -C "$ROOT_PATH/c1" path2 &&
+       git -C "$ROOT_PATH/c1" push origin HEAD &&
+       test_commit -C "$ROOT_PATH/c2" path3 &&
+       git -C "$ROOT_PATH/c1" log --graph --all &&
+       git -C "$ROOT_PATH/c2" log --graph --all &&
+       test_must_fail git -C "$ROOT_PATH/c2" push origin HEAD
+'
+
 test_expect_success 'MKCOL sends directory names with trailing slashes' '
 
        ! grep "\"MKCOL.*[^/] HTTP/[^ ]*\"" < "$HTTPD_ROOT_PATH"/access.log