Re: [PATCH 3/7] t5528-push-default.sh: add helper functions
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:39
Matthieu Moy [off-list ref] writes:
Actually, there's a much stronger argument: we're talking about test_push_failure (not success), so whatever the mode is, no branch should be updated.
Not really. When you have 'master' and 'side' (two branches), have updated both but the remote side has only updated 'master', a push with 'matching' behaves like this: $ git -c push.default=matching push Counting objects: 8, done. Delta compression using up to 12 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (6/6), 399 bytes, done. Total 6 (delta 1), reused 0 (delta 0) Unpacking objects: 100% (6/6), done. To /var/tmp/j/src 9e1359e..4d3f497 side -> side ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to '/var/tmp/j/src' hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. Check out this branch and merge the remote changes hint: (e.g. 'git pull') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. $ echo $? 1 Notice the mention of "some refs" on the "error:" line. 'side' branch successfully fast-forwards.