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
This commit is contained in:
Vincent Ambo 2020-11-21 19:20:35 +01:00
parent 082c006c04
commit f4609b896f
1485 changed files with 241535 additions and 109418 deletions

View file

@ -27,6 +27,12 @@ test_refs () {
test_cmp expect actual
}
fmt_status_report () {
sed -n \
-e "/^To / { s/ */ /g; p; }" \
-e "/^ ! / { s/ */ /g; p; }"
}
test_expect_success 'atomic push works for a single branch' '
mk_repo_pair &&
(
@ -191,4 +197,87 @@ test_expect_success 'atomic push is not advertised if configured' '
test_refs master HEAD@{1}
'
# References in upstream : master(1) one(1) foo(1)
# References in workbench: master(2) foo(1) two(2) bar(2)
# Atomic push : master(2) two(2) bar(2)
test_expect_success 'atomic push reports (reject by update hook)' '
mk_repo_pair &&
(
cd workbench &&
test_commit one &&
git branch foo &&
git push up master one foo &&
git tag -d one
) &&
(
mkdir -p upstream/.git/hooks &&
cat >upstream/.git/hooks/update <<-EOF &&
#!/bin/sh
if test "\$1" = "refs/heads/bar"
then
echo >&2 "Pusing to branch bar is prohibited"
exit 1
fi
EOF
chmod a+x upstream/.git/hooks/update
) &&
(
cd workbench &&
test_commit two &&
git branch bar
) &&
test_must_fail git -C workbench \
push --atomic up master two bar >out 2>&1 &&
fmt_status_report <out >actual &&
cat >expect <<-EOF &&
To ../upstream
! [remote rejected] master -> master (atomic push failure)
! [remote rejected] two -> two (atomic push failure)
! [remote rejected] bar -> bar (hook declined)
EOF
test_cmp expect actual
'
# References in upstream : master(1) one(1) foo(1)
# References in workbench: master(2) foo(1) two(2) bar(2)
test_expect_success 'atomic push reports (mirror, but reject by update hook)' '
(
cd workbench &&
git remote remove up &&
git remote add up ../upstream
) &&
test_must_fail git -C workbench \
push --atomic --mirror up >out 2>&1 &&
fmt_status_report <out >actual &&
cat >expect <<-EOF &&
To ../upstream
! [remote rejected] master -> master (atomic push failure)
! [remote rejected] one (atomic push failure)
! [remote rejected] bar -> bar (hook declined)
! [remote rejected] two -> two (atomic push failure)
EOF
test_cmp expect actual
'
# References in upstream : master(2) one(1) foo(1)
# References in workbench: master(1) foo(1) two(2) bar(2)
test_expect_success 'atomic push reports (reject by non-ff)' '
rm upstream/.git/hooks/update &&
(
cd workbench &&
git push up master &&
git reset --hard HEAD^
) &&
test_must_fail git -C workbench \
push --atomic up master foo bar >out 2>&1 &&
fmt_status_report <out >actual &&
cat >expect <<-EOF &&
To ../upstream
! [rejected] master -> master (non-fast-forward)
! [rejected] bar -> bar (atomic push failed)
EOF
test_cmp expect actual
'
test_done