summaryrefslogtreecommitdiff
path: root/git-clone.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-11-06 00:52:57 -0800
committerJunio C Hamano <junkio@cox.net>2005-11-06 18:17:14 -0800
commit95d117b6051c01726b67d3151f83e47dd41c0743 (patch)
tree3d07d3bd2f319d0df6c2402c1084d44ce6b69c67 /git-clone.sh
parentf1790448628262e46496861bb6da76be63a2a247 (diff)
downloadgit-95d117b6051c01726b67d3151f83e47dd41c0743.tar.gz
Set up remotes/origin to track all remote branches.
This implements the idea Daniel Barkalow came up with, to match the remotes/origin created by clone by default to the workflow I use myself in my guinea pig repository, to have me eat my own dog food. We probably would want to use either .git/refs/local/heads/* (idea by Linus) or .git/refs/heads/origin/* instead to reduce the local ref namespace pollution. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-clone.sh')
-rwxr-xr-xgit-clone.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/git-clone.sh b/git-clone.sh
index 1adf604172..4fdd652514 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -202,8 +202,16 @@ then
mkdir -p .git/remotes &&
echo >.git/remotes/origin \
"URL: $repo
-Pull: $head_points_at:origin"
- cp ".git/refs/heads/$head_points_at" .git/refs/heads/origin
+Pull: $head_points_at:origin" &&
+ cp ".git/refs/heads/$head_points_at" .git/refs/heads/origin &&
+ find .git/refs/heads -type f -print |
+ while read ref
+ do
+ head=`expr "$ref" : '.git/refs/heads/\(.*\)'` &&
+ test "$head_points_at" = "$head" ||
+ test "origin" = "$head" ||
+ echo "Pull: ${head}:${head}"
+ done >>.git/remotes/origin
esac
case "$no_checkout" in