@matheusbsbs / matheus-bagliano / commits / 49df4b0298
Fork 0

i18n: git-branch 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 49df4b0298ea87ec737221c35ac74f8e6ee108c9
1 file changed +28 -28
builtin/branch.c
+28 -28
@@ -133,12 +133,12 @@ static int branch_merged(int kind, const char *name,
133 if ((head_rev != reference_rev) &&
134 in_merge_bases(rev, &head_rev, 1) != merged) {
135 if (merged)
136 - warning("deleting branch '%s' that has been merged to\n"
137 - " '%s', but it is not yet merged to HEAD.",
136 + warning(_("deleting branch '%s' that has been merged to\n"
137 + " '%s', but it is not yet merged to HEAD."),
138 name, reference_name);
139 else
140 - warning("not deleting branch '%s' that is not yet merged to\n"
141 - " '%s', even though it is merged to HEAD.",
140 + warning(_("not deleting branch '%s' that is not yet merged to\n"
141 + " '%s', even though it is merged to HEAD."),
142 name, reference_name);
143 }
144 return merged;
@@ -165,19 +165,19 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
165 remote = "";
166 break;
167 default:
168 - die("cannot use -a with -d");
168 + die(_("cannot use -a with -d"));
169 }
170
171 if (!force) {
172 head_rev = lookup_commit_reference(head_sha1);
173 if (!head_rev)
174 - die("Couldn't look up commit object for HEAD");
174 + die(_("Couldn't look up commit object for HEAD"));
175 }
176 for (i = 0; i < argc; i++, strbuf_release(&bname)) {
177 strbuf_branchname(&bname, argv[i]);
178 if (kinds == REF_LOCAL_BRANCH && !strcmp(head, bname.buf)) {
179 - error("Cannot delete the branch '%s' "
180 - "which you are currently on.", bname.buf);
179 + error(_("Cannot delete the branch '%s' "
180 + "which you are currently on."), bname.buf);
181 ret = 1;
182 continue;
183 }
@@ -186,7 +186,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
186
187 name = xstrdup(mkpath(fmt, bname.buf));
188 if (!resolve_ref(name, sha1, 1, NULL)) {
189 - error("%sbranch '%s' not found.",
189 + error(_("%sbranch '%s' not found."),
190 remote, bname.buf);
191 ret = 1;
192 continue;
@@ -194,21 +194,21 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
194
195 rev = lookup_commit_reference(sha1);
196 if (!rev) {
197 - error("Couldn't look up commit object for '%s'", name);
197 + error(_("Couldn't look up commit object for '%s'"), name);
198 ret = 1;
199 continue;
200 }
201
202 if (!force && !branch_merged(kinds, bname.buf, rev, head_rev)) {
203 - error("The branch '%s' is not fully merged.\n"
203 + error(_("The branch '%s' is not fully merged.\n"
204 "If you are sure you want to delete it, "
205 - "run 'git branch -D %s'.", bname.buf, bname.buf);
205 + "run 'git branch -D %s'."), bname.buf, bname.buf);
206 ret = 1;
207 continue;
208 }
209
210 if (delete_ref(name, sha1, 0)) {
211 - error("Error deleting %sbranch '%s'", remote,
211 + error(_("Error deleting %sbranch '%s'"), remote,
212 bname.buf);
213 ret = 1;
214 } else {
@@ -218,7 +218,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
218 find_unique_abbrev(sha1, DEFAULT_ABBREV));
219 strbuf_addf(&buf, "branch.%s", bname.buf);
220 if (git_config_rename_section(buf.buf, NULL) < 0)
221 - warning("Update of config-file failed");
221 + warning(_("Update of config-file failed"));
222 strbuf_release(&buf);
223 }
224 }
@@ -300,7 +300,7 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags,
300 if (ref_list->verbose || ref_list->with_commit || merge_filter != NO_FILTER) {
301 commit = lookup_commit_reference_gently(sha1, 1);
302 if (!commit) {
303 - cb->ret = error("branch '%s' does not point at a commit", refname);
303 + cb->ret = error(_("branch '%s' does not point at a commit"), refname);
304 return 0;
305 }
306
@@ -535,7 +535,7 @@ static int print_ref_list(int kinds, int detached, int verbose, int abbrev, stru
535 free_ref_list(&ref_list);
536
537 if (cb.ret)
538 - error("some refs could not be read");
538 + error(_("some refs could not be read"));
539
540 return cb.ret;
541 }
@@ -548,7 +548,7 @@ static void rename_branch(const char *oldname, const char *newname, int force)
548 int recovery = 0;
549
550 if (!oldname)
551 - die("cannot rename the current branch while not on any.");
551 + die(_("cannot rename the current branch while not on any."));
552
553 if (strbuf_check_branch_ref(&oldref, oldname)) {
554 /*
@@ -558,35 +558,35 @@ static void rename_branch(const char *oldname, const char *newname, int force)
558 if (resolve_ref(oldref.buf, sha1, 1, NULL))
559 recovery = 1;
560 else
561 - die("Invalid branch name: '%s'", oldname);
561 + die(_("Invalid branch name: '%s'"), oldname);
562 }
563
564 if (strbuf_check_branch_ref(&newref, newname))
565 - die("Invalid branch name: '%s'", newname);
565 + die(_("Invalid branch name: '%s'"), newname);
566
567 if (resolve_ref(newref.buf, sha1, 1, NULL) && !force)
568 - die("A branch named '%s' already exists.", newref.buf + 11);
568 + die(_("A branch named '%s' already exists."), newref.buf + 11);
569
570 strbuf_addf(&logmsg, "Branch: renamed %s to %s",
571 oldref.buf, newref.buf);
572
573 if (rename_ref(oldref.buf, newref.buf, logmsg.buf))
574 - die("Branch rename failed");
574 + die(_("Branch rename failed"));
575 strbuf_release(&logmsg);
576
577 if (recovery)
578 - warning("Renamed a misnamed branch '%s' away", oldref.buf + 11);
578 + warning(_("Renamed a misnamed branch '%s' away"), oldref.buf + 11);
579
580 /* no need to pass logmsg here as HEAD didn't really move */
581 if (!strcmp(oldname, head) && create_symref("HEAD", newref.buf, NULL))
582 - die("Branch renamed to %s, but HEAD is not updated!", newname);
582 + die(_("Branch renamed to %s, but HEAD is not updated!"), newname);
583
584 strbuf_addf(&oldsection, "branch.%s", oldref.buf + 11);
585 strbuf_release(&oldref);
586 strbuf_addf(&newsection, "branch.%s", newref.buf + 11);
587 strbuf_release(&newref);
588 if (git_config_rename_section(oldsection.buf, newsection.buf) < 0)
589 - die("Branch is renamed, but update of config-file failed");
589 + die(_("Branch is renamed, but update of config-file failed"));
590 strbuf_release(&oldsection);
591 strbuf_release(&newsection);
592 }
@@ -601,7 +601,7 @@ static int opt_parse_merge_filter(const struct option *opt, const char *arg, int
601 if (!arg)
602 arg = "HEAD";
603 if (get_sha1(arg, merge_filter_ref))
604 - die("malformed object name %s", arg);
604 + die(_("malformed object name %s"), arg);
605 return 0;
606 }
607
@@ -675,13 +675,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
675
676 head = resolve_ref("HEAD", head_sha1, 0, NULL);
677 if (!head)
678 - die("Failed to resolve HEAD as a valid ref.");
678 + die(_("Failed to resolve HEAD as a valid ref."));
679 head = xstrdup(head);
680 if (!strcmp(head, "HEAD")) {
681 detached = 1;
682 } else {
683 if (prefixcmp(head, "refs/heads/"))
684 - die("HEAD not found below refs/heads!");
684 + die(_("HEAD not found below refs/heads!"));
685 head += 11;
686 }
687 hashcpy(merge_filter_ref, head_sha1);
@@ -701,7 +701,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
701 rename_branch(argv[0], argv[1], rename > 1);
702 else if (argc <= 2) {
703 if (kinds != REF_LOCAL_BRANCH)
704 - die("-a and -r options to 'git branch' do not make sense with a branch name");
704 + die(_("-a and -r options to 'git branch' do not make sense with a branch name"));
705 create_branch(head, argv[0], (argc == 2) ? argv[1] : head,
706 force_create, reflog, track);
707 } else