diff options
author | Teng Long <dyroneteng@gmail.com> | 2023-05-06 14:34:08 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-05-07 00:36:43 +0300 |
commit | 425b4d7f47bd2be561ced14eac36056390862e8c (patch) | |
tree | 21399bd405b812faeabff214cd32d862b82a0b6c /t/t5543-atomic-push.sh | |
parent | 69c786637d7a7fe3b2b8f7d989af095f5f49c3a8 (diff) |
push: introduce '--branches' option
The '--all' option of git-push built-in cmd support to push all branches
(refs under refs/heads) to remote. Under the usage, a user can easlily
work in some scenarios, for example, branches synchronization and batch
upload.
The '--all' was introduced for a long time, meanwhile, git supports to
customize the storage location under "refs/". when a new git user see
the usage like, 'git push origin --all', we might feel like we're
pushing _all_ the refs instead of just branches without looking at the
documents until we found the related description of it or '--mirror'.
To ensure compatibility, we cannot rename '--all' to another name
directly, one way is, we can try to add a new option '--heads' which be
identical with the functionality of '--all' to let the user understand
the meaning of representation more clearly. Actually, We've more or less
named options this way already, for example, in 'git-show-ref' and 'git
ls-remote'.
At the same time, we fix a related issue about the wrong help
information of '--all' option in code and add some test cases in
t5523, t5543 and t5583.
Signed-off-by: Teng Long <dyroneteng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5543-atomic-push.sh')
-rwxr-xr-x | t/t5543-atomic-push.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/t/t5543-atomic-push.sh b/t/t5543-atomic-push.sh index 70431122a4..04b47ad84a 100755 --- a/t/t5543-atomic-push.sh +++ b/t/t5543-atomic-push.sh @@ -117,7 +117,10 @@ test_expect_success 'atomic push fails if one branch fails' ' test_commit five && git checkout main && test_commit six && - test_must_fail git push --atomic --all up + test_must_fail git push --atomic --all up >output-all 2>&1 && + # --all and --branches have the same behavior when be combined with --atomic + test_must_fail git push --atomic --branches up >output-branches 2>&1 && + test_cmp output-all output-branches ) && test_refs main HEAD@{7} && test_refs second HEAD@{4} |