git_checkout_tree options fix by steffhip · Pull Request #3907 · libgit2/libgit2 · GitHub
Skip to content

git_checkout_tree options fix#3907

Closed
steffhip wants to merge 3 commits into
libgit2:masterfrom
steffhip:git_checkout_tree-fix
Closed

git_checkout_tree options fix#3907
steffhip wants to merge 3 commits into
libgit2:masterfrom
steffhip:git_checkout_tree-fix

Conversation

@steffhip

Copy link
Copy Markdown
Contributor

According to the reference the git_checkout_tree and git_checkout_head
functions should accept NULL in the opts field

This was broken since the opts field was dereferenced and thus lead to a
crash.

According to the reference the git_checkout_tree and git_checkout_head
functions should accept NULL in the opts field

This was broken since the opts field was dereferenced and thus lead to a
crash.
@Inesteem

Copy link
Copy Markdown

@ethomson

Copy link
Copy Markdown
Member

Definitely looks like a good fix. Could I also trouble you to add a test that calls git_checkout_tree with a NULL opts? Otherwise I think that I'm likely to break this again. ;)

Thanks!

@pks-t

pks-t commented Aug 29, 2016

Copy link
Copy Markdown
Member

Thanks for the fix and test. Considering it is only one test and we already have tests for git_checkout_tree, could you maybe move the test into tests/checkout/tree.c? Thanks 👍

@pks-t

pks-t commented Aug 30, 2016

Copy link
Copy Markdown
Member

Manually squashed and merged via a08e882

@pks-t pks-t closed this Aug 30, 2016
@pks-t

pks-t commented Aug 30, 2016

Copy link
Copy Markdown
Member

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.

4 participants