]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-clone.sh
Add a test for git-add --ignore-errors
[git.git] / git-clone.sh
index 2636159aaa7a6278d9b8fc64b853b319ac8da123..9d88d1ce60d9c34bd16976d403f210fb450940a5 100755 (executable)
@@ -219,6 +219,7 @@ fi
 if test -n "$2"
 then
        dir="$2"
+       test $# = 2 || die "excess parameter to git-clone"
 else
        # Derive one from the repository name
        # Try using "humanish" part of source repo if user didn't specify one
@@ -333,7 +334,10 @@ yes)
                        fi
                fi &&
                cd "$repo" &&
-               find objects -depth -print | cpio $cpio_quiet_flag -pumd$l "$GIT_DIR/" || \
+               # Create dirs using umask and permissions and destination
+               find objects -type d -print | (cd "$GIT_DIR" && xargs mkdir -p) &&
+               # Copy existing 0444 permissions on content
+               find objects ! -type d -print | cpio $cpio_quiet_flag -pumd$l "$GIT_DIR/" || \
                        exit 1
        fi
        git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" || exit 1