We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
By default, LibGit2Sharp searches for configuration files in the following places:
%PROGRAMFILES%\Git\etc\gitconfig
/etc/gitconfig
%USERPROFILE%\.gitconfig
~/.gitconfig
Beside the automatic probing for those files, providing with the user with a way to select different config files may come handy.
The text was updated successfully, but these errors were encountered:
Proposed client code (in RepositoryOptionsFixture.cs)
RepositoryOptionsFixture.cs
[Fact] public void CanProvideDifferentConfigurationFilesToARepository() { string globalLocation = Path.Combine(newWorkdir, "my-global-config"); string systemLocation = Path.Combine(newWorkdir, "my-system-config"); const string name = "Adam 'aroben' Roben"; const string email = "[email protected]"; StringBuilder sb = new StringBuilder() .AppendLine("[user]") .AppendFormat("name = {0}{1}", name, Environment.NewLine) .AppendFormat("email = {0}{1}", email, Environment.NewLine); File.WriteAllText(globalLocation, sb.ToString()); var options = new RepositoryOptions { GlobalConfigurationLocation = globalLocation, SystemConfigurationLocation = systemLocation, }; using (var repo = new Repository(BareTestRepoPath, options)) { Assert.True(repo.Config.HasGlobalConfig); Assert.Equal(name, repo.Config.Get<string>("user", "name", null)); Assert.Equal(email, repo.Config.Get<string>("user", "email", null)); repo.Config.Set("help.link", "https://twitter.com/xpaulbettsx/status/205761932626636800", ConfigurationLevel.System); } AssertValueInConfigFile(systemLocation, "xpaulbettsx"); }
Sorry, something went wrong.
🆒
f24fbe6
Released as part of v0.9.5
No branches or pull requests
By default, LibGit2Sharp searches for configuration files in the following places:
%PROGRAMFILES%\Git\etc\gitconfig
or/etc/gitconfig
%USERPROFILE%\.gitconfig
or~/.gitconfig
Beside the automatic probing for those files, providing with the user with a way to select different config files may come handy.
The text was updated successfully, but these errors were encountered: