@matheusbsbs / matheus-bagliano / commits / bd4a51fc25
Fork 0

i18n: git-fetch basic messages

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Feb 22, 2011 at 23:41 UTC bd4a51fc254bbf492e08afab5a8853cf10c15fbe
1 file changed +23 -23
builtin/fetch.c
+23 -23
@@ -184,7 +184,7 @@ static struct ref *get_ref_map(struct transport *transport,
184 } else {
185 ref_map = get_remote_ref(remote_refs, "HEAD");
186 if (!ref_map)
187 - die("Couldn't find remote ref HEAD");
187 + die(_("Couldn't find remote ref HEAD"));
188 ref_map->merge = 1;
189 tail = &ref_map->next;
190 }
@@ -237,7 +237,7 @@ static int update_local_ref(struct ref *ref,
237 *display = 0;
238 type = sha1_object_info(ref->new_sha1, NULL);
239 if (type < 0)
240 - die("object %s not found", sha1_to_hex(ref->new_sha1));
240 + die(_("object %s not found"), sha1_to_hex(ref->new_sha1));
241
242 if (!hashcmp(ref->old_sha1, ref->new_sha1)) {
243 if (verbosity > 0)
@@ -337,7 +337,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
337
338 fp = fopen(filename, "a");
339 if (!fp)
340 - return error("cannot open %s: %s\n", filename, strerror(errno));
340 + return error(_("cannot open %s: %s\n"), filename, strerror(errno));
341
342 if (raw_url)
343 url = transport_anonymize_url(raw_url);
@@ -426,9 +426,9 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
426 free(url);
427 fclose(fp);
428 if (rc & STORE_REF_ERROR_DF_CONFLICT)
429 - error("some local refs could not be updated; try running\n"
429 + error(_("some local refs could not be updated; try running\n"
430 " 'git remote prune %s' to remove any old, conflicting "
431 - "branches", remote_name);
431 + "branches"), remote_name);
432 return rc;
433 }
434
@@ -476,7 +476,7 @@ static int quickfetch(struct ref *ref_map)
476
477 err = start_command(&revlist);
478 if (err) {
479 - error("could not run rev-list");
479 + error(_("could not run rev-list"));
480 return err;
481 }
482
@@ -490,14 +490,14 @@ static int quickfetch(struct ref *ref_map)
490 if (write_in_full(revlist.in, sha1_to_hex(ref->old_sha1), 40) < 0 ||
491 write_str_in_full(revlist.in, "\n") < 0) {
492 if (errno != EPIPE && errno != EINVAL)
493 - error("failed write to rev-list: %s", strerror(errno));
493 + error(_("failed write to rev-list: %s"), strerror(errno));
494 err = -1;
495 break;
496 }
497 }
498
499 if (close(revlist.in)) {
500 - error("failed to close rev-list's stdin: %s", strerror(errno));
500 + error(_("failed to close rev-list's stdin: %s"), strerror(errno));
501 err = -1;
502 }
503
@@ -650,8 +650,8 @@ static void check_not_current_branch(struct ref *ref_map)
650 for (; ref_map; ref_map = ref_map->next)
651 if (ref_map->peer_ref && !strcmp(current_branch->refname,
652 ref_map->peer_ref->name))
653 - die("Refusing to fetch into current branch %s "
654 - "of non-bare repository", current_branch->refname);
653 + die(_("Refusing to fetch into current branch %s "
654 + "of non-bare repository"), current_branch->refname);
655 }
656
657 static int truncate_fetch_head(void)
@@ -660,7 +660,7 @@ static int truncate_fetch_head(void)
660 FILE *fp = fopen(filename, "w");
661
662 if (!fp)
663 - return error("cannot open %s: %s\n", filename, strerror(errno));
663 + return error(_("cannot open %s: %s\n"), filename, strerror(errno));
664 fclose(fp);
665 return 0;
666 }
@@ -684,7 +684,7 @@ static int do_fetch(struct transport *transport,
684 }
685
686 if (!transport->get_refs_list || !transport->fetch)
687 - die("Don't know how to fetch from %s", transport->url);
687 + die(_("Don't know how to fetch from %s"), transport->url);
688
689 /* if not appending, truncate FETCH_HEAD */
690 if (!append && !dry_run) {
@@ -738,10 +738,10 @@ static void set_option(const char *name, const char *value)
738 {
739 int r = transport_set_option(transport, name, value);
740 if (r < 0)
741 - die("Option \"%s\" value \"%s\" is not valid for %s",
741 + die(_("Option \"%s\" value \"%s\" is not valid for %s"),
742 name, value, transport->url);
743 if (r > 0)
744 - warning("Option \"%s\" is ignored for %s\n",
744 + warning(_("Option \"%s\" is ignored for %s\n"),
745 name, transport->url);
746 }
747
@@ -838,9 +838,9 @@ static int fetch_multiple(struct string_list *list)
838 argv[argc] = name;
839 argv[argc + 1] = NULL;
840 if (verbosity >= 0)
841 - printf("Fetching %s\n", name);
841 + printf(_("Fetching %s\n"), name);
842 if (run_command_v_opt(argv, RUN_GIT_CMD)) {
843 - error("Could not fetch %s", name);
843 + error(_("Could not fetch %s"), name);
844 result = 1;
845 }
846 }
@@ -856,8 +856,8 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
856 int exit_code;
857
858 if (!remote)
859 - die("No remote repository specified. Please, specify either a URL or a\n"
860 - "remote name from which new revisions should be fetched.");
859 + die(_("No remote repository specified. Please, specify either a URL or a\n"
860 + "remote name from which new revisions should be fetched."));
861
862 transport = transport_get(remote, NULL);
863 transport_set_verbosity(transport, verbosity, progress);
@@ -876,7 +876,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
876 char *ref;
877 i++;
878 if (i >= argc)
879 - die("You need to specify a tag name.");
879 + die(_("You need to specify a tag name."));
880 ref = xmalloc(strlen(argv[i]) * 2 + 22);
881 strcpy(ref, "refs/tags/");
882 strcat(ref, argv[i]);
@@ -916,9 +916,9 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
916
917 if (all) {
918 if (argc == 1)
919 - die("fetch --all does not take a repository argument");
919 + die(_("fetch --all does not take a repository argument"));
920 else if (argc > 1)
921 - die("fetch --all does not make sense with refspecs");
921 + die(_("fetch --all does not make sense with refspecs"));
922 (void) for_each_remote(get_one_remote_for_fetch, &list);
923 result = fetch_multiple(&list);
924 } else if (argc == 0) {
@@ -929,7 +929,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
929 /* All arguments are assumed to be remotes or groups */
930 for (i = 0; i < argc; i++)
931 if (!add_remote_or_group(argv[i], &list))
932 - die("No such remote or remote group: %s", argv[i]);
932 + die(_("No such remote or remote group: %s"), argv[i]);
933 result = fetch_multiple(&list);
934 } else {
935 /* Single remote or group */
@@ -937,7 +937,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
937 if (list.nr > 1) {
938 /* More than one remote */
939 if (argc > 1)
940 - die("Fetching a group and specifying refspecs does not make sense");
940 + die(_("Fetching a group and specifying refspecs does not make sense"));
941 result = fetch_multiple(&list);
942 } else {
943 /* Zero or one remotes */