Skip to content

Commit

Permalink
Merge pull request #77 from plexigras/git-chroma-branch
Browse files Browse the repository at this point in the history
added branch to git chroma
  • Loading branch information
psprint committed Sep 8, 2018
2 parents 63fd154 + a6555c8 commit 79ecce8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions chroma/-git.ch
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ if (( __first_call )); then
FAST_HIGHLIGHT[chrome-git-occurred-double-hyphen]=0
FAST_HIGHLIGHT[chroma-git-checkout-new]=0
FAST_HIGHLIGHT[chroma-git-fetch-multiple]=0
FAST_HIGHLIGHT[chroma-git-branch-change]=0
return 1
else
# Following call, i.e. not the first one
Expand Down Expand Up @@ -209,6 +210,25 @@ else
__style=${FAST_THEME_NAME}incorrect-subtle
fi
fi
elif [[ "${FAST_HIGHLIGHT[chroma-git-subcommand]}" = "branch" ]]; then
if [[ "$__wrd" = --delete \
|| "$__wrd" = --edit-description \
|| "$__wrd" = --set-upstream-to=* \
|| "$__wrd" = --unset-upstream \
|| "$__wrd" = -d \
|| "$__wrd" = -D ]]; then
FAST_HIGHLIGHT[chroma-git-branch-change]=1
return 1
elif [[ "$__wrd" != -* ]]; then
-fast-run-git-command "git for-each-ref --format='%(refname:short)' refs/heads" "chroma-git-branches" "refs/heads"
if [[ -n ${__lines_list[(r)$__wrd]} ]]; then
__style=${FAST_THEME_NAME}correct-subtle
elif (( FAST_HIGHLIGHT[chroma-git-branch-change] )); then
__style=${FAST_THEME_NAME}incorrect-subtle
fi
else
return 1
fi
else
return 1
fi
Expand Down

0 comments on commit 79ecce8

Please sign in to comment.