Subject: Re: [COGITO PATCH] Heads and tags in subdirectories

From: Santi Béjar <[email-masked]>
Date: Wed, 01 Jun 2005 14:59:22 +0200

Teach cg-init about the origin directory.

Signed-off-by: "Santi Béjar" <[email-masked]>
---
 cg-init |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/cg-init b/cg-init
--- a/cg-init
+++ b/cg-init
@@ -29,8 +29,9 @@ ln -s refs/heads/master $_git/HEAD
 if [ "$uri" ]; then
 	echo "$uri" >$_git/branches/origin
 	cg-pull origin || die "pull failed"
-
-	cp $_git/refs/heads/origin $_git/refs/heads/master
+	uribranch=$(echo $uri | cut -d '#' -f 2 -s)
+	uribranch=${uribranch:-master}
+	cp $_git/refs/heads/origin/$uribranch $_git/refs/heads/master
 	git-read-tree HEAD
 	git-checkout-cache -a
 	git-update-cache --refresh