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>
This commit is contained in:
parent
b10ee7606e
commit
bf2d824660
@ -100,11 +100,12 @@ modules_update()
|
|||||||
if ! test -d "$path"/.git
|
if ! test -d "$path"/.git
|
||||||
then
|
then
|
||||||
module_clone "$path" "$url" || exit
|
module_clone "$path" "$url" || exit
|
||||||
fi
|
subsha1=
|
||||||
|
else
|
||||||
subsha1=$(unset GIT_DIR && cd "$path" &&
|
subsha1=$(unset GIT_DIR && cd "$path" &&
|
||||||
git-rev-parse --verify HEAD) ||
|
git-rev-parse --verify HEAD) ||
|
||||||
die "Unable to find current revision of submodule '$path'"
|
die "Unable to find current revision of submodule '$path'"
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$subsha1" != "$sha1"
|
if test "$subsha1" != "$sha1"
|
||||||
then
|
then
|
||||||
|
Loading…
Reference in New Issue
Block a user