From f4546d4aa2f69ba89436aaae8ec6d2bba809e267 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 19 Sep 2010 15:59:10 +0000 Subject: [PATCH] gettextize: git-add "Use -f if you really want" message MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Gettextize the "Use -f if you really want to add them.\n" message. Tests in t2204-add-ignored.sh and t3700-add.sh explicitly checked for this message. Split the tests that did so up and skip portion that calls grep on this message under GETTEXT_POISON=YesPlease. Signed-off-by: Ævar Arnfjörð Bjarmason --- builtin/add.c | 2 +- t/t2204-add-ignored.sh | 37 +++++++++++++++++++++++++------------ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/builtin/add.c b/builtin/add.c index 7358280c5..a88f50f33 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -346,7 +346,7 @@ static int add_files(struct dir_struct *dir, int flags) fprintf(stderr, ignore_error); for (i = 0; i < dir->ignored_nr; i++) fprintf(stderr, "%s\n", dir->ignored[i]->name); - fprintf(stderr, "Use -f if you really want to add them.\n"); + fprintf(stderr, _("Use -f if you really want to add them.\n")); die(_("no files added")); } diff --git a/t/t2204-add-ignored.sh b/t/t2204-add-ignored.sh index 24afdabab..be66e2db0 100755 --- a/t/t2204-add-ignored.sh +++ b/t/t2204-add-ignored.sh @@ -31,18 +31,21 @@ do rm -f .git/index && test_must_fail git add "$i" 2>err && git ls-files "$i" >out && - ! test -s out && - grep -e "Use -f if" err && - cat err + ! test -s out + ' + + test_expect_success NO_GETTEXT_POISON "complaints for ignored $i output" ' + grep -e "Use -f if" err ' test_expect_success "complaints for ignored $i with unignored file" ' rm -f .git/index && test_must_fail git add "$i" file 2>err && git ls-files "$i" >out && - ! test -s out && - grep -e "Use -f if" err && - cat err + ! test -s out + ' + test_expect_success NO_GETTEXT_POISON "complaints for ignored $i with unignored file output" ' + grep -e "Use -f if" err ' done @@ -54,9 +57,14 @@ do cd dir && test_must_fail git add "$i" 2>err && git ls-files "$i" >out && - ! test -s out && - grep -e "Use -f if" err && - cat err + ! test -s out + ) + ' + + test_expect_success NO_GETTEXT_POISON "complaints for ignored $i in dir output" ' + ( + cd dir && + grep -e "Use -f if" err ) ' done @@ -69,9 +77,14 @@ do cd sub && test_must_fail git add "$i" 2>err && git ls-files "$i" >out && - ! test -s out && - grep -e "Use -f if" err && - cat err + ! test -s out + ) + ' + + test_expect_success NO_GETTEXT_POISON "complaints for ignored $i in sub output" ' + ( + cd sub && + grep -e "Use -f if" err ) ' done -- 2.30.2