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

Update git_worktree_add_options struct to include ref pointer #1890

Merged
merged 1 commit into from
Jul 3, 2021

Conversation

zentron
Copy link
Contributor

@zentron zentron commented Jul 2, 2021

After a recent upgrade of .netcore to 5.0.7 the WorktreeCollection.Add method has begun failing. Testing against earlier .net versions indicate this was not previously a problem.

Digging around in the lib2git repo shows that this git_worktree_add_options struct actually expects a third property that acts as a pointer to the worktree head.

Where this property gets used we can see where the exception comes from that creates the issue surfaced through libgit2sharp.

When this property isn't included on the struct and zeroed out, the native code presumably (possibly?) finds another value in that memory location that doesn't actually point to anything valid, hence the 💥.

Confirmed as fixed in local testing with different frameworks

Fixes #1885

@codecov-commenter
Copy link

codecov-commenter commented Jul 2, 2021

Codecov Report

Merging #1890 (8a61eec) into master (689dcf2) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1890   +/-   ##
=======================================
  Coverage   84.61%   84.61%           
=======================================
  Files         231      231           
  Lines        9175     9176    +1     
=======================================
+ Hits         7763     7764    +1     
  Misses       1412     1412           
Impacted Files Coverage Δ
LibGit2Sharp/Core/GitWorktree.cs 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 689dcf2...8a61eec. Read the comment docs.

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

Successfully merging this pull request may close these issues.

WorktreeCollection.Add throws exception on NET6 Preview 4 (0.27.0-preview-0096)
3 participants