clone: drop connectivity check for local clones
[gitweb.git] / builtin / clone.c
index 58fee9874f0fea4ed52acf31f757268be5383267..38a0a64c61659a99f9c9243dd834a23ea81508f1 100644 (file)
@@ -387,7 +387,7 @@ static void clone_local(const char *src_repo, const char *dest_repo)
 static const char *junk_work_tree;
 static const char *junk_git_dir;
 static pid_t junk_pid;
-enum {
+static enum {
        JUNK_LEAVE_NONE,
        JUNK_LEAVE_REPO,
        JUNK_LEAVE_ALL
@@ -542,12 +542,15 @@ static void update_remote_refs(const struct ref *refs,
                               const struct ref *mapped_refs,
                               const struct ref *remote_head_points_at,
                               const char *branch_top,
-                              const char *msg)
+                              const char *msg,
+                              int check_connectivity)
 {
        const struct ref *rm = mapped_refs;
 
-       if (check_everything_connected(iterate_ref_map, 0, &rm))
-               die(_("remote did not send all necessary objects"));
+       if (check_connectivity) {
+               if (check_everything_connected(iterate_ref_map, 0, &rm))
+                       die(_("remote did not send all necessary objects"));
+       }
 
        if (refs) {
                write_remote_refs(mapped_refs);
@@ -950,7 +953,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
                transport_fetch_refs(transport, mapped_refs);
 
        update_remote_refs(refs, mapped_refs, remote_head_points_at,
-                          branch_top.buf, reflog_msg.buf);
+                          branch_top.buf, reflog_msg.buf, !is_local);
 
        update_head(our_head_points_at, remote_head, reflog_msg.buf);