Skip to content
New issue

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

Can't access GIT config (Repository.Config) since v0.27.0 #2031

Closed
ozanneconsulting opened this issue Apr 12, 2023 · 6 comments
Closed

Can't access GIT config (Repository.Config) since v0.27.0 #2031

ozanneconsulting opened this issue Apr 12, 2023 · 6 comments

Comments

@ozanneconsulting
Copy link

Reproduction steps

Open an existing repository:
Repository localRepository = new Repository(localPath);

Access localRepository.Config

Expected behavior

Repository.Config gives access to GIT configuration

Actual behavior

Any access of Repository.Config throws an exception:

the ProgramData file 'config' doesn't exist:
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 154
at LibGit2Sharp.Core.Proxy.ConvertPath(Func2 pathRetriever) in /_/LibGit2Sharp/Core/Proxy.cs:line 3801 at LibGit2Sharp.Configuration..ctor(Repository repository, String repositoryConfigurationFileLocation, String globalConfigurationFileLocation, String xdgConfigurationFileLocation, String systemConfigurationFileLocation) in /_/LibGit2Sharp/Configuration.cs:line 46 at LibGit2Sharp.Repository.<>c__DisplayClass25_1.<.ctor>b__3() in /_/LibGit2Sharp/Repository.cs:line 220 at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode)
--- End of stack trace from previous location ---
at System.Lazy`1.CreateValue()

Version of LibGit2Sharp (release number or SHA1)

0.27.0 et 0.27.1 (it works fine in 0.26.2

Operating system(s) tested; .NET runtime tested

Windows 11, .NET 6.0, console application.

@ozanneconsulting
Copy link
Author

This is a duplicate of #2021

@ozanneconsulting ozanneconsulting closed this as not planned Won't fix, can't repro, duplicate, stale Apr 12, 2023
@bording bording reopened this Apr 12, 2023
@bording
Copy link
Member

bording commented Apr 12, 2023

@ozanneconsulting This is actually a slightly different scenario than #2021, so I'm reopening it. #2021 is talking about the behavior when using the default constructor, and your issue is about when you've passed a path to an actual repo.

@arturcic
Copy link
Contributor

@bording can we have a new release ?

@bording
Copy link
Member

bording commented Apr 12, 2023

Fixed in LibGit2Sharp v0.27.2.

@bording bording closed this as completed Apr 12, 2023
@ozanneconsulting
Copy link
Author

@bording I confirm this release fixes my problem.
Thanks for your unbelievable reactivity.

@ethomson
Copy link
Member

Glad to hear it. Seconding my thanks to @bording. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants