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

Feature/Prevent remote being returned as source branch #2859

Conversation

ajsmith27
Copy link
Contributor

Description

I've made a change to the FindCommitBranchWasBranchedFrom method of RepositoryStore in order to re-align it with its previous behaviour prior to v5.6.4. This change enhances the check performed on a branch when determining if it should be returned as a source branch or not, by doing an equivalence check rather than an equality check.

Related Issue

#2801 - though this issue was raised regarding a separate (won't fix) issue, so wonder whether we need a separate issue?

Motivation and Context

Prior to v5.6.4, source branches were compared using an IsSameBranch method, which did an equivalence check on both branches using the NameWithoutRemote method.

In 5.6.4, this was changed to be an equality check. Remote branches fail the equality check and are therefore returned as source branches of local branches. This results in CommitsSinceVersionSource always being 0 when the remote and local branches are in sync, for example when running builds on the build server.

How Has This Been Tested?

I added a new, failing test that demonstrates the behaviour that I'm seeing. I've then applied the fix that resolves my issue and confirmed that all new and existing tests pass.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@asbjornu asbjornu merged commit ac9bc4f into GitTools:main Sep 22, 2021
@asbjornu asbjornu added this to the 5.x milestone Sep 22, 2021
@mergify
Copy link
Contributor

mergify bot commented Sep 22, 2021

Thank you @ajsmith27 for your contribution!

@arturcic arturcic modified the milestones: 5.x, 5.8.0 Oct 3, 2021
@github-actions
Copy link

🎉 This issue has been resolved in version 5.8.0 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants