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

amend: Fix amending HEAD #116

Merged
merged 1 commit into from
Apr 27, 2023
Merged

amend: Fix amending HEAD #116

merged 1 commit into from
Apr 27, 2023

Conversation

jerry-skydio
Copy link
Collaborator

Previous change to amend tried to eliminate a double-call
of write-tree, which was both used to elide the final cherrypick
as well as make the temp commit that is used for cherry-picking.
However it erroneously didn't set the top tree for the len == 1
case which meant that amends of HEAD itself did not actually
do any amending.

Fix this by writing the tree in the correct line, and pointing
the temp commit to that tree. This still manages to avoid a
double call to write-tree. Because drop is always false when
making the temp commit, we know the tree must have been written
earlier.

Previous change to amend tried to eliminate a double-call
of write-tree, which was both used to elide the final cherrypick
as well as make the temp commit that is used for cherry-picking.
However it erroneously didn't set the top tree for the len == 1
case which meant that amends of HEAD itself did not actually
do any amending.

Fix this by writing the tree in the correct line, and pointing
the temp commit to that tree. This still manages to avoid a
double call to write-tree. Because drop is always false when
making the temp commit, we know the tree must have been written
earlier.
@jerry-skydio
Copy link
Collaborator Author

Reviews in this chain:
#116 amend: Fix amending HEAD

@jerry-skydio
Copy link
Collaborator Author

# head base diff date summary
0 9fb13d03 059765de diff Apr 27 12:57 PM 1 file changed, 4 insertions(+), 4 deletions(-)

@jerry-skydio jerry-skydio merged commit 1851391 into main Apr 27, 2023
@jerry-skydio jerry-skydio deleted the jerry/revup/main/fixam branch April 27, 2023 20:22
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.

3 participants