Skip to content

Commit c87302b

Browse files
vascoolgitster
authored andcommitted
i18n: submodule: escape shell variables inside eval_gettext
According to the gettext manual [1], references to shell variables inside eval_gettext call must be escaped so that eval_gettext receives the translatable string before the variable values are substituted into it. [1] http://www.gnu.org/software/gettext/manual/html_node/Preparing-Shell-Scripts.html Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 0d71dbf commit c87302b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

git-submodule.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ cmd_update()
647647
remote_name=$(sanitize_submodule_env; cd "$sm_path" && get_default_remote)
648648
sha1=$(sanitize_submodule_env; cd "$sm_path" &&
649649
git rev-parse --verify "${remote_name}/${branch}") ||
650-
die "$(eval_gettext "Unable to find current ${remote_name}/${branch} revision in submodule path '\$sm_path'")"
650+
die "$(eval_gettext "Unable to find current \${remote_name}/\${branch} revision in submodule path '\$sm_path'")"
651651
fi
652652

653653
if test "$subsha1" != "$sha1" || test -n "$force"
@@ -671,7 +671,7 @@ cmd_update()
671671
# not be reachable from any of the refs
672672
is_tip_reachable "$sm_path" "$sha1" ||
673673
fetch_in_submodule "$sm_path" "$sha1" ||
674-
die "$(eval_gettext "Fetched in submodule path '\$displaypath', but it did not contain $sha1. Direct fetching of that commit failed.")"
674+
die "$(eval_gettext "Fetched in submodule path '\$displaypath', but it did not contain \$sha1. Direct fetching of that commit failed.")"
675675
fi
676676

677677
must_die_on_failure=

0 commit comments

Comments
 (0)