Skip to content

Commit 75f906f

Browse files
committed
git prompt fixes from holman#302
1 parent 8bad6db commit 75f906f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

macos/set-defaults.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ defaults write com.apple.Finder FXPreferredViewStyle Nlsv
1717
chflags nohidden ~/Library
1818

1919
# Set a really fast key repeat.
20-
defaults write NSGlobalDomain InitialKeyRepeat -int 50
20+
defaults write NSGlobalDomain InitialKeyRepeat -int 15
2121
defaults write NSGlobalDomain KeyRepeat -int 1
2222

2323
# Set the Finder prefs for showing a few different volumes on the Desktop.

zsh/prompt.zsh

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ git_dirty() {
2828
}
2929

3030
git_prompt_info () {
31-
ref=$($git symbolic-ref HEAD 2>/dev/null) || return
31+
ref=$($git symbolic-ref HEAD 2>/dev/null) || (echo "detached HEAD" && return)
3232
# echo "(%{\e[0;33m%}${ref#refs/heads/}%{\e[0m%})"
3333
echo "${ref#refs/heads/}"
3434
}
@@ -39,7 +39,7 @@ git_prompt_info () {
3939
need_push () {
4040
if [ $($git rev-parse --is-inside-work-tree 2>/dev/null) ]
4141
then
42-
number=$($git cherry -v origin/$(git symbolic-ref --short HEAD) 2>/dev/null | wc -l | bc)
42+
number=$($git cherry -v origin/$(git symbolic-ref --short HEAD 2>/dev/null) 2>/dev/null | wc -l | bc)
4343

4444
if [[ $number == 0 ]]
4545
then

0 commit comments

Comments
 (0)