Skip to content

Commit 1073094

Browse files
anderskgitster
authored andcommitted
git-sh-setup: be explicit where to dot-source git-sh-i18n from.
d323c6b ("i18n: git-sh-setup.sh: mark strings for translation", 2016-06-17) started to dot-source git-sh-i18n shell script library, assuming that $PATH is already adjusted for our scripts, namely, $GIT_EXEC_PATH is at the beginning of $PATH. Old contrib scripts like contrib/convert-grafts-to-replace-refs.sh and contrib/rerere-train.sh and third-party scripts like guilt may however be using this as ". $(git --exec-path)/git-sh-setup", without satisfying that assumption. Be more explicit by specifying its path prefixed with "$(git --exec-path)/". to be safe. While we’re here, move the sourcing of git-sh-i18n below the shell portability fixes. Signed-off-by: Anders Kaseorg <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ac84098 commit 1073094

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

git-sh-setup.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
# to set up some variables pointing at the normal git directories and
33
# a few helper shell functions.
44

5-
# Source git-sh-i18n for gettext support.
6-
. git-sh-i18n
7-
85
# Having this variable in your environment would break scripts because
96
# you would cause "cd" to be taken to unexpected places. If you
107
# like CDPATH, define it for your interactive shell sessions without
@@ -46,6 +43,9 @@ git_broken_path_fix () {
4643
4744
# @@BROKEN_PATH_FIX@@
4845
46+
# Source git-sh-i18n for gettext support.
47+
. "$(git --exec-path)/git-sh-i18n"
48+
4949
die () {
5050
die_with_status 1 "$@"
5151
}

0 commit comments

Comments
 (0)