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

fix(amend): support amending merge commits #1073

Merged
merged 1 commit into from
Sep 25, 2023
Merged

fix(amend): support amending merge commits #1073

merged 1 commit into from
Sep 25, 2023

Commits on Sep 24, 2023

  1. fix(amend): support amending merge commits

    Previously, `Repo::get_paths_touched_by_commit` returned `None` if the commit was a merge commit, the idea being that a merge commit doesn't have a single correct "patch". However, no call-site cared about this interpretation, and all call-sites worked just as well or better with the new interpretation, where we return the union of all changed paths with respect to all parents. Usually, the impact is that the dehydrated commit is a slightly larger commit than normal.
    
    `git amend` was failing when `HEAD` was a merge commit for this reason, since the "fast amend" path first dehydrated the current commit. Before this commit, git-branchless would panic; after this commit, it successfully amends the merge commit.
    
    Note that the `--merge` option to `git amend` is unrelated: it deals with restacking and merging descendant commits after the amend has been carried out.
    arxanas committed Sep 24, 2023
    Configuration menu
    Copy the full SHA
    3af54f8 View commit details
    Browse the repository at this point in the history