Skip to content

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
Development

Successfully merging this pull request may close these issues.

make test fails with "command failed: git checkout master: -- error: pathspec 'master' did not match any file(s) known to git"
4 participants