aboutsummaryrefslogtreecommitdiff
path: root/repository.c
diff options
context:
space:
mode:
Diffstat (limited to 'repository.c')
-rw-r--r--repository.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/repository.c b/repository.c
index 8717a1693a..0b8f7ec200 100644
--- a/repository.c
+++ b/repository.c
@@ -4,6 +4,7 @@
#include "hook.h"
#include "odb.h"
#include "config.h"
+#include "gettext.h"
#include "object.h"
#include "lockfile.h"
#include "path.h"
@@ -39,7 +40,7 @@ struct repository *the_repository = &the_repo;
static void set_default_hash_algo(struct repository *repo)
{
const char *hash_name;
- int algo;
+ uint32_t algo;
hash_name = getenv("GIT_TEST_DEFAULT_HASH_ALGO");
if (!hash_name)
@@ -193,18 +194,23 @@ void repo_set_gitdir(struct repository *repo,
repo->gitdir, "index");
}
-void repo_set_hash_algo(struct repository *repo, int hash_algo)
+void repo_set_hash_algo(struct repository *repo, uint32_t hash_algo)
{
repo->hash_algo = &hash_algos[hash_algo];
}
-void repo_set_compat_hash_algo(struct repository *repo, int algo)
+void repo_set_compat_hash_algo(struct repository *repo MAYBE_UNUSED, uint32_t algo)
{
+#ifdef WITH_RUST
if (hash_algo_by_ptr(repo->hash_algo) == algo)
BUG("hash_algo and compat_hash_algo match");
repo->compat_hash_algo = algo ? &hash_algos[algo] : NULL;
if (repo->compat_hash_algo)
repo_read_loose_object_map(repo);
+#else
+ if (algo)
+ die(_("compatibility hash algorithm support requires Rust"));
+#endif
}
void repo_set_ref_storage_format(struct repository *repo,