Skydio / revup

Effortlessly create and manage pull requests without changing branches. Powers a stacked diffs workflow with python and git "plumbing" commands.
https://github.com/Skydio/revup
MIT License
310 stars 59 forks source link

amend: Fix amending HEAD #116

Closed jerry-skydio closed 1 year ago

jerry-skydio commented 1 year ago

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 commented 1 year ago

Reviews in this chain: └https://github.com/Skydio/revup/pull/116 amend: Fix amending HEAD

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