Use $_git_cmd internally
This commit is contained in:
@@ -14,7 +14,7 @@ unalias $git_branch_alias > /dev/null 2>&1; unset -f $git_branch_alias > /dev/nu
|
|||||||
function _scmb_git_branch_shortcuts {
|
function _scmb_git_branch_shortcuts {
|
||||||
# Use ruby to inject numbers into ls output
|
# Use ruby to inject numbers into ls output
|
||||||
ruby -e "$( cat <<EOF
|
ruby -e "$( cat <<EOF
|
||||||
output = %x(script -q -c "git branch --color=always \"$@\"" /dev/null)
|
output = %x(script -q -c "$_git_cmd branch --color=always \"$@\"" /dev/null)
|
||||||
line_count = output.lines.to_a.size
|
line_count = output.lines.to_a.size
|
||||||
output.lines.each_with_index do |line, i|
|
output.lines.each_with_index do |line, i|
|
||||||
spaces = (line_count > 9 && i < 9 ? " " : " ")
|
spaces = (line_count > 9 && i < 9 ? " " : " ")
|
||||||
@@ -25,7 +25,7 @@ EOF
|
|||||||
|
|
||||||
# Set numbered file shortcut in variable
|
# Set numbered file shortcut in variable
|
||||||
local e=1
|
local e=1
|
||||||
for branch in $(git branch "$@" | sed "s/^[* ]\{2\}//"); do
|
for branch in $($_git_cmd branch "$@" | sed "s/^[* ]\{2\}//"); do
|
||||||
export $git_env_char$e="$branch"
|
export $git_env_char$e="$branch"
|
||||||
if [ "${scmbDebug:-}" = "true" ]; then echo "Set \$$git_env_char$e => $file"; fi
|
if [ "${scmbDebug:-}" = "true" ]; then echo "Set \$$git_env_char$e => $file"; fi
|
||||||
let e++
|
let e++
|
||||||
|
|||||||
Reference in New Issue
Block a user