Skip to content

Commit 0b9c3af

Browse files
pcloudsgitster
authored andcommitted
remote.c: mark messages for translation
The two strings are slightly modified to be consistent with the rest: die() and error() start with a lowercase. Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 92ca868 commit 0b9c3af

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

remote.c

+22-21
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ static int handle_config(const char *key, const char *value, void *cb)
359359
return 0;
360360
/* Handle remote.<name>.* variables */
361361
if (*name == '/') {
362-
warning("Config remote shorthand cannot begin with '/': %s",
362+
warning(_("config remote shorthand cannot begin with '/': %s"),
363363
name);
364364
return 0;
365365
}
@@ -406,15 +406,15 @@ static int handle_config(const char *key, const char *value, void *cb)
406406
if (!remote->receivepack)
407407
remote->receivepack = v;
408408
else
409-
error("more than one receivepack given, using the first");
409+
error(_("more than one receivepack given, using the first"));
410410
} else if (!strcmp(subkey, "uploadpack")) {
411411
const char *v;
412412
if (git_config_string(&v, key, value))
413413
return -1;
414414
if (!remote->uploadpack)
415415
remote->uploadpack = v;
416416
else
417-
error("more than one uploadpack given, using the first");
417+
error(_("more than one uploadpack given, using the first"));
418418
} else if (!strcmp(subkey, "tagopt")) {
419419
if (!strcmp(value, "--no-tags"))
420420
remote->fetch_tags = -1;
@@ -680,7 +680,7 @@ static int match_name_with_pattern(const char *key, const char *name,
680680
size_t namelen;
681681
int ret;
682682
if (!kstar)
683-
die("Key '%s' of pattern had no '*'", key);
683+
die(_("key '%s' of pattern had no '*'"), key);
684684
klen = kstar - key;
685685
ksuffixlen = strlen(kstar + 1);
686686
namelen = strlen(name);
@@ -690,7 +690,7 @@ static int match_name_with_pattern(const char *key, const char *name,
690690
struct strbuf sb = STRBUF_INIT;
691691
const char *vstar = strchr(value, '*');
692692
if (!vstar)
693-
die("Value '%s' of pattern has no '*'", value);
693+
die(_("value '%s' of pattern has no '*'"), value);
694694
strbuf_add(&sb, value, vstar - value);
695695
strbuf_add(&sb, name + klen, namelen - klen - ksuffixlen);
696696
strbuf_addstr(&sb, vstar + 1);
@@ -995,12 +995,12 @@ static int match_explicit_lhs(struct ref *src,
995995
* way to delete 'other' ref at the remote end.
996996
*/
997997
if (try_explicit_object_name(rs->src, match) < 0)
998-
return error("src refspec %s does not match any.", rs->src);
998+
return error(_("src refspec %s does not match any"), rs->src);
999999
if (allocated_match)
10001000
*allocated_match = 1;
10011001
return 0;
10021002
default:
1003-
return error("src refspec %s matches more than one.", rs->src);
1003+
return error(_("src refspec %s matches more than one"), rs->src);
10041004
}
10051005
}
10061006

@@ -1030,7 +1030,7 @@ static int match_explicit(struct ref *src, struct ref *dst,
10301030
if (!dst_value ||
10311031
((flag & REF_ISSYMREF) &&
10321032
!starts_with(dst_value, "refs/heads/")))
1033-
die("%s cannot be resolved to branch.",
1033+
die(_("%s cannot be resolved to branch"),
10341034
matched_src->name);
10351035
}
10361036

@@ -1041,30 +1041,30 @@ static int match_explicit(struct ref *src, struct ref *dst,
10411041
if (starts_with(dst_value, "refs/"))
10421042
matched_dst = make_linked_ref(dst_value, dst_tail);
10431043
else if (is_null_oid(&matched_src->new_oid))
1044-
error("unable to delete '%s': remote ref does not exist",
1044+
error(_("unable to delete '%s': remote ref does not exist"),
10451045
dst_value);
10461046
else if ((dst_guess = guess_ref(dst_value, matched_src))) {
10471047
matched_dst = make_linked_ref(dst_guess, dst_tail);
10481048
free(dst_guess);
10491049
} else
1050-
error("unable to push to unqualified destination: %s\n"
1051-
"The destination refspec neither matches an "
1052-
"existing ref on the remote nor\n"
1053-
"begins with refs/, and we are unable to "
1054-
"guess a prefix based on the source ref.",
1050+
error(_("unable to push to unqualified destination: %s\n"
1051+
"The destination refspec neither matches an "
1052+
"existing ref on the remote nor\n"
1053+
"begins with refs/, and we are unable to "
1054+
"guess a prefix based on the source ref."),
10551055
dst_value);
10561056
break;
10571057
default:
10581058
matched_dst = NULL;
1059-
error("dst refspec %s matches more than one.",
1059+
error(_("dst refspec %s matches more than one"),
10601060
dst_value);
10611061
break;
10621062
}
10631063
if (!matched_dst)
10641064
return -1;
10651065
if (matched_dst->peer_ref)
1066-
return error("dst ref %s receives from more than one src.",
1067-
matched_dst->name);
1066+
return error(_("dst ref %s receives from more than one src"),
1067+
matched_dst->name);
10681068
else {
10691069
matched_dst->peer_ref = allocated_src ?
10701070
matched_src :
@@ -1750,7 +1750,7 @@ int get_fetch_map(const struct ref *remote_refs,
17501750
ref_map = get_remote_ref(remote_refs, name);
17511751
}
17521752
if (!missing_ok && !ref_map)
1753-
die("Couldn't find remote ref %s", name);
1753+
die(_("couldn't find remote ref %s"), name);
17541754
if (ref_map) {
17551755
ref_map->peer_ref = get_local_ref(refspec->dst);
17561756
if (ref_map->peer_ref && refspec->force)
@@ -1763,7 +1763,7 @@ int get_fetch_map(const struct ref *remote_refs,
17631763
if (!starts_with((*rmp)->peer_ref->name, "refs/") ||
17641764
check_refname_format((*rmp)->peer_ref->name, 0)) {
17651765
struct ref *ignore = *rmp;
1766-
error("* Ignoring funny ref '%s' locally",
1766+
error(_("* Ignoring funny ref '%s' locally"),
17671767
(*rmp)->peer_ref->name);
17681768
*rmp = (*rmp)->next;
17691769
free(ignore->peer_ref);
@@ -1858,7 +1858,7 @@ int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs,
18581858
repo_init_revisions(the_repository, &revs, NULL);
18591859
setup_revisions(argv.argc, argv.argv, &revs, NULL);
18601860
if (prepare_revision_walk(&revs))
1861-
die("revision walk setup failed");
1861+
die(_("revision walk setup failed"));
18621862

18631863
/* ... and count the commits on each side. */
18641864
while (1) {
@@ -2131,7 +2131,8 @@ static int parse_push_cas_option(struct push_cas_option *cas, const char *arg, i
21312131
else if (!colon[1])
21322132
oidclr(&entry->expect);
21332133
else if (get_oid(colon + 1, &entry->expect))
2134-
return error("cannot parse expected object name '%s'", colon + 1);
2134+
return error(_("cannot parse expected object name '%s'"),
2135+
colon + 1);
21352136
return 0;
21362137
}
21372138

0 commit comments

Comments
 (0)