From e90b9c2eb9580f45d77d3849e5f14406bb76efcd Mon Sep 17 00:00:00 2001 From: Karsten Blees Date: Mon, 9 Jan 2012 19:16:30 +0100 Subject: [PATCH] Windows/i18n: rename $path to prevent clashes with $PATH Environment variables on Windows are case-insensitive. Rename '$path' in all calls to eval_gettext to $modulepath so that it is not mistakenly expanded to the value of the $PATH variable. [jes: this happens to fix t7406/t7407 on Windows] [pt: squashed in fix for substitution order error that broke t7400] Signed-off-by: Karsten Blees Signed-off-by: Johannes Schindelin Signed-off-by: Sebastian Schuberth Signed-off-by: Pat Thoyts --- git-submodule.sh | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/git-submodule.sh b/git-submodule.sh index 05286ff400..8f67e7f5fe 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -105,7 +105,7 @@ module_name() name=$( git config -f .gitmodules --get-regexp '^submodule\..*\.path$' | sed -n -e 's|^submodule\.\(.*\)\.path '"$re"'$|\1|p' ) test -z "$name" && - die "$(eval_gettext "No submodule mapping found in .gitmodules for path '\$path'")" + die "$(modulepath=$path eval_gettext "No submodule mapping found in .gitmodules for path '\$modulepath'")" echo "$name" } @@ -170,7 +170,7 @@ module_clone() else git-clone $quiet -n "$url" "$path" --separate-git-dir "$gitdir" fi || - die "$(eval_gettext "Clone of '\$url' into submodule path '\$path' failed")" + die "$(modulepath=$path eval_gettext "Clone of '\$url' into submodule path '\$modulepath' failed")" fi } @@ -261,13 +261,13 @@ cmd_add() s|/*$|| ') git ls-files --error-unmatch "$path" > /dev/null 2>&1 && - die "$(eval_gettext "'\$path' already exists in the index")" + die "$(modulepath=$path eval_gettext "'\$modulepath' already exists in the index")" if test -z "$force" && ! git add --dry-run --ignore-missing "$path" > /dev/null 2>&1 then cat >&2 </dev/null) && test -z "$rev") || git-fetch)) || - die "$(eval_gettext "Unable to fetch in submodule path '\$path'")" + die "$(modulepath=$path eval_gettext "Unable to fetch in submodule path '\$modulepath'")" fi # Is this something we just cloned? @@ -564,20 +564,20 @@ Maybe you want to use 'update --init'?")" case "$update_module" in rebase) command="git rebase" - die_msg="$(eval_gettext "Unable to rebase '\$sha1' in submodule path '\$path'")" - say_msg="$(eval_gettext "Submodule path '\$path': rebased into '\$sha1'")" + die_msg="$(modulepath=$path eval_gettext "Unable to rebase '\$sha1' in submodule path '\$modulepath'")" + say_msg="$(modulepath=$path eval_gettext "Submodule path '\$modulepath': rebased into '\$sha1'")" must_die_on_failure=yes ;; merge) command="git merge" - die_msg="$(eval_gettext "Unable to merge '\$sha1' in submodule path '\$path'")" - say_msg="$(eval_gettext "Submodule path '\$path': merged in '\$sha1'")" + die_msg="$(modulepath=$path eval_gettext "Unable to merge '\$sha1' in submodule path '\$modulepath'")" + say_msg="$(modulepath=$path eval_gettext "Submodule path '\$modulepath': merged in '\$sha1'")" must_die_on_failure=yes ;; *) command="git checkout $subforce -q" - die_msg="$(eval_gettext "Unable to checkout '\$sha1' in submodule path '\$path'")" - say_msg="$(eval_gettext "Submodule path '\$path': checked out '\$sha1'")" + die_msg="$(modulepath=$path eval_gettext "Unable to checkout '\$sha1' in submodule path '\$modulepath'")" + say_msg="$(modulepath=$path eval_gettext "Submodule path '\$modulepath': checked out '\$sha1'")" ;; esac @@ -599,7 +599,7 @@ Maybe you want to use 'update --init'?")" res=$? if test $res -gt 0 then - die_msg="$(eval_gettext "Failed to recurse into submodule path '\$path'")" + die_msg="$(modulepath=$path eval_gettext "Failed to recurse into submodule path '\$modulepath'")" if test $res -eq 1 then err="${err};$die_msg" @@ -926,7 +926,7 @@ cmd_status() cd "$path" && eval cmd_status "$orig_args" ) || - die "$(eval_gettext "Failed to recurse into submodule path '\$path'")" + die "$(modulepath=$path eval_gettext "Failed to recurse into submodule path '\$modulepath'")" fi done } -- 2.11.4.GIT