diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-03-07 12:47:17 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-03-07 12:47:17 -0800 |
commit | 9317dc4f051452a0e0f7a62a5531b16adf36b553 (patch) | |
tree | 0ef09fc4b06b1721faa516a302e18a8c5baf887a /git-submodule.sh | |
parent | 27a23031056fbd540f7c34d78a3f097a3a7c211c (diff) | |
parent | 5ce9086ddfe6931ef34fcd99778c9235e2ee1839 (diff) | |
download | git-9317dc4f051452a0e0f7a62a5531b16adf36b553.tar.gz |
Merge branch 'gb/maint-submodule-env'
* gb/maint-submodule-env:
is_submodule_modified(): clear environment properly
submodules: ensure clean environment when operating in a submodule
shell setup: clear_local_git_env() function
rev-parse: --local-env-vars option
Refactor list of of repo-local env vars
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-x | git-submodule.sh | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/git-submodule.sh b/git-submodule.sh index 383dc45119..f21d0bfce7 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -222,7 +222,7 @@ cmd_add() module_clone "$path" "$realrepo" "$reference" || exit ( - unset GIT_DIR + clear_local_git_env cd "$path" && # ash fails to wordsplit ${branch:+-b "$branch"...} case "$branch" in @@ -278,7 +278,7 @@ cmd_foreach() name=$(module_name "$path") ( prefix="$prefix$path/" - unset GIT_DIR + clear_local_git_env cd "$path" && eval "$@" && if test -n "$recursive" @@ -434,7 +434,7 @@ cmd_update() module_clone "$path" "$url" "$reference"|| exit subsha1= else - subsha1=$(unset GIT_DIR; cd "$path" && + subsha1=$(clear_local_git_env; cd "$path" && git rev-parse --verify HEAD) || die "Unable to find current revision in submodule path '$path'" fi @@ -454,7 +454,7 @@ cmd_update() if test -z "$nofetch" then - (unset GIT_DIR; cd "$path" && + (clear_local_git_env; cd "$path" && git-fetch) || die "Unable to fetch in submodule path '$path'" fi @@ -477,14 +477,14 @@ cmd_update() ;; esac - (unset GIT_DIR; cd "$path" && $command "$sha1") || + (clear_local_git_env; cd "$path" && $command "$sha1") || die "Unable to $action '$sha1' in submodule path '$path'" say "Submodule path '$path': $msg '$sha1'" fi if test -n "$recursive" then - (unset GIT_DIR; cd "$path" && cmd_update $orig_args) || + (clear_local_git_env; cd "$path" && cmd_update $orig_args) || die "Failed to recurse into submodule path '$path'" fi done @@ -492,7 +492,7 @@ cmd_update() set_name_rev () { revname=$( ( - unset GIT_DIR + clear_local_git_env cd "$1" && { git describe "$2" 2>/dev/null || git describe --tags "$2" 2>/dev/null || @@ -760,7 +760,7 @@ cmd_status() else if test -z "$cached" then - sha1=$(unset GIT_DIR; cd "$path" && git rev-parse --verify HEAD) + sha1=$(clear_local_git_env; cd "$path" && git rev-parse --verify HEAD) set_name_rev "$path" "$sha1" fi say "+$sha1 $displaypath$revname" @@ -770,7 +770,7 @@ cmd_status() then ( prefix="$displaypath/" - unset GIT_DIR + clear_local_git_env cd "$path" && cmd_status $orig_args ) || @@ -821,7 +821,7 @@ cmd_sync() if test -e "$path"/.git then ( - unset GIT_DIR + clear_local_git_env cd "$path" remote=$(get_default_remote) say "Synchronizing submodule url for '$name'" |