git-clone: fix duplicated "master" in $GIT_DIR/remotes/origin
Under --use-separate-remote we ended up duplicating the branch remote HEAD pointed at in $GIT_DIR/remotes/origin file. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Jun 8, 2006 at 01:17 UTC
2048bb00ee3937808ce9f0c8f59d71a9b46ab56f
1 file changed
+10
-5
git-clone.sh
+10
-5
@@ -391,11 +391,16 @@ Pull: refs/heads/$head_points_at:$origin_track" &&
391
(cd "$GIT_DIR/$remote_top" && find . -type f -print) |
392
while read dotslref
393
do
394
- name=`expr "$dotslref" : './\(.*\)'` &&
395
- test "$use_separate_remote" = '' && {
396
- test "$head_points_at" = "$name" ||
397
- test "$origin" = "$name"
398
- } ||
394
+ name=`expr "$dotslref" : './\(.*\)'`
395
+ if test "z$head_points_at" = "z$name"
396
+ then
397
+ continue
398
+ fi
399
+ if test "$use_separate_remote" = '' &&
400
+ test "z$origin" = "z$name"
401
+ then
402
+ continue
403
+ fi
404
echo "Pull: refs/heads/${name}:$remote_top/${name}"
405
done >>"$GIT_DIR/remotes/$origin" &&
406
case "$use_separate_remote" in