mirror of
https://github.com/git-for-windows/git.git
synced 2026-06-24 03:34:47 -05:00
Merge branch 'ty/move-protect-hfs-ntfs' into next
The global configuration variables protect_hfs and protect_ntfs have been migrated into struct repo_config_values to tie them to per-repository configuration state. * ty/move-protect-hfs-ntfs: environment: use 'repo->initialized' for repo_protect_hfs() and repo_protect_ntfs()
This commit is contained in:
@@ -130,14 +130,14 @@ int is_bare_repository(struct repository *repo)
|
||||
|
||||
int repo_protect_ntfs(struct repository *repo)
|
||||
{
|
||||
return repo->gitdir ?
|
||||
return (repo && repo->initialized) ?
|
||||
repo_config_values(repo)->protect_ntfs :
|
||||
PROTECT_NTFS_DEFAULT;
|
||||
}
|
||||
|
||||
int repo_protect_hfs(struct repository *repo)
|
||||
{
|
||||
return repo->gitdir ?
|
||||
return (repo && repo->initialized) ?
|
||||
repo_config_values(repo)->protect_hfs :
|
||||
PROTECT_HFS_DEFAULT;
|
||||
}
|
||||
|
||||
@@ -137,8 +137,8 @@ int git_default_core_config(const char *var, const char *value,
|
||||
|
||||
/*
|
||||
* Getters for the `protect_hfs` and `protect_ntfs` fields of `struct repo_config_values`.
|
||||
* They check `repo->gitdir` to prevent calling repo_config_values()
|
||||
* before the configuration is loaded or in bare environments.
|
||||
* They check `repo->initialized` to prevent calling `repo_config_values()`
|
||||
* before the repository setup is fully complete or in non-git environments.
|
||||
*/
|
||||
int repo_protect_hfs(struct repository *repo);
|
||||
int repo_protect_ntfs(struct repository *repo);
|
||||
|
||||
Reference in New Issue
Block a user