diff options
author | Junio C Hamano <junkio@cox.net> | 2006-03-21 02:04:50 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-03-21 02:04:50 -0800 |
commit | d293b281276ea6c160ed9589cbf06a44698158e2 (patch) | |
tree | 2605cecefffb0e621bbc2afbb2a99b62b5edff93 | |
parent | Merge branch 'jc/name' into next (diff) | |
parent | clone: record the remote primary branch with remotes/$origin/HEAD (diff) | |
download | tgif-d293b281276ea6c160ed9589cbf06a44698158e2.tar.xz |
Merge branch 'jc/clone' into next
* jc/clone:
clone: record the remote primary branch with remotes/$origin/HEAD
-rwxr-xr-x | git-clone.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/git-clone.sh b/git-clone.sh index 3b5475340d..5953e18a5b 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -45,7 +45,7 @@ Perhaps git-update-server-info needs to be run there?" if test -n "$use_separate_remote" && branch_name=`expr "$name" : 'heads/\(.*\)'` then - tname="remotes/$branch_name" + tname="remotes/$origin/$branch_name" else tname=$name fi @@ -370,7 +370,7 @@ then Pull: refs/heads/$head_points_at:refs/$origin_tracking" && case "$use_separate_remote" in t) git-update-ref HEAD "$head_sha1" ;; - *) git-update-ref "refs/$origin" $(git-rev-parse HEAD) + *) git-update-ref "refs/$origin" $(git-rev-parse HEAD) ;; esac && (cd "$GIT_DIR/$remote_top" && find . -type f -print) | while read dotslref @@ -379,7 +379,13 @@ Pull: refs/heads/$head_points_at:refs/$origin_tracking" && test "$head_points_at" = "$name" || test "$origin" = "$head" || echo "Pull: refs/heads/${name}:$remote_top/${name}" - done >>"$GIT_DIR/remotes/$origin" + done >>"$GIT_DIR/remotes/$origin" && + case "$use_separate_remote" in + t) + rm -f "refs/remotes/$origin/HEAD" + git-symbolic-ref "refs/remotes/$origin/HEAD" \ + "refs/remotes/$origin/$head_points_at" + esac esac case "$no_checkout" in |