repo->parsed_objects = parsed_object_pool_new();
ALLOC_ARRAY(repo->index, 1);
index_state_init(repo->index, repo);
-
- /*
- * Unfortunately, we need to keep this hack around for the time being:
- *
- * - Not setting up the hash algorithm for `the_repository` leads to
- * crashes because `the_hash_algo` is a macro that expands to
- * `the_repository->hash_algo`. So if Git commands try to access
- * `the_hash_algo` without a Git directory we crash.
- *
- * - Setting up the hash algorithm to be SHA1 by default breaks other
- * commands when running with SHA256.
- *
- * This is another point in case why having global state is a bad idea.
- * Eventually, we should remove this hack and stop setting the hash
- * algorithm in this function altogether. Instead, it should only ever
- * be set via our repository setup procedures. But that requires more
- * work.
- */
- if (repo == the_repository)
- repo_set_hash_algo(repo, GIT_HASH_SHA1);
}
static void expand_base_dir(char **out, const char *in,