mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 19:04:05 +00:00
repository: don't error out if there is no version
git will assume the repository format version is 0 if the value is not there. Do the same.
This commit is contained in:
parent
0c34fa5094
commit
99e11cdd02
@ -931,9 +931,14 @@ bool git_repository__reserved_names(
|
|||||||
|
|
||||||
static int check_repositoryformatversion(git_config *config)
|
static int check_repositoryformatversion(git_config *config)
|
||||||
{
|
{
|
||||||
int version;
|
int version, error;
|
||||||
|
|
||||||
if (git_config_get_int32(&version, config, "core.repositoryformatversion") < 0)
|
error = git_config_get_int32(&version, config, "core.repositoryformatversion");
|
||||||
|
/* git ignores this if the config variable isn't there */
|
||||||
|
if (error == GIT_ENOTFOUND)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (error < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (GIT_REPO_VERSION < version) {
|
if (GIT_REPO_VERSION < version) {
|
||||||
|
Loading…
Reference in New Issue
Block a user