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

ensure that head refs are dealt with properly #167

Merged
merged 6 commits into from
Mar 21, 2024

Conversation

djeebus
Copy link
Collaborator

@djeebus djeebus commented Mar 21, 2024

when a repo is cloned, it could be cloned with either a named branch OR HEAD. in practice, they could refer to the same branch, and this MR fixes the code so they can be referenced interchangeably, when appropriate.

Copy link

github-actions bot commented Mar 21, 2024

Temporary image deleted.

@djeebus djeebus force-pushed the ensure-head-is-dealt-with branch from 3bd9125 to 8a211f8 Compare March 21, 2024 19:06

repo.BranchName = remoteHeadBranchName
ce.clonedRepos[generateRepoKey(cloneURL, remoteHeadBranchName)] = repo
} else if _, ok := ce.clonedRepos[generateRepoKey(cloneURL, "HEAD")]; !ok {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe simplify this a bit? There's some pretty deeply-nested logic here; splitting this out and maybe using early exit might make this more readable, IMHO.

@djeebus djeebus merged commit 946b84b into main Mar 21, 2024
5 checks passed
@djeebus djeebus deleted the ensure-head-is-dealt-with branch March 21, 2024 23:30
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.

3 participants