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

enhancement: git push command in doInitialCommit function #425

Merged
merged 1 commit into from
Oct 20, 2021

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