Merge branch 'master' into sp/fast-import
[gitweb.git] / git-clone.sh
index f37eb9d105264294e1dd63beaeb192023a0ec8c6..0f7bbbfb39cb4eb08379b8441b1ceab3d55d18e5 100755 (executable)
@@ -214,7 +214,7 @@ yes)
        GIT_DIR="$D" ;;
 *)
        GIT_DIR="$D/.git" ;;
-esac && export GIT_DIR && git-init-db ${template+"$template"} || usage
+esac && export GIT_DIR && git-init ${template+"$template"} || usage
 
 if test -n "$reference"
 then
@@ -355,7 +355,7 @@ then
        # The name under $remote_top the remote HEAD seems to point at.
        head_points_at=$(
                (
-                       echo "master"
+                       test -f "$GIT_DIR/$remote_top/master" && echo "master"
                        cd "$GIT_DIR/$remote_top" &&
                        find . -type f -print | sed -e 's/^\.\///'
                ) | (
@@ -388,7 +388,7 @@ then
 
                # Set up the mappings to track the remote branches.
                git-repo-config remote."$origin".fetch \
-                       "refs/heads/*:$remote_top/*" '^$' &&
+                       "+refs/heads/*:$remote_top/*" '^$' &&
                rm -f "refs/remotes/$origin/HEAD"
                git-symbolic-ref "refs/remotes/$origin/HEAD" \
                        "refs/remotes/$origin/$head_points_at" &&