Re: [COGITO PATCH] Heads and tags in subdirectories
Teach cg-init about the origin directory.
Signed-off-by: "Santi Béjar" <sbejar@gmail.com>
---
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