diff options
| author | Junio C Hamano <gitster@pobox.com> | 2016-05-06 14:53:24 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2016-05-06 14:53:25 -0700 |
| commit | cc601901a7a9619b706cb10a6fdc1e6246b6da53 (patch) | |
| tree | b8a81b3876cf1a4c5429815ddc6733696d77090b /git-submodule.sh | |
| parent | a0c9cf51c0ba6ca30f7325bc035200010f2c50f7 (diff) | |
| parent | 2ab56603bffb7aed6ec6d2a36deddfdf49cfd5ad (diff) | |
| download | git-cc601901a7a9619b706cb10a6fdc1e6246b6da53.tar.xz | |
Merge branch 'sb/submodule-path-misc-bugs' into maint
"git submodule" reports the paths of submodules the command
recurses into, but this was incorrect when the command was not run
from the root level of the superproject.
* sb/submodule-path-misc-bugs:
t7407: make expectation as clear as possible
submodule update: test recursive path reporting from subdirectory
submodule update: align reporting path for custom command execution
submodule status: correct path handling in recursive submodules
submodule update --init: correct path handling in recursive submodules
submodule foreach: correct path display in recursive submodules
Diffstat (limited to 'git-submodule.sh')
| -rwxr-xr-x | git-submodule.sh | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/git-submodule.sh b/git-submodule.sh index 43c68deee9..753a90d307 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -413,8 +413,8 @@ cmd_foreach() die_if_unmatched "$mode" if test -e "$sm_path"/.git then - displaypath=$(relative_path "$sm_path") - say "$(eval_gettext "Entering '\$prefix\$displaypath'")" + displaypath=$(relative_path "$prefix$sm_path") + say "$(eval_gettext "Entering '\$displaypath'")" name=$(git submodule--helper name "$sm_path") ( prefix="$prefix$sm_path/" @@ -434,7 +434,7 @@ cmd_foreach() cmd_foreach "--recursive" "$@" fi ) <&3 3<&- || - die "$(eval_gettext "Stopping at '\$prefix\$displaypath'; script returned non-zero status.")" + die "$(eval_gettext "Stopping at '\$displaypath'; script returned non-zero status.")" fi done } @@ -473,7 +473,7 @@ cmd_init() die_if_unmatched "$mode" name=$(git submodule--helper name "$sm_path") || exit - displaypath=$(relative_path "$sm_path") + displaypath=$(relative_path "$prefix$sm_path") # Copy url setting when it is not set yet if test -z "$(git config "submodule.$name.url")" @@ -802,8 +802,8 @@ Maybe you want to use 'update --init'?")" ;; !*) command="${update_module#!}" - die_msg="$(eval_gettext "Execution of '\$command \$sha1' failed in submodule path '\$prefix\$sm_path'")" - say_msg="$(eval_gettext "Submodule path '\$prefix\$sm_path': '\$command \$sha1'")" + die_msg="$(eval_gettext "Execution of '\$command \$sha1' failed in submodule path '\$displaypath'")" + say_msg="$(eval_gettext "Submodule path '\$displaypath': '\$command \$sha1'")" must_die_on_failure=yes ;; *) @@ -1159,6 +1159,7 @@ cmd_status() ( prefix="$displaypath/" clear_local_git_env + wt_prefix= cd "$sm_path" && eval cmd_status ) || |
