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

Git don't throw up when not on some branch #302

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Git don't throw up when not on some branch
spruce committed Jul 31, 2018
commit 5de836b382f66272e5f9bca32ea102492bdecb17
4 changes: 2 additions & 2 deletions zsh/prompt.zsh
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ git_dirty() {
}

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

if [[ $number == 0 ]]
then