i18n: advice: mark string about detached head for translation
Mark string with advice seen by the user when in detached head. Update test t7201-co.sh to pass under GETTEXT_POISON build. Pretend success if the number of lines of "git checkout renamer^" output is not greater than 1 and test are running under GETTEXT_POISON. Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Vasco Almeida committed
Jun 17, 2016 at 20:20 UTC
e9f3cec494330a86a412adaee95360ddea6fcf54
2 files changed
+4
-4
advice.c
+3
-3
@@ -106,14 +106,14 @@ void NORETURN die_conclude_merge(void)
106
107
void detach_advice(const char *new_name)
108
{
109
- const char fmt[] =
110
- "Note: checking out '%s'.\n\n"
109
+ const char *fmt =
110
+ _("Note: checking out '%s'.\n\n"
111
"You are in 'detached HEAD' state. You can look around, make experimental\n"
112
"changes and commit them, and you can discard any commits you make in this\n"
113
"state without impacting any branches by performing another checkout.\n\n"
114
"If you want to create a new branch to retain commits you create, you may\n"
115
"do so (now or later) by using -b with the checkout command again. Example:\n\n"
116
- " git checkout -b <new-branch-name>\n\n";
116
+ " git checkout -b <new-branch-name>\n\n");
117
118
fprintf(stderr, fmt, new_name);
119
}
t/t7201-co.sh
+1
-1
@@ -257,7 +257,7 @@ test_expect_success 'checkout to detach HEAD' '
257
git checkout -f renamer && git clean -f &&
258
git checkout renamer^ 2>messages &&
259
test_i18ngrep "HEAD is now at 7329388" messages &&
260
- test_line_count -gt 1 messages &&
260
+ (test_line_count -gt 1 messages || test -n "$GETTEXT_POISON") &&
261
H=$(git rev-parse --verify HEAD) &&
262
M=$(git show-ref -s --verify refs/heads/master) &&
263
test "z$H" = "z$M" &&