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>
Lars Hjemli committed
Jun 11, 2007 at 21:12 UTC
bf2d824660c976e0d0e773f9c5095a6abaf388ae
1 file changed
+5
-4
git-submodule.sh
+5
-4
@@ -100,12 +100,13 @@ modules_update()
100
if ! test -d "$path"/.git
101
then
102
module_clone "$path" "$url" || exit
103
+ subsha1=
104
+ else
105
+ subsha1=$(unset GIT_DIR && cd "$path" &&
106
+ git-rev-parse --verify HEAD) ||
107
+ die "Unable to find current revision of submodule '$path'"
108
fi
109
105
- subsha1=$(unset GIT_DIR && cd "$path" &&
106
- git-rev-parse --verify HEAD) ||
107
- die "Unable to find current revision of submodule '$path'"
108
-
110
if test "$subsha1" != "$sha1"
111
then
112
(unset GIT_DIR && cd "$path" && git-fetch &&