summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 20fc73e)
raw | patch | inline | side by side (parent: 20fc73e)
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | |
Sun, 10 Apr 2011 19:34:08 +0000 (19:34 +0000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 12 Apr 2011 07:20:28 +0000 (00:20 -0700) |
Mark the "Warning: you are leaving %d commit(s) behind" message added
in v1.7.5-rc0~74^2 (commit: give final warning when reattaching HEAD
to leave commits behind) by Junio C Hamano for translation.
This message requires the use of ngettext() features, and is the first
message to use the Q_() wrapper around ngettext().
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
in v1.7.5-rc0~74^2 (commit: give final warning when reattaching HEAD
to leave commits behind) by Junio C Hamano for translation.
This message requires the use of ngettext() features, and is the first
message to use the Q_() wrapper around ngettext().
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/checkout.c | patch | blob | history | |
t/t2020-checkout-detach.sh | patch | blob | history |
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 0b65edde264c629c905e461902b99972051359d5..38632fc39805085e3b134e0574f3846931c150c6 100644 (file)
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
if (more == 1)
describe_one_orphan(&sb, last);
else
- strbuf_addf(&sb, " ... and %d more.\n", more);
+ strbuf_addf(&sb, _(" ... and %d more.\n"), more);
}
fprintf(stderr,
- "Warning: you are leaving %d commit%s behind, "
+ Q_(
+ /* The singular version */
+ "Warning: you are leaving %d commit behind, "
+ "not connected to\n"
+ "any of your branches:\n\n"
+ "%s\n"
+ "If you want to keep it by creating a new branch, "
+ "this may be a good time\nto do so with:\n\n"
+ " git branch new_branch_name %s\n\n",
+ /* The plural version */
+ "Warning: you are leaving %d commits behind, "
"not connected to\n"
"any of your branches:\n\n"
"%s\n"
"If you want to keep them by creating a new branch, "
"this may be a good time\nto do so with:\n\n"
" git branch new_branch_name %s\n\n",
- lost, ((1 < lost) ? "s" : ""),
+ /* Give ngettext() the count */
+ lost),
+ lost,
sb.buf,
sha1_to_hex(commit->object.sha1));
strbuf_release(&sb);
index 569b27fe8d488833c3ec0d9952ae064764a0183f..ab782e22fd0a56d4c0212ef0c7fc828aa12f8ece 100755 (executable)
echo content >orphan &&
git add orphan &&
git commit -a -m orphan &&
- git checkout master 2>stderr &&
+ git checkout master 2>stderr
+'
+
+test_expect_success C_LOCALE_OUTPUT 'checkout warns on orphan commits: output' '
check_orphan_warning stderr
'
test_expect_success 'checkout does not warn leaving ref tip' '
reset &&
git checkout --detach two &&
- git checkout master 2>stderr &&
+ git checkout master 2>stderr
+'
+
+test_expect_success C_LOCALE_OUTPUT 'checkout does not warn leaving ref tip' '
check_no_orphan_warning stderr
'
test_expect_success 'checkout does not warn leaving reachable commit' '
reset &&
git checkout --detach HEAD^ &&
- git checkout master 2>stderr &&
+ git checkout master 2>stderr
+'
+
+test_expect_success C_LOCALE_OUTPUT 'checkout does not warn leaving reachable commit' '
check_no_orphan_warning stderr
'