mirror of
https://git.proxmox.com/git/libgit2
synced 2025-07-25 16:47:53 +00:00
repository: don't fail to create config option in inmemory repo
When in an in-memory repository - without a configuration file - do not fail to create a configuration object.
This commit is contained in:
parent
9d49a43c71
commit
2d486781df
@ -943,13 +943,10 @@ static int load_config(
|
|||||||
if ((error = git_config_new(&cfg)) < 0)
|
if ((error = git_config_new(&cfg)) < 0)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
error = git_repository_item_path(&config_path, repo, GIT_REPOSITORY_ITEM_CONFIG);
|
if ((error = git_repository_item_path(&config_path, repo, GIT_REPOSITORY_ITEM_CONFIG)) == 0)
|
||||||
if (error < 0)
|
error = git_config_add_file_ondisk(cfg, config_path.ptr, GIT_CONFIG_LEVEL_LOCAL, 0);
|
||||||
goto on_error;
|
|
||||||
|
|
||||||
if ((error = git_config_add_file_ondisk(
|
if (error && error != GIT_ENOTFOUND)
|
||||||
cfg, config_path.ptr, GIT_CONFIG_LEVEL_LOCAL, 0)) < 0 &&
|
|
||||||
error != GIT_ENOTFOUND)
|
|
||||||
goto on_error;
|
goto on_error;
|
||||||
|
|
||||||
git_buf_free(&config_path);
|
git_buf_free(&config_path);
|
||||||
|
Loading…
Reference in New Issue
Block a user