Merge branch 'rs/update-hook-optim' into maint
[gitweb.git] / git-sh-setup.sh
index c7b2a95463fd1513b6adab64d2e9110e4298db42..378928518b2c42ee3adb69b52d3b0eb63fca8ac3 100644 (file)
@@ -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 "$@"
 }
@@ -163,9 +163,11 @@ git_pager() {
        else
                GIT_PAGER=cat
        fi
-       : ${LESS=-FRX}
-       : ${LV=-c}
-       export LESS LV
+       for vardef in @@PAGER_ENV@@
+       do
+               var=${vardef%%=*}
+               eval ": \"\${$vardef}\" && export $var"
+       done
 
        eval "$GIT_PAGER" '"$@"'
 }
@@ -375,7 +377,7 @@ git_dir_init () {
                gettextln "Unable to determine absolute path of git directory" >&2
                exit 1
        }
-       : ${GIT_OBJECT_DIRECTORY="$(git rev-parse --git-path objects)"}
+       : "${GIT_OBJECT_DIRECTORY="$(git rev-parse --git-path objects)"}"
 }
 
 if test -z "$NONGIT_OK"