1717# 1 || staged, 2 || unmerged, 3 || unstaged, 4 || untracked
1818# --------------------------------------------------------------------
1919git_status_shortcuts () {
20+ if [ " ${scmbDebug:- } " = " true" ]; then
21+ set -x
22+ trap " set +x;" RETURN
23+ fi
24+
2025 fail_if_not_git_repo || return 1
2126 zsh_compat # Ensure shwordsplit is on for zsh
2227 git_clear_vars
@@ -155,8 +160,8 @@ scmb_expand_args() {
155160_print_path () {
156161 local pathname
157162 pathname=$( eval printf ' %s' " \"\$ {$2 }\" " )
158- if [ " $1 " = 1 ]; then # print relative
159- pathname=${pathname# $PWD / } # Remove $PWD from beginning of the path
163+ if [ " $1 " = 1 ]; then # print relative
164+ pathname=${pathname# $PWD / } # Remove $PWD from beginning of the path
160165 fi
161166 printf ' %s' " $pathname "
162167}
@@ -216,7 +221,7 @@ git_commit_prompt() (
216221 saved_commit_msg=" $( cat /tmp/.git_commit_message~) "
217222 echo -e " \033[0;36mLeave blank to use saved commit message: \033[0m$saved_commit_msg "
218223 fi
219- if [[ $shell == " zsh" ]] ; then
224+ if breeze_shell_is " zsh" ; then
220225 vared -h -p " Commit Message: " commit_msg
221226 else
222227 read -r -e -p " Commit Message: " commit_msg
@@ -242,7 +247,7 @@ git_commit_prompt() (
242247 escaped_msg=$( echo " $commit_msg " | sed -e ' s/"/\\"/g' -e " s/!/\" '!'\" /g" )
243248 # Add command to bash history, so that if a git pre-commit hook fails,
244249 # you can just press "up" and "return" to retry the commit.
245- if [[ $shell == " zsh" ]] ; then
250+ if breeze_shell_is " zsh" ; then
246251 # zsh's print needs double escaping
247252 print -s " git commit -m \" ${escaped_msg// \\ / \\\\ } \" "
248253 else
@@ -252,14 +257,14 @@ git_commit_prompt() (
252257 fi
253258
254259 # Also save the commit message to a temp file in case git commit fails
255- echo " $commit_msg " > " /tmp/.git_commit_message~"
260+ echo " $commit_msg " > " /tmp/.git_commit_message~"
256261 eval $@ # run any prequisite commands
257262
258263 echo " $commit_msg " | git commit -F - | tail -n +2
259264
260265 # Fetch the pipe status (for both bash and zsh):
261266 GIT_PIPE_STATUS=(" ${PIPESTATUS[@]}${pipestatus[@]} " )
262- if [[ $shell == " zsh" ]] ; then
267+ if breeze_shell_is " zsh" ; then
263268 git_exit_status=" ${GIT_PIPE_STATUS[2]} " # zsh array indexes start at 1
264269 else
265270 git_exit_status=" ${GIT_PIPE_STATUS[1]} "
0 commit comments