[PATCH 10/72] gettextize: git-add "Use -f if you really want" message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <avarab@xxxxxxxxx>
---
 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 df56429..fe4ac49 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -347,7 +347,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 24afdab..be66e2d 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
-- 
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]