diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-06-10 15:04:14 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-06-10 15:04:14 -0700 |
commit | 0b91d563d8d9615d1dc400b7c5e92ebd7933d01d (patch) | |
tree | 73745845c836a6b31a1ccd1159270cddb7c7e2ea /t/t5516-fetch-push.sh | |
parent | c21fa3bb549a7769f9d508f0a5f95c654539e1f7 (diff) | |
parent | f1dfbd9ee010e5cdf0d931d16b4b2892b33331e5 (diff) | |
download | git-0b91d563d8d9615d1dc400b7c5e92ebd7933d01d.tar.gz |
Merge branch 'gc/zero-length-branch-config-fix'
A misconfigured 'branch..remote' led to a bug in configuration
parsing.
* gc/zero-length-branch-config-fix:
remote.c: reject 0-length branch names
remote.c: don't BUG() on 0-length branch names
Diffstat (limited to 't/t5516-fetch-push.sh')
-rwxr-xr-x | t/t5516-fetch-push.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh index 4dfb080433..e99c31f8c3 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -598,6 +598,26 @@ test_expect_success 'branch.*.pushremote config order is irrelevant' ' check_push_result two_repo $the_commit heads/main ' +test_expect_success 'push rejects empty branch name entries' ' + mk_test one_repo heads/main && + test_config remote.one.url one_repo && + test_config branch..remote one && + test_config branch..merge refs/heads/ && + test_config branch.main.remote one && + test_config branch.main.merge refs/heads/main && + test_must_fail git push 2>err && + grep "bad config variable .branch\.\." err +' + +test_expect_success 'push ignores "branch." config without subsection' ' + mk_test one_repo heads/main && + test_config remote.one.url one_repo && + test_config branch.autoSetupMerge true && + test_config branch.main.remote one && + test_config branch.main.merge refs/heads/main && + git push +' + test_expect_success 'push with dry-run' ' mk_test testrepo heads/main && |