]> git.ipfire.org Git - thirdparty/git.git/commitdiff
send-pack/transport-helper: avoid mentioning a particular branch
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 24 Jun 2020 14:46:29 +0000 (14:46 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 24 Jun 2020 16:14:21 +0000 (09:14 -0700)
When trying to push all matching branches, but none match, we offer a
message suggesting to push the `master` branch.

However, we want to step away from making that branch any more special
than any other branch, so let's reword that message to mention no branch
in particular.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
send-pack.c
t/t5528-push-default.sh
transport-helper.c

index 0abee22283dae8ceba42eb4b9b5ecb4842c98984..19eb9b04e4de5bf79c63d7eb49483400acc5491c 100644 (file)
@@ -406,7 +406,7 @@ int send_pack(struct send_pack_args *args,
 
        if (!remote_refs) {
                fprintf(stderr, "No refs in common and none specified; doing nothing.\n"
-                       "Perhaps you should specify a branch such as 'master'.\n");
+                       "Perhaps you should specify a branch.\n");
                return 0;
        }
        if (args->atomic && !atomic_supported)
index 4d1e0c363ea1343738ddeccdfa8ddbd056031f45..f0a287d97dba8e2e72ed50f85d75df91852dab5f 100755 (executable)
@@ -98,6 +98,12 @@ test_expect_success 'push from/to new branch with upstream, matching and simple'
        test_push_failure upstream
 '
 
+test_expect_success '"matching" fails if none match' '
+       git init --bare empty &&
+       test_must_fail git push empty : 2>actual &&
+       test_i18ngrep "Perhaps you should specify a branch" actual
+'
+
 test_expect_success 'push ambiguously named branch with upstream, matching and simple' '
        git checkout -b ambiguous &&
        test_config branch.ambiguous.remote parent1 &&
index a46afcb69db615d2f8917f852db28c3dca501de0..8a711cda296eee0e6384f56829e76a1675632da8 100644 (file)
@@ -1046,7 +1046,7 @@ static int push_refs(struct transport *transport,
        if (!remote_refs) {
                fprintf(stderr,
                        _("No refs in common and none specified; doing nothing.\n"
-                         "Perhaps you should specify a branch such as 'master'.\n"));
+                         "Perhaps you should specify a branch.\n"));
                return 0;
        }