Skip to content

Commit ca97826

Browse files
committed
Adjust range-diff rebase comment to use full ranges
1 parent 37cce34 commit ca97826

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/handlers/check_commits/force_push_range_diff.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ pub(super) async fn handle_event(
5151
};
5252

5353
let branch = &base.git_ref;
54+
let (oldbase, oldhead) = (&compare_before.merge_base_commit.sha, before);
55+
let (newbase, newhead) = (&compare_after.merge_base_commit.sha, after);
5456

5557
// Rebase detected, post a comment to our range-diff.
5658
event.issue.post_comment(&ctx.github,
57-
&format!(r#"This PR was rebased onto a different {branch} commit! Check out the changes with our [`range-diff`]({protocol}://{host}/gh-range-diff/{org}/{repo}/{before}..{after})."#)
59+
&format!(r#"This PR was rebased onto a different {branch} commit! Check out the changes with our [`range-diff`]({protocol}://{host}/gh-range-diff/{org}/{repo}/{oldbase}..{oldhead}/{newbase}..{newhead})."#)
5860
).await.context("failed to post range-diff comment")?;
5961

6062
Ok(())

0 commit comments

Comments
 (0)