Fix HEAD reflog on reference renames - #4294
Closed
tiennou wants to merge 5 commits into
Closed
Conversation
Member
|
Makes sense, thanks! There are a few small issues in the patch, but I currently cannot comment inline. So I'm pointing them out here:
And yet, again we cannot really merge this due to a missing macro like |
Contributor
Author
|
I'll drop the tentative test case from that PR then, and resubmit another one with the testcase + fix. |
Contributor
Author
|
Yes, the (disabled part of the) test added in 3679251 checks that the HEAD reflog looks like git does when the checked-out ref is renamed. |
tiennou
force-pushed
the
fix-ref-rename-reflog
branch
from
July 7, 2017 17:14
3679251 to
6bca1ca
Compare
tiennou
force-pushed
the
fix-ref-rename-reflog
branch
4 times, most recently
from
July 17, 2017 20:42
5595cac to
77bbdb2
Compare
tiennou
force-pushed
the
fix-ref-rename-reflog
branch
from
July 21, 2017 17:56
77bbdb2 to
b2fb925
Compare
tiennou
force-pushed
the
fix-ref-rename-reflog
branch
from
July 21, 2017 18:12
b2fb925 to
5694f2d
Compare
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.
While investigating #4292, I found that we have a few tests related to what shows up in the reflog, scattered in various test cases.
This PR consolidates all "simple" ones in the same place, and also standardize some helper methods (I might convert
reflog_check_entryto something moreclar-y though, because line numbers are nice).I've also added a tentative test case for #4292. The symptoms are that
git_reference_renamereflogs :(which comes from the
git_repository_set_headcall it does).gitdoes this :Fixing that requires special-casing
git_repository_set_headso it doesn't change the reflog, sogit_reference_renamecan append those entries itself. Does that seem correct ?While I'm at it, this raised a question: why is that reflog line triggered by
git_repository_set_head? I'm likely missing something but it might be cleaner to have that handled bygit_checkout_*?