{"thread":{"id":"8548","subject":"[PATCH 2/5] git-submodule: remember to checkout after clone","startedAt":"2007-06-11T00:01:04Z","lastAt":"2007-06-11T00:01:04Z","messageCount":1,"participants":["Lars Hjemli"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"44670","messageId":"op.ttqcz2oo9pspc6@localhost","threadId":"8548","inReplyTo":null,"subject":"[PATCH 2/5] git-submodule: remember to checkout after clone","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2007-06-11T00:01:04Z","receivedAt":"2007-06-11T00:01:04Z","isPatch":true,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"After the initial clone of a submodule, no files would be checked out in\nthe submodule directory if the submodule HEAD was equal to the SHA-1\nspecified in the index of the containing repository. This fixes the problem\nby simply ignoring submodule HEAD for a fresh clone.\n\nSigned-off-by: Lars Hjemli <hjemli@gmail.com>\n---\n  git-submodule.sh |    9 +++++----\n  1 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 8bdd99a..4a6d64d 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -100,12 +100,13 @@ modules_update()\n  \t\tif ! test -d \"$path\"/.git\n  \t\tthen\n  \t\t\tmodule_clone \"$path\" \"$url\" || exit\n+\t\t\tsubsha1=\n+\t\telse\n+\t\t\tsubsha1=$(unset GIT_DIR && cd \"$path\" &&\n+\t\t\t\tgit-rev-parse --verify HEAD) ||\n+\t\t\tdie \"Unable to find current revision of submodule '$path'\"\n  \t\tfi\n\n-\t\tsubsha1=$(unset GIT_DIR && cd \"$path\" &&\n-\t\t\tgit-rev-parse --verify HEAD) ||\n-\t\tdie \"Unable to find current revision of submodule '$path'\"\n-\n  \t\tif test \"$subsha1\" != \"$sha1\"\n  \t\tthen\n  \t\t\t(unset GIT_DIR && cd \"$path\" && git-fetch &&\n-- \n1.5.2.1.914.gbd3a7\n"}]}