send-pack/transport-helper: avoid mentioning a particular branch
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>
Johannes Schindelin committed
Jun 24, 2020 at 14:46 UTC
4d04658d8b5c72d2ebbb3aec7b06228e2ae1d327
3 files changed
+8
-2
send-pack.c
+1
-1
@@ -406,7 +406,7 @@ int send_pack(struct send_pack_args *args,
406
407
if (!remote_refs) {
408
fprintf(stderr, "No refs in common and none specified; doing nothing.\n"
409
- "Perhaps you should specify a branch such as 'master'.\n");
409
+ "Perhaps you should specify a branch.\n");
410
return 0;
411
}
412
if (args->atomic && !atomic_supported)
t/t5528-push-default.sh
+6
@@ -98,6 +98,12 @@ test_expect_success 'push from/to new branch with upstream, matching and simple'
98
test_push_failure upstream
99
'
100
101
+test_expect_success '"matching" fails if none match' '
102
+ git init --bare empty &&
103
+ test_must_fail git push empty : 2>actual &&
104
+ test_i18ngrep "Perhaps you should specify a branch" actual
105
+'
106
+
107
test_expect_success 'push ambiguously named branch with upstream, matching and simple' '
108
git checkout -b ambiguous &&
109
test_config branch.ambiguous.remote parent1 &&
transport-helper.c
+1
-1
@@ -1046,7 +1046,7 @@ static int push_refs(struct transport *transport,
1046
if (!remote_refs) {
1047
fprintf(stderr,
1048
_("No refs in common and none specified; doing nothing.\n"
1049
- "Perhaps you should specify a branch such as 'master'.\n"));
1049
+ "Perhaps you should specify a branch.\n"));
1050
return 0;
1051
}
1052