mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-03 17:57:25 +00:00
hey don't stomp on my memory!
This commit is contained in:
parent
46e4227695
commit
aab8f5af4b
@ -203,22 +203,26 @@ static int checkout_blob(
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int retrieve_symlink_caps(git_repository *repo, bool *can_symlink)
|
static int retrieve_symlink_caps(git_repository *repo, bool *out)
|
||||||
{
|
{
|
||||||
git_config *cfg;
|
git_config *cfg;
|
||||||
|
int can_symlink = 0;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
if (git_repository_config__weakptr(&cfg, repo) < 0)
|
if (git_repository_config__weakptr(&cfg, repo) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
error = git_config_get_bool((int *)can_symlink, cfg, "core.symlinks");
|
error = git_config_get_bool(&can_symlink, cfg, "core.symlinks");
|
||||||
|
|
||||||
/* If "core.symlinks" is not found anywhere, default to true. */
|
/* If "core.symlinks" is not found anywhere, default to true. */
|
||||||
if (error == GIT_ENOTFOUND) {
|
if (error == GIT_ENOTFOUND) {
|
||||||
*can_symlink = true;
|
can_symlink = true;
|
||||||
error = 0;
|
error = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (error >= 0)
|
||||||
|
*out = can_symlink;
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user