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

Support git repos with default branches other than "master" #1217

Merged
merged 1 commit into from
Sep 24, 2021

Conversation

hairyhenderson
Copy link
Owner

Fixes #1049

This is a workaround for go-git/go-git#249, as suggested in go-git/go-git#249 (comment).

Ideally go-git would do this for me, but for now this is the best option.

I've altered the tests so that one of the test repos has a default branch of main, to verify the behaviour.

If for some reason the remote's branch can't be determined, the error will be logged but the datasource will continue to defer to go-git's default.

Signed-off-by: Dave Henderson [email protected]

@hairyhenderson hairyhenderson force-pushed the git-use-correct-default-branch-1049 branch from f4a7e36 to c14539e Compare September 24, 2021 16:23
@hairyhenderson hairyhenderson enabled auto-merge (squash) September 24, 2021 16:24
@hairyhenderson hairyhenderson merged commit 67697bb into master Sep 24, 2021
@hairyhenderson hairyhenderson deleted the git-use-correct-default-branch-1049 branch September 24, 2021 16:32
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.

Bug: git datasources with non-master default branches aren't working correctly
1 participant