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

Windows msysgit compatibility #232

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<img src="https://user-images.githubusercontent.com/139536/30827652-08e9b684-a265-11e7-95fb-50cbd2fb7c0d.png" width="200" height="200">


## /!\ this version contain a fix to works with windows!

# SCM Breeze [![TravisCI](https://secure.travis-ci.org/scmbreeze/scm_breeze.png?branch=master)](http://travis-ci.org/scmbreeze/scm_breeze)

Expand Down Expand Up @@ -405,4 +405,3 @@ project into an [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) for
SCMs.

***Enjoy!***

2 changes: 1 addition & 1 deletion lib/git/branch_shortcuts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function _scmb_git_branch_shortcuts {

# Use ruby to inject numbers into ls output
ruby -e "$( cat <<EOF
output = %x($_git_cmd branch --color=always $@)
output = %x(git branch --color=always $@)
line_count = output.lines.to_a.size
output.lines.each_with_index do |line, i|
spaces = (line_count > 9 && i < 9 ? " " : " ")
Expand Down
14 changes: 7 additions & 7 deletions lib/git/status_shortcuts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@
# # groups => 1: staged, 2: unmerged, 3: unstaged, 4: untracked
# --------------------------------------------------------------------

@project_root = File.exist?(".git") ? Dir.pwd : `\git rev-parse --show-toplevel 2> /dev/null`.strip
@project_root = File.exist?(".git") ? Dir.pwd : `\git rev-parse --show-toplevel`.strip

@git_status = `\git status --porcelain -b 2> /dev/null`
@git_status = `\git status --porcelain`

git_status_lines = @git_status.split("\n")
git_branch = git_status_lines[0]
@branch = git_branch[/^## (?:Initial commit on )?([^ \.]+)/, 1]
@ahead = git_branch[/\[ahead ?(\d+).*\]/, 1]
@behind = git_branch[/\[.*behind ?(\d+)\]/, 1]
git_branch = `\git branch -v` #git_status_lines[0]
@branch = git_branch[/^\* (?:Initial commit on )?([^ \.]+)/, 1]
@ahead = git_branch[/^\*.*\[ahead ?(\d+).*\]/, 1]
@behind = git_branch[/^\*.*\[.*behind ?(\d+)\]/, 1]

@changes = git_status_lines[1..-1]
@changes = git_status_lines[0..-1]
# Exit if too many changes
exit if @changes.size > ENV["gs_max_changes"].to_i

Expand Down