-
-
Notifications
You must be signed in to change notification settings - Fork 286
Add check against main branch hook #1400
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -310,3 +310,10 @@ | |
if not c.out: | ||
return [] | ||
return c.out.split(f"{delimiter}\n") | ||
|
||
|
||
def guess_default_branch() -> str: | ||
c = cmd.run("git branch --format '%(refname:short)' --list master main") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes a strong hypothesis that the reference branch can only be To handle this, I use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess I'll have to try those commands 👀 Looks interesting! I'm thinking of letting users set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that's a good idea. Having guess the default but keeping the possibility to explicitly set it from the configuration 👍🏼 |
||
if c.return_code != 0: | ||
raise GitCommandError(c.err) | ||
return c.out.strip() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already done in refactors branch