Commit 7623b1b6 by nulltoken

repository: make git_repository_init() value the core.logallrefupdates config entry

parent 976b69bd
......@@ -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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment