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: use correct base in diff #1178

Merged
merged 1 commit into from
Aug 8, 2023
Merged

fix: use correct base in diff #1178

merged 1 commit into from
Aug 8, 2023

Conversation

didroe
Copy link
Contributor

@didroe didroe commented Aug 8, 2023

Description

Use the correct base branch commit for diffing. ie. the latest common ancestor between the base branch and current commit.

Previously we were using the latest commit of the base branch to compare, which is incorrect.

We use the Github API or a passed in SHA (for Gitlab) as a preference, and fall back to computing the merge base commit. If not enough history is present to compute the merge base, an error is raised. This could be extended in future to try and fetch the history.

Related

Checklist

  • I've added test coverage that shows my fix or feature works as expected.
  • I've updated or added documentation if required.
  • I've included usage information in the description if CLI behavior was updated or added.
  • PR title follows Conventional Commits format

@didroe didroe requested a review from elsapet August 8, 2023 09:25
@didroe didroe force-pushed the fix/use-correct-base-in-diff branch from f9a6551 to f5b757d Compare August 8, 2023 09:32
@didroe didroe merged commit a8d2ecb into main Aug 8, 2023
5 checks passed
@didroe didroe deleted the fix/use-correct-base-in-diff branch August 8, 2023 09:38
didroe added a commit that referenced this pull request Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants