summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2007-06-11 19:12:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-06-12 08:06:21 (GMT)
commitbf2d824660c976e0d0e773f9c5095a6abaf388ae (patch)
tree780725e572d5a40ada82759076e2473034c759b8 /git-submodule.sh
parentb10ee7606e14265c6116639aafccb863b77043f5 (diff)
downloadgit-bf2d824660c976e0d0e773f9c5095a6abaf388ae.zip
git-bf2d824660c976e0d0e773f9c5095a6abaf388ae.tar.gz
git-bf2d824660c976e0d0e773f9c5095a6abaf388ae.tar.bz2
git-submodule: remember to checkout after clone
After the initial clone of a submodule, no files would be checked out in the submodule directory if the submodule HEAD was equal to the SHA-1 specified in the index of the containing repository. This fixes the problem by simply ignoring submodule HEAD for a fresh clone. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 8bdd99a..4a6d64d 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -100,12 +100,13 @@ modules_update()
if ! test -d "$path"/.git
then
module_clone "$path" "$url" || exit
+ subsha1=
+ else
+ subsha1=$(unset GIT_DIR && cd "$path" &&
+ git-rev-parse --verify HEAD) ||
+ die "Unable to find current revision of submodule '$path'"
fi
- subsha1=$(unset GIT_DIR && cd "$path" &&
- git-rev-parse --verify HEAD) ||
- die "Unable to find current revision of submodule '$path'"
-
if test "$subsha1" != "$sha1"
then
(unset GIT_DIR && cd "$path" && git-fetch &&