]> git.ipfire.org Git - thirdparty/git.git/commitdiff
add: mark --chmod error string for translation
authorMatheus Tavares <matheus.bernardino@usp.br>
Tue, 23 Feb 2021 01:10:34 +0000 (22:10 -0300)
committerJunio C Hamano <gitster@pobox.com>
Wed, 24 Feb 2021 20:14:51 +0000 (12:14 -0800)
This error message is intended for humans, so mark it for translation.
Also use error() instead of fprintf(stderr, ...), to make the
corresponding line a bit cleaner, and to display the "error:" prefix,
which helps classifying the nature/severity of the message.

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/add.c
t/t3700-add.sh

index 1e33ab81f2e80d8d66b404e5bc53334de4ca7311..0c5f53c0bb7f3d922078b3d282ec77aa725f66ac 100644 (file)
@@ -55,7 +55,7 @@ static void chmod_pathspec(struct pathspec *pathspec, char flip, int show_only)
                        err = S_ISREG(ce->ce_mode) ? 0 : -1;
 
                if (err < 0)
-                       fprintf(stderr, "cannot chmod %cx '%s'\n", flip, ce->name);
+                       error(_("cannot chmod %cx '%s'"), flip, ce->name);
        }
 }
 
index fc81f2ef005877d5004b4176c198700d95e3dc33..6a8b94a4f742c83780819f3964fc19a200782dff 100755 (executable)
@@ -398,7 +398,7 @@ test_expect_success 'git add --chmod --dry-run reports error for non regular fil
        git reset --hard &&
        test_ln_s_add foo foo4 &&
        git add --chmod=+x --dry-run foo4 2>stderr &&
-       grep "cannot chmod +x .foo4." stderr
+       test_i18ngrep "cannot chmod +x .foo4." stderr
 '
 
 test_expect_success 'git add --chmod --dry-run reports error for unmatched pathspec' '