git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/5] git-submodule: remember to checkout after clone
@ 2007-06-11  0:01 Lars Hjemli
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Hjemli @ 2007-06-11  0:01 UTC (permalink / raw)
  To: git@vger.kernel.org

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>
---
  git-submodule.sh |    9 +++++----
  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 &&
-- 
1.5.2.1.914.gbd3a7

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/5] git-submodule: remember to checkout after clone
  2007-06-11 19:12 ` [PATCH 1/5] t7400: barf if git-submodule removes or replaces a file Lars Hjemli
@ 2007-06-11 19:12   ` Lars Hjemli
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Hjemli @ 2007-06-11 19:12 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

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>
---
 git-submodule.sh |    9 +++++----
 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 &&
-- 
1.5.2.1.914.gbd3a7

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-06-11 19:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-11  0:01 [PATCH 2/5] git-submodule: remember to checkout after clone Lars Hjemli
  -- strict thread matches above, loose matches on Subject: below --
2007-06-11 19:12 [PATCH 0/5] misc. submodule related changes Lars Hjemli
2007-06-11 19:12 ` [PATCH 1/5] t7400: barf if git-submodule removes or replaces a file Lars Hjemli
2007-06-11 19:12   ` [PATCH 2/5] git-submodule: remember to checkout after clone Lars Hjemli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).