Skip to content

Conversation

gmlwo530
Copy link
Contributor

enhancement: git push command use branch name from init.defaultBranch in git config.

(For #424)

output, err := cmd.CombinedOutput()

if err != nil {
initDefaultBranch = "master"
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's return main instead, as this is the default in GitHub anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, mind sticking with the Go convention of having the happy path be left aligned without the explicit else? Like:

if err != nil {
 return "main"
}
return string(output)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback! I will fix it and push on gmlwo530:initialCommit.

Copy link
Contributor

@bmonkman bmonkman left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@bmonkman bmonkman merged commit 0c9bf0c into commitdev:main Oct 20, 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.

2 participants