diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-01-31 10:37:44 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-01-31 10:37:44 -0800 |
commit | 09e0be130d83ceedb3653d9a41768c6a13457ac5 (patch) | |
tree | 466600cb071233316506ff31a3e9966679fb2908 /t/t2060-switch.sh | |
parent | The first batch to start the current cycle (diff) | |
parent | branch,checkout: fix --track documentation (diff) | |
download | tgif-09e0be130d83ceedb3653d9a41768c6a13457ac5.tar.xz |
Merge branch 'js/branch-track-inherit' into gc/branch-recurse-submodules
* js/branch-track-inherit:
branch,checkout: fix --track documentation
branch,checkout: fix --track usage strings
config: require lowercase for branch.*.autosetupmerge
branch: add flags and config to inherit tracking
branch: accept multiple upstream branches for tracking
Diffstat (limited to 't/t2060-switch.sh')
-rwxr-xr-x | t/t2060-switch.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t2060-switch.sh b/t/t2060-switch.sh index 9bc6a3aa5c..ebb961be29 100755 --- a/t/t2060-switch.sh +++ b/t/t2060-switch.sh @@ -107,4 +107,32 @@ test_expect_success 'not switching when something is in progress' ' test_must_fail git switch -d @^ ' +test_expect_success 'tracking info copied with autoSetupMerge=inherit' ' + # default config does not copy tracking info + git switch -c foo-no-inherit foo && + test_cmp_config "" --default "" branch.foo-no-inherit.remote && + test_cmp_config "" --default "" branch.foo-no-inherit.merge && + # with --track=inherit, we copy tracking info from foo + git switch --track=inherit -c foo2 foo && + test_cmp_config origin branch.foo2.remote && + test_cmp_config refs/heads/foo branch.foo2.merge && + # with autoSetupMerge=inherit, we do the same + test_config branch.autoSetupMerge inherit && + git switch -c foo3 foo && + test_cmp_config origin branch.foo3.remote && + test_cmp_config refs/heads/foo branch.foo3.merge && + # with --track, we override autoSetupMerge + git switch --track -c foo4 foo && + test_cmp_config . branch.foo4.remote && + test_cmp_config refs/heads/foo branch.foo4.merge && + # and --track=direct does as well + git switch --track=direct -c foo5 foo && + test_cmp_config . branch.foo5.remote && + test_cmp_config refs/heads/foo branch.foo5.merge && + # no tracking info to inherit from main + git switch -c main2 main && + test_cmp_config "" --default "" branch.main2.remote && + test_cmp_config "" --default "" branch.main2.merge +' + test_done |