That way there is a unified system for how to set values, which may be overridable by configuration variables or not. With this changes, the explicit application of environment variables for setting the cache isn't required anymore as everything happens using git-configuration, and automatically, while providing full control like before.
Showing the changes to git-repository/examples (1 of 12 files). Show all
Unified · Split
| @@ -2,7 +2,7 @@ use git_repository as git; · 1 unmodified line | |||
| 2 | use git_repository::Reference; | 2 | use git_repository::Reference; |
| 3 | 3 | ||
| 4 | fn main() -> Result<(), Box<dyn std::error::Error>> { | 4 | fn main() -> Result<(), Box<dyn std::error::Error>> { |
| 5 | let mut repo = git::discover(".")?.apply_environment(); | 5 | let mut repo = git::discover(".")?; |
| 6 | println!("Repo: {}", repo.work_dir().unwrap_or_else(|| repo.git_dir()).display()); | 6 | println!("Repo: {}", repo.work_dir().unwrap_or_else(|| repo.git_dir()).display()); |
| 7 | let mut max_commit_size = 0; | 7 | let mut max_commit_size = 0; |
| 8 | let mut avg_commit_size = 0; | 8 | let mut avg_commit_size = 0; |