summaryrefslogtreecommitdiff
path: root/repository.c
diff options
context:
space:
mode:
Diffstat (limited to 'repository.c')
-rw-r--r--repository.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/repository.c b/repository.c
index a4174dd..6f7f6f0 100644
--- a/repository.c
+++ b/repository.c
@@ -89,6 +89,10 @@ void repo_set_gitdir(struct repository *repo,
void repo_set_hash_algo(struct repository *repo, int hash_algo)
{
repo->hash_algo = &hash_algos[hash_algo];
+#ifndef ENABLE_SHA256
+ if (hash_algo != GIT_HASH_SHA1)
+ die(_("The hash algorithm %s is not supported in this build."), repo->hash_algo->name);
+#endif
}
/*