浏览代码

replaced hardcoded origin/{branch-name} with @{upstream} which gets the upstream branch since git 1.7.0

r3dDoX 10 年之前
父节点
当前提交
3c485db8c7
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/git.zsh

+ 1 - 1
lib/git.zsh

@@ -54,7 +54,7 @@ git_remote_status() {
 
 # Checks if there are commits ahead from remote
 function git_prompt_ahead() {
-  if $(echo "$(command git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
+  if $(echo "$(command git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
     echo "$ZSH_THEME_GIT_PROMPT_AHEAD"
   fi
 }