mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-30 00:04:03 +00:00
Merge pull request #3992 from joshtriplett/env-namespace
git_repository_open_ext: fix handling of $GIT_NAMESPACE
This commit is contained in:
commit
2d20551642
@ -613,9 +613,10 @@ static int _git_repository_open_ext_from_env(
|
|||||||
git_repository_set_odb(repo, odb);
|
git_repository_set_odb(repo, odb);
|
||||||
|
|
||||||
error = git__getenv(&alts_buf, "GIT_ALTERNATE_OBJECT_DIRECTORIES");
|
error = git__getenv(&alts_buf, "GIT_ALTERNATE_OBJECT_DIRECTORIES");
|
||||||
if (error == GIT_ENOTFOUND)
|
if (error == GIT_ENOTFOUND) {
|
||||||
giterr_clear();
|
giterr_clear();
|
||||||
else if (error < 0)
|
error = 0;
|
||||||
|
} else if (error < 0)
|
||||||
goto error;
|
goto error;
|
||||||
else {
|
else {
|
||||||
const char *end;
|
const char *end;
|
||||||
@ -638,9 +639,11 @@ static int _git_repository_open_ext_from_env(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
error = git_repository_set_namespace(repo, git_buf_cstr(&namespace_buf));
|
if (git_buf_len(&namespace_buf)) {
|
||||||
if (error < 0)
|
error = git_repository_set_namespace(repo, git_buf_cstr(&namespace_buf));
|
||||||
goto error;
|
if (error < 0)
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
git_repository_set_index(repo, index);
|
git_repository_set_index(repo, index);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user