i18n: advice: mark string about detached head for translation
authorVasco Almeida <vascomalmeida@sapo.pt>
Fri, 17 Jun 2016 20:20:51 +0000 (20:20 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 Jun 2016 22:45:47 +0000 (15:45 -0700)
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>
advice.c
t/t7201-co.sh
index 4dc5cf10a8533b1bfc3bd1483e91df115aa8f868..cb445a7e94d9b78e5a247b6fe65f85b96be5c650 100644 (file)
--- a/advice.c
+++ b/advice.c
@@ -106,14 +106,14 @@ void NORETURN die_conclude_merge(void)
 
 void detach_advice(const char *new_name)
 {
-       const char fmt[] =
-       "Note: checking out '%s'.\n\n"
+       const char *fmt =
+       _("Note: checking out '%s'.\n\n"
        "You are in 'detached HEAD' state. You can look around, make experimental\n"
        "changes and commit them, and you can discard any commits you make in this\n"
        "state without impacting any branches by performing another checkout.\n\n"
        "If you want to create a new branch to retain commits you create, you may\n"
        "do so (now or later) by using -b with the checkout command again. Example:\n\n"
-       "  git checkout -b <new-branch-name>\n\n";
+       "  git checkout -b <new-branch-name>\n\n");
 
        fprintf(stderr, fmt, new_name);
 }
index 885923610ab927c418c848fb706f621b5380d16b..d4b217b0ee5136d2836ba9526b286659d66afe80 100755 (executable)
@@ -257,7 +257,7 @@ test_expect_success 'checkout to detach HEAD' '
        git checkout -f renamer && git clean -f &&
        git checkout renamer^ 2>messages &&
        test_i18ngrep "HEAD is now at 7329388" messages &&
-       test_line_count -gt 1 messages &&
+       (test_line_count -gt 1 messages || test -n "$GETTEXT_POISON") &&
        H=$(git rev-parse --verify HEAD) &&
        M=$(git show-ref -s --verify refs/heads/master) &&
        test "z$H" = "z$M" &&