-
Notifications
You must be signed in to change notification settings - Fork 3
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
Configure default branch name #60
Conversation
I refactored the tests calling |
@mdpiper Thanks for doing this! I combined the branch checks into one parametrized test for the Python tests. One thing I noticed is that it appears the |
@mdpiper I removed the dependency of the tests being run in a particular order (i.e. |
@mcflugen Thank you for improving the tests in this PR. I like the way you parameterized the branches (I need to do a better job reading the pytest docs), and I agree that the tests should be independent, even if it's a little inefficient. The |
I don't know. I think I would rather check for functionality rather than a particular version. So maybe something along these lines, try:
git.Repo.init(".", initial_branch="main")
except git.exc.CommandError as err:
if "unknown option" in str(err) and "initial-branch" in str(err):
warnings.warn("old version of git, --initial-branch is not available")
git.Repo.init(".") although that's not great. What do we want to happen if the user has an older version? I guess the options are to either exit the program with an error or ignore a provided github_branch value. Of course the longer we delay this, the less of an issue it becomes so there is also a case to be made for procrastination. |
Solved by recent versions of |
Currently in the babelizer, the default git branch name of the babelized library is set to "master", and there isn't a way to change it. This PR updates the babelizer to allow a user to set a name for the default branch. If no name is set, the name "main" is used as a default.
This fixes #58.