environment: move "core.attributesfile" into repo-setting #2126
+28
−21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When handling multiple repositories within the same process, relying on global state for accessing the "core.attributesfile" configuration can lead to incorrect values being used. It also makes it harder to isolate repositories and hinders the libification of git.
The functions
bootstrap_attr_stack()andgit_attr_val_system()retrieve "core.attributesfile" viagit_attr_global_file()which reads from global stategit_attributes_file.Move the "core.attributesfile" configuration into the
struct repo_settingsinstead of relying on the global state. A new functionrepo_settings_get_attributesfile_path()is added and used to retrieve this setting in a repository-scoped manner. The functions to retrieve "core.attributesfile" are replaced with the new accessor functionrepo_settings_get_attributesfile_path()This improves multi-repository behaviour and aligns with the goal of libifying of Git.Reported-by: Ayush Chandekar [email protected]
Mentored-by: Christian Couder [email protected]
Mentored-by: Usman Akinyemi [email protected]
Thanks for taking the time to contribute to Git! Please be advised that the
Git community does not use github.com for their contributions. Instead, we use
a mailing list ([email protected]) for code submissions, code reviews, and
bug reports. Nevertheless, you can use GitGitGadget (https://gitgitgadget.github.io/)
to conveniently send your Pull Requests commits to our mailing list.
For a single-commit pull request, please leave the pull request description
empty: your commit message itself should describe your changes.
Please read the "guidelines for contributing" linked above!