8000 Head throws unexpected exception when the .git folder is deleted. · Issue #351 · libgit2/libgit2sharp · GitHub
[go: up one dir, main page]

Skip to content
8000

Head throws unexpected exception when the .git folder is deleted. #351

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

Closed
yishaigalatzer opened this issue Feb 22, 2013 · 1 comment
Closed
Milestone

Comments

@yishaigalatzer
Copy link

All through lg2#

Create a folder
Call init
Delete the .git folder
Call repo.Head

Expected: Libgit2sharp exception
Got: ArgumentNullException

See attached callstack
System.ArgumentNullException: Value cannot be null.
Parameter name: reference
at LibGit2Sharp.Core.Ensure.ArgumentNotNull(Object argumentValue, String argumentName)
at LibGit2Sharp.ReferenceWrapper1..ctor(Repository repo, Reference reference, Func2 canonicalNameSelector)
at LibGit2Sharp.Branch..ctor(Repository repo, Reference reference, Func`2 canonicalNameSelector)
at LibGit2Sharp.Branch..ctor(Repository repo, Reference reference, String canonicalName)
at LibGit2Sharp.DetachedHead..ctor(Repository repo, Reference reference)
at LibGit2Sharp.Repository.get_Head()
--> My call

@nulltoken
Copy link
Member

@yishaigalatzer A fix for this issue has been pushed.

However, rather than checking for the complete removal of the .git directory, the test focuses on the removal of the HEAD symref.

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

2 participants
0