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

Update issue #434: trim \n out #435

Closed
wants to merge 1 commit into from

Conversation

aserputov
Copy link

Resolve #434.

@davidcheung
Copy link
Contributor

Hi @aserputov
Sorry didn't really make the issue clear originally, the problem is the output of the getInitDefaultBranch() from exec comes back with a \n so when its appended to the list of cmds it also have the linebreak in there

args:        []string{"push", "-u", "origin", initDefaultBranch},

cmd := exec.Command("git", "config", "--get", "init.defaultBranch")
output, err := cmd.CombinedOutput()

@aserputov
Copy link
Author

aserputov commented Nov 20, 2021

@davidcheung I hope I'm correct. After checking how the file is working, I think the "%s" might create a new line.
What else could it be?

description: fmt.Sprintf("git push -u origin %s", initDefaultBranch),
command: "git",
args: []string{"push", "-u", "origin", initDefaultBranch},

@davidcheung
Copy link
Contributor

I suspect it is from the git config --get init.defaultBranch command, for printing nicely in stdout they may have appended a linebreak, we could probably trim it out from the output

@aserputov aserputov closed this Feb 24, 2022
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.

zero create: defaultBranch cmd output from git includes linebreak
2 participants