summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2023-04-08 20:32:10 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2023-04-10 14:21:16 +0100
commit47868ee45bc1f8680288caebec5a0443bceda12d (patch)
treedf97f86d8ead64f08ea8a8d2048d191a1166f16d /src
parentdb2a794dda2b6f92291b3758507f863f39314c72 (diff)
downloadlibgit2-47868ee45bc1f8680288caebec5a0443bceda12d.tar.gz
repo: use `GIT_OID_DEFAULT` for default oid type
Diffstat (limited to 'src')
-rw-r--r--src/libgit2/repository.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libgit2/repository.c b/src/libgit2/repository.c
index 4bf92dcdc..804e436ab 100644
--- a/src/libgit2/repository.c
+++ b/src/libgit2/repository.c
@@ -934,7 +934,7 @@ static int obtain_config_and_set_oid_type(
if ((error = load_objectformat(repo, config)) < 0)
goto out;
} else {
- repo->oid_type = GIT_OID_SHA1;
+ repo->oid_type = GIT_OID_DEFAULT;
}
out:
@@ -1804,7 +1804,7 @@ static int load_objectformat(git_repository *repo, git_config *config)
if ((error = git_config_get_entry(&entry, config, "extensions.objectformat")) < 0) {
if (error == GIT_ENOTFOUND) {
- repo->oid_type = GIT_OID_SHA1;
+ repo->oid_type = GIT_OID_DEFAULT;
git_error_clear();
error = 0;
}
@@ -2240,7 +2240,7 @@ static int repo_init_config(
SET_REPO_CONFIG(bool, "receive.denyNonFastforwards", true);
}
- if (oid_type != GIT_OID_SHA1) {
+ if (oid_type != GIT_OID_DEFAULT) {
SET_REPO_CONFIG(int32, "core.repositoryformatversion", 1);
SET_REPO_CONFIG(string, "extensions.objectformat", git_oid_type_name(oid_type));
}