i18n: factorize "--foo outside a repository"

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Reviewed-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jean-Noël Avila committed Jan 5, 2022 at 20:02 UTC 59bb00090eb63434d46ee0ffa37482ba419aebb1
1 file changed +3 -3
apply.c
+3 -3
@@ -136,7 +136,7 @@ int check_apply_state(struct apply_state *state, int force_apply)
136 return error(_("options '%s' and '%s' cannot be used together"), "--reject", "--3way");
137 if (state->threeway) {
138 if (is_not_gitdir)
139 - return error(_("--3way outside a repository"));
139 + return error(_("'%s' outside a repository"), "--3way");
140 state->check_index = 1;
141 }
142 if (state->apply_with_reject) {
@@ -147,10 +147,10 @@ int check_apply_state(struct apply_state *state, int force_apply)
147 if (!force_apply && (state->diffstat || state->numstat || state->summary || state->check || state->fake_ancestor))
148 state->apply = 0;
149 if (state->check_index && is_not_gitdir)
150 - return error(_("--index outside a repository"));
150 + return error(_("'%s' outside a repository"), "--index");
151 if (state->cached) {
152 if (is_not_gitdir)
153 - return error(_("--cached outside a repository"));
153 + return error(_("'%s' outside a repository"), "--cached");
154 state->check_index = 1;
155 }
156 if (state->ita_only && (state->check_index || is_not_gitdir))