Skip to content

Commit 4896089

Browse files
matheustavaresgitster
authored andcommitted
add: mark --chmod error string for translation
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 <[email protected]> Reviewed-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c937d70 commit 4896089

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

builtin/add.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static void chmod_pathspec(struct pathspec *pathspec, char flip, int show_only)
5555
err = S_ISREG(ce->ce_mode) ? 0 : -1;
5656

5757
if (err < 0)
58-
fprintf(stderr, "cannot chmod %cx '%s'\n", flip, ce->name);
58+
error(_("cannot chmod %cx '%s'"), flip, ce->name);
5959
}
6060
}
6161

t/t3700-add.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ test_expect_success 'git add --chmod --dry-run reports error for non regular fil
398398
git reset --hard &&
399399
test_ln_s_add foo foo4 &&
400400
git add --chmod=+x --dry-run foo4 2>stderr &&
401-
grep "cannot chmod +x .foo4." stderr
401+
test_i18ngrep "cannot chmod +x .foo4." stderr
402402
'
403403

404404
test_expect_success 'git add --chmod --dry-run reports error for unmatched pathspec' '

0 commit comments

Comments
 (0)