222
223
module_clone "$path" "$realrepo" "$reference" || exit
224
(
225
- unset GIT_DIR
225
+ clear_local_git_env
226
cd "$path" &&
227
# ash fails to wordsplit ${branch:+-b "$branch"...}
228
case "$branch" in
278
name=$(module_name "$path")
279
(
280
prefix="$prefix$path/"
281
- unset GIT_DIR
281
+ clear_local_git_env
282
cd "$path" &&
283
eval "$@" &&
284
if test -n "$recursive"
434
module_clone "$path" "$url" "$reference"|| exit
435
subsha1=
436
else
437
- subsha1=$(unset GIT_DIR; cd "$path" &&
437
+ subsha1=$(clear_local_git_env; cd "$path" &&
438
git rev-parse --verify HEAD) ||
439
die "Unable to find current revision in submodule path '$path'"
440
fi
454
455
if test -z "$nofetch"
456
then
457
- (unset GIT_DIR; cd "$path" &&
457
+ (clear_local_git_env; cd "$path" &&
458
git-fetch) ||
459
die "Unable to fetch in submodule path '$path'"
460
fi
477
;;
478
esac
479
480
- (unset GIT_DIR; cd "$path" && $command "$sha1") ||
480
+ (clear_local_git_env; cd "$path" && $command "$sha1") ||
481
die "Unable to $action '$sha1' in submodule path '$path'"
482
say "Submodule path '$path': $msg '$sha1'"
483
fi
484
485
if test -n "$recursive"
486
then
487
- (unset GIT_DIR; cd "$path" && cmd_update $orig_args) ||
487
+ (clear_local_git_env; cd "$path" && cmd_update $orig_args) ||
488
die "Failed to recurse into submodule path '$path'"
489
fi
490
done
492
493
set_name_rev () {
494
revname=$( (
495
- unset GIT_DIR
495
+ clear_local_git_env
496
cd "$1" && {
497
git describe "$2" 2>/dev/null ||
498
git describe --tags "$2" 2>/dev/null ||
757
else
758
if test -z "$cached"
759
then
760
- sha1=$(unset GIT_DIR; cd "$path" && git rev-parse --verify HEAD)
760
+ sha1=$(clear_local_git_env; cd "$path" && git rev-parse --verify HEAD)
761
set_name_rev "$path" "$sha1"
762
fi
763
say "+$sha1 $displaypath$revname"
767
then
768
(
769
prefix="$displaypath/"
770
- unset GIT_DIR
770
+ clear_local_git_env
771
cd "$path" &&
772
cmd_status $orig_args
773
) ||
818
if test -e "$path"/.git
819
then
820
(
821
- unset GIT_DIR
821
+ clear_local_git_env
822
cd "$path"
823
remote=$(get_default_remote)
824
say "Synchronizing submodule url for '$name'"