From f4609b896fac842433bd495c166d5987852a6a73 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 21 Nov 2020 19:20:35 +0100 Subject: merge(3p/git): Merge git subtree at v2.29.2 This also bumps the stable nixpkgs to 20.09 as of 2020-11-21, because there is some breakage in the git build related to the netrc credentials helper which someone has taken care of in nixpkgs. The stable channel is not used for anything other than git, so this should be fine. Change-Id: I3575a19dab09e1e9556cf8231d717de9890484fb --- third_party/git/t/t5540-http-push-webdav.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'third_party/git/t/t5540-http-push-webdav.sh') diff --git a/third_party/git/t/t5540-http-push-webdav.sh b/third_party/git/t/t5540-http-push-webdav.sh index a094fd5e7133..450321fddbbf 100755 --- a/third_party/git/t/t5540-http-push-webdav.sh +++ b/third_party/git/t/t5540-http-push-webdav.sh @@ -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 @@ -134,15 +150,13 @@ test_expect_success 'MKCOL sends directory names with trailing slashes' ' x1="[0-9a-f]" x2="$x1$x1" -x5="$x1$x1$x1$x1$x1" -x38="$x5$x5$x5$x5$x5$x5$x5$x1$x1$x1" -x40="$x38$x2" +xtrunc=$(echo $OID_REGEX | sed -e "s/\[0-9a-f\]\[0-9a-f\]//") test_expect_success 'PUT and MOVE sends object to URLs with SHA-1 hash suffix' ' sed \ -e "s/PUT /OP /" \ -e "s/MOVE /OP /" \ - -e "s|/objects/$x2/${x38}_$x40|WANTED_PATH_REQUEST|" \ + -e "s|/objects/$x2/${xtrunc}_$OID_REGEX|WANTED_PATH_REQUEST|" \ "$HTTPD_ROOT_PATH"/access.log | grep -e "\"OP .*WANTED_PATH_REQUEST HTTP/[.0-9]*\" 20[0-9] " -- cgit 1.4.1