]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/clone.c
builtin/init-db: allow specifying hash algorithm on command line
[thirdparty/git.git] / builtin / clone.c
index 0fc89ae2b9c77d420153c8bef6680d3324cdf5ad..961996a110330d1c70f770c2d5fe859ebd8ed7b4 100644 (file)
@@ -673,7 +673,7 @@ static void update_remote_refs(const struct ref *refs,
                               const char *msg,
                               struct transport *transport,
                               int check_connectivity,
-                              int check_refs_only)
+                              int check_refs_are_promisor_objects_only)
 {
        const struct ref *rm = mapped_refs;
 
@@ -682,7 +682,8 @@ static void update_remote_refs(const struct ref *refs,
 
                opt.transport = transport;
                opt.progress = transport->progress;
-               opt.check_refs_only = !!check_refs_only;
+               opt.check_refs_are_promisor_objects_only =
+                       !!check_refs_are_promisor_objects_only;
 
                if (check_connected(iterate_ref_map, &rm, &opt))
                        die(_("remote did not send all necessary objects"));
@@ -1096,7 +1097,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
                }
        }
 
-       init_db(git_dir, real_git_dir, option_template, INIT_DB_QUIET);
+       init_db(git_dir, real_git_dir, option_template, GIT_HASH_UNKNOWN, INIT_DB_QUIET);
 
        if (real_git_dir)
                git_dir = real_git_dir;
@@ -1128,7 +1129,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
        if (option_required_reference.nr || option_optional_reference.nr)
                setup_reference();
 
-       if (option_sparse_checkout && git_sparse_checkout_init(repo))
+       if (option_sparse_checkout && git_sparse_checkout_init(dir))
                return 1;
 
        remote = remote_get(option_origin);