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

ANSI coloring breaks git branch call #157

Closed
diegotori opened this issue Jan 9, 2016 · 0 comments
Closed

ANSI coloring breaks git branch call #157

diegotori opened this issue Jan 9, 2016 · 0 comments

Comments

@diegotori
Copy link

In GitAdapter.gitCurrentBranch(), when it looks up the current repo's branches, if the current bash shell has LSCOLORS enabled, then it will add the following output to the branch call:

Running [git, branch] produced output: [some-other-topic-branch�[m
* �[32msome-topic-branch�[m 
Running [git, push, --porcelain, origin, �[32msome-topic-branch�[m] in [/Users/diegotori/as_projects/some_app] 
Running [git, push, --porcelain, origin, �[32msome-topic-branch�[m] produced output: [] 
Running [git, push, --porcelain, origin, �[32msome-topic-branch�[m] produced an error: [fatal: remote part of refspec is not a valid name in �[32msome-topic-branch�[m] 
:some_app:app:preTagCommit FAILED 

The way to strip out all coloring without resorting to regexes is by calling "git branch" with the "--no-color" option, thus sanitizing the output.

@danez danez closed this as completed in eb47717 Jan 16, 2016
danez added a commit that referenced this issue Jan 16, 2016
Might be related to 159
Closes #157
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

No branches or pull requests

1 participant