i18n: git-push "prevent you from losing" message
Gettextize the "To prevent you from losing history" message. A test in lib-httpd.sh and another in t5541-http-push.sh explicitly checked for this message. Change them to skip under GETTEXT_POISON=YesPlease. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Feb 22, 2011 at 23:42 UTC
b32227e770f6c8ade19d340118a478f8b1a8659d
3 files changed
+8
-5
builtin/push.c
+2
-2
@@ -129,9 +129,9 @@ static int push_with_options(struct transport *transport, int flags)
129
return 0;
130
131
if (nonfastforward && advice_push_nonfastforward) {
132
- fprintf(stderr, "To prevent you from losing history, non-fast-forward updates were rejected\n"
132
+ fprintf(stderr, _("To prevent you from losing history, non-fast-forward updates were rejected\n"
133
"Merge the remote changes (e.g. 'git pull') before pushing again. See the\n"
134
- "'Note about fast-forwards' section of 'git push --help' for details.\n");
134
+ "'Note about fast-forwards' section of 'git push --help' for details.\n"));
135
}
136
137
return 1;
t/lib-httpd.sh
+1
-1
@@ -157,7 +157,7 @@ test_http_push_nonff() {
157
grep "^ ! \[rejected\][ ]*$BRANCH -> $BRANCH (non-fast-forward)$" output
158
'
159
160
- test_expect_success 'non-fast-forward push shows help message' '
160
+ test_expect_success C_LOCALE_OUTPUT 'non-fast-forward push shows help message' '
161
grep "To prevent you from losing history, non-fast-forward updates were rejected" \
162
output
163
'
t/t5541-http-push.sh
+5
-2
@@ -128,11 +128,14 @@ test_expect_success 'push fails for non-fast-forward refs unmatched by remote he
128
129
# push master too; this ensures there is at least one '"'push'"' command to
130
# the remote helper and triggers interaction with the helper.
131
- test_must_fail git push -v origin +master master:retsam >output 2>&1 &&
131
+ test_must_fail git push -v origin +master master:retsam >output 2>&1'
132
133
+test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper: remote output' '
134
grep "^ + [a-f0-9]*\.\.\.[a-f0-9]* *master -> master (forced update)$" output &&
134
- grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output &&
135
+ grep "^ ! \[rejected\] *master -> retsam (non-fast-forward)$" output
136
+'
137
138
+test_expect_success C_LOCALE_OUTPUT 'push fails for non-fast-forward refs unmatched by remote helper: our output' '
139
grep "To prevent you from losing history, non-fast-forward updates were rejected" \
140
output
141
'