[PATCH 0/3] Never report references we not push

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A strange behavior is found when writing test cases for topic
'jx/proc-receive-hook':

> # TODO: report for the failure of master branch is unnecessary.
> test_expect_success "no proc-receive hook, fail all for atomic push" '
> 	(
> 		cd workbench &&
> 		test_must_fail git push --atomic origin \
> 			HEAD:next \
> 			HEAD:refs/for/master/topic
> 	) >out 2>&1 &&
> 	format_git_output <out >actual &&
> 	cat >expect <<-EOF &&
> 	remote: # pre-receive hook
> 	remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next
> 	remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
> 	remote: error: cannot to find hook "proc-receive"
> 	To ../upstream
> 	 ! [rejected]        master (atomic push failed)

We do not push "master" branch, but git reports status for it.

> 	 ! [remote rejected] HEAD -> next (fail to run proc-receive hook)
> 	 ! [remote rejected] HEAD -> refs/for/master/topic (fail to run proc-receive hook)
> 	error: failed to push some refs to "../upstream"
> 	EOF
> 	test_cmp expect actual &&
> 	(
> 		cd upstream &&
> 		git show-ref
> 	) >out &&
> 	format_git_output <out >actual &&
> 	cat >expect <<-EOF &&
> 	<COMMIT-A> refs/heads/master
> 	EOF
> 	test_cmp expect actual
> '

This issue is introduced by commit v2.22.0-1-g3bca1e7f9f (transport-helper:
enforce atomic in push_refs_with_push, 2019-07-11).  That commit wanted to
fix report issue of HTTP protocol, but marked all remote references failure
for atomic push.

--

Jiang Xin (3):
  t5543: never report what we do not push
  send-pack: mark failure of atomic push properly
  transport-helper: enforce atomic in push_refs_with_push

 send-pack.c                |  2 +
 t/t5541-http-push-smart.sh | 12 ++++-
 t/t5543-atomic-push.sh     | 92 ++++++++++++++++++++++++++++++++++++++
 transport-helper.c         | 15 +++++++
 transport.c                | 14 ------
 5 files changed, 119 insertions(+), 16 deletions(-)

-- 
2.26.0.3.ga7a9d752d4




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux