Correct "new" id for reattached-HEAD reflog entry#2095
Merged
vmg merged 3 commits intodevelopmentfrom Feb 3, 2014
Merged
Conversation
src/refdb_fs.c
Outdated
Member
There was a problem hiding this comment.
I think we should check the failure case here?
Member
Author
There was a problem hiding this comment.
Maybe? What if the new target branch is unborn? Doing a if (call < 0) goto cleanup here causes that functionality to fail.
Maybe we don't care about a failure; if we can't resolve the new target reference to an OID, we use zeros. Is that okay?
Member
There was a problem hiding this comment.
Is there an explicit exit code from git_reference_symbolic_target() in that case? (GIT_ENOTFOUND?)
I think we should test for that error and giterr_clear() if we find it and abort on other errors.
vmg
pushed a commit
that referenced
this pull request
Feb 3, 2014
Correct "new" id for reattached-HEAD reflog entry
phatblat
pushed a commit
to phatblat/libgit2
that referenced
this pull request
Sep 13, 2014
Correct "new" id for reattached-HEAD reflog entry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expected: the last reflog entry's "new" id should be the ID of
HEAD^{commit}Actual: A zero ID, like so:
I fixed the issue, and added more complete test coverage for detaching and reattaching HEAD.