From: Ævar Arnfjörð Bjarmason Date: Sun, 19 Sep 2010 15:59:10 +0000 (+0000) Subject: gettextize: git-add "Use -f if you really want" message X-Git-Tag: ko-pu~10^2~131 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f4546d4aa2f69ba89436aaae8ec6d2bba809e267;p=git.git gettextize: git-add "Use -f if you really want" message 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 --- 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