Skip to content

Commit d2e42b6

Browse files
committed
Don't sort hunks based on dest_commit.
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.
1 parent 664b274 commit d2e42b6

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ fn run_with_repo(config: &Config, repo: &git2::Repository) -> Result<()> {
270270

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

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

0 commit comments

Comments
 (0)