Skip to content

Commit

Permalink
Don't sort hunks based on dest_commit.
Browse files Browse the repository at this point in the history
Because each hunk needs to be displaced based on the previously
applied hunk, sorting hunks will change the order in which they are
applied, therefore undoing all our previous calculations.

This fixes #116, but breaks the --one-fixup-per-commit feature in
cases where there is an odd hunk in between some hunks that could've
been merged together.
  • Loading branch information
rbartlensky committed Oct 15, 2024
1 parent 664b274 commit d2e42b6
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ fn run_with_repo(config: &Config, repo: &git2::Repository) -> Result<()> {

let target_always_sha: bool = config::fixup_target_always_sha(repo);

hunks_with_commit.sort_by_key(|h| h.dest_commit.id());
// * apply all hunks that are going to be fixed up into `dest_commit`
// * commit the fixup
// * repeat for all `dest_commit`s
Expand Down

0 comments on commit d2e42b6

Please sign in to comment.