summaryrefslogtreecommitdiff
path: root/git-sh-setup.sh
diff options
context:
space:
mode:
authorAnders Kaseorg <andersk@mit.edu>2016-10-29 22:10:02 -0400
committerJunio C Hamano <gitster@pobox.com>2016-10-30 16:13:49 -0700
commit1073094f30a8dd5ae49f2146f587085c4fe86410 (patch)
tree229746efe1304829ee9a8620cc3f857f799ff794 /git-sh-setup.sh
parentac84098b7e32406a982ac01cc76a663d5605224b (diff)
downloadgit-1073094f30a8dd5ae49f2146f587085c4fe86410.tar.gz
git-sh-setup: be explicit where to dot-source git-sh-i18n from.ak/sh-setup-dot-source-i18n-fix
d323c6b641 ("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 <andersk@mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-sh-setup.sh')
-rw-r--r--git-sh-setup.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index a8a4576342..240c7ebcd1 100644
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -2,9 +2,6 @@
# to set up some variables pointing at the normal git directories and
# a few helper shell functions.
-# Source git-sh-i18n for gettext support.
-. git-sh-i18n
-
# Having this variable in your environment would break scripts because
# you would cause "cd" to be taken to unexpected places. If you
# like CDPATH, define it for your interactive shell sessions without
@@ -46,6 +43,9 @@ git_broken_path_fix () {
# @@BROKEN_PATH_FIX@@
+# Source git-sh-i18n for gettext support.
+. "$(git --exec-path)/git-sh-i18n"
+
die () {
die_with_status 1 "$@"
}