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

stop expecting master to be the default branch for git #503

Merged
merged 3 commits into from
Jun 9, 2021
Merged

stop expecting master to be the default branch for git #503

merged 3 commits into from
Jun 9, 2021

Conversation

szabgab
Copy link
Contributor

@szabgab szabgab commented Jun 4, 2021

Fixes #501

@@ -16,6 +16,9 @@ end
def create_git_repository(project, *versions)
Dir.cd(tmp_path) do
run "git init #{Process.quote(project)}"
Dir.cd(Process.quote(project)) do
run "git branch -m master"
Copy link
Member

Choose a reason for hiding this comment

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

I believe this needs to be git checkout --orphan master because at this point there exists no branch that could be moved with branch -m.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both worked on my system, but if you prefer the latter then here it comes.

Copy link
Member

Choose a reason for hiding this comment

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

Can we use main? 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test originally assumed that the default branch is "master". This is not the case for everyone any more. (e.g. I have a default branch called "main"). This PR fixes an assumption of the test that is not correct any more.

If you'd like to change the test to use some other branch name, that, IMHO should be a separate PR.

@oprypin oprypin changed the title stop expecting master to be the default branch for git fixing #501 stop expecting master to be the default branch for git Jun 6, 2021
@straight-shoota straight-shoota merged commit 8e7f80a into crystal-lang:master Jun 9, 2021
@straight-shoota
Copy link
Member

Thanks @szabgab

@szabgab szabgab deleted the fix/expecting-master-as-default-branch branch June 24, 2021 08:15
@straight-shoota straight-shoota added this to the v0.15.0 milestone Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants