mirror of
https://git.proxmox.com/git/libgit2
synced 2025-12-26 07:43:01 +00:00
repository: make git_repository_init() value the core.logallrefupdates config entry
This commit is contained in:
parent
976b69bdbb
commit
7623b1b63f
@ -718,6 +718,9 @@ static int repo_init_config(const char *git_dir, bool is_bare, bool is_reinit)
|
||||
SET_REPO_CONFIG(int32, "core.repositoryformatversion", GIT_REPO_VERSION);
|
||||
SET_REPO_CONFIG(bool, "core.filemode", is_chmod_supported(git_buf_cstr(&cfg_path)));
|
||||
|
||||
if (!is_bare)
|
||||
SET_REPO_CONFIG(bool, "core.logallrefupdates", true);
|
||||
|
||||
if (!is_reinit && is_filesystem_case_insensitive(git_dir))
|
||||
SET_REPO_CONFIG(bool, "core.ignorecase", true);
|
||||
/* TODO: what other defaults? */
|
||||
|
||||
@ -241,3 +241,9 @@ void test_repo_init__reinit_doesnot_overwrite_ignorecase(void)
|
||||
|
||||
git_config_free(config);
|
||||
}
|
||||
|
||||
void test_repo_init__sets_logAllRefUpdates_according_to_type_of_repository(void)
|
||||
{
|
||||
assert_config_entry_on_init_bytype("core.logallrefupdates", GIT_ENOTFOUND, true);
|
||||
assert_config_entry_on_init_bytype("core.logallrefupdates", true, false);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user