From: Junio C Hamano Date: Thu, 30 Jul 2020 20:20:34 +0000 (-0700) Subject: Merge branch 'bc/push-cas-cquoted-refname' into master X-Git-Tag: v2.29.0-rc0~209 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c2796ac1c2807a46d1db90e47c892ba96bfdb276;p=thirdparty%2Fgit.git Merge branch 'bc/push-cas-cquoted-refname' into master Pushing a ref whose name contains non-ASCII character with the "--force-with-lease" option did not work over smart HTTP protocol, which has been corrected. * bc/push-cas-cquoted-refname: remote-curl: make --force-with-lease work with non-ASCII ref names --- c2796ac1c2807a46d1db90e47c892ba96bfdb276 diff --cc t/t5541-http-push-smart.sh index 463d0f12e5,26c28cec54..187454f5dd --- a/t/t5541-http-push-smart.sh +++ b/t/t5541-http-push-smart.sh @@@ -464,21 -456,21 +464,36 @@@ test_expect_success 'push status outpu grep "^To $HTTPD_URL/smart/test_repo.git" status ' +test_expect_success 'clone/fetch scrubs password from reflogs' ' + cd "$ROOT_PATH" && + git clone "$HTTPD_URL_USER_PASS/smart/test_repo.git" \ + reflog-test && + cd reflog-test && + test_commit prepare-for-force-fetch && + git switch -c away && + git fetch "$HTTPD_URL_USER_PASS/smart/test_repo.git" \ + +master:master && + # should have been scrubbed down to vanilla URL + git log -g master >reflog && + grep "$HTTPD_URL" reflog && + ! grep "$HTTPD_URL_USER_PASS" reflog +' + + test_expect_success 'Non-ASCII branch name can be used with --force-with-lease' ' + cd "$ROOT_PATH" && + git clone "$HTTPD_URL_USER_PASS/smart/test_repo.git" non-ascii && + cd non-ascii && + git checkout -b rama-de-árbol && + test_commit F && + git push --force-with-lease origin rama-de-árbol && + git ls-remote origin refs/heads/rama-de-árbol >actual && + git ls-remote . refs/heads/rama-de-árbol >expect && + test_cmp expect actual && + git push --delete --force-with-lease origin rama-de-árbol && + git ls-remote origin refs/heads/rama-de-árbol >actual && + test_must_be_empty actual + ' + test_expect_success 'colorize errors/hints' ' cd "$ROOT_PATH"/test_repo_clone && test_must_fail git -c color.transport=always -c color.advice=always \