GIT 0.99.9f
[git.git] / git-clone.sh
index c27a913..4fdd652 100755 (executable)
@@ -126,8 +126,7 @@ yes,yes)
            fi &&
            rm -f "$D/.git/objects/sample" &&
            cd "$repo" &&
-           find objects -type f -print |
-           cpio -puamd$l "$D/.git/" || exit 1
+           find objects -depth -print | cpio -puamd$l "$D/.git/" || exit 1
            ;;
        yes)
            mkdir -p "$D/.git/objects/info"
@@ -203,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