Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

carlosmn
Copy link
Member

This got a bit messy with the constness of git_reference_peel and I'm happy to move that to its own PR if y'all want.

The crux of this is to use git_reference_peel instead of git_reference_resolve so we get the id of the commit regardless of how much wrapping there is around it.

This fixes #4909

We have no need to take a non-const reference. This does involve some other work
to make sure we don't mix const and non-const variables, but by splitting what
we want each variable to do we can also simplify the logic for when we do want
to free a new reference we might have allocated.
We want to allow the creation of annotated commits out of annotated tags and for
that we have to peel the reference all the way to the commit instead of stopping
at the first id it provides.
@carlosmn carlosmn force-pushed the cmn/annotated-from-tag branch from bdba2fb to 6ea9381 Compare December 14, 2018 13:47
@pks-t
Copy link
Member

pks-t commented Dec 19, 2018

No need to split this into multiple PRs, I'd say. Looks good to me, thanks!

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.

git_annotated_commit_from_ref() fails if passed in reference is a tag
2 participants