mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
git_dir from rev-parse --git-dir
This commit is contained in:
parent
ab0284b508
commit
185eb8f807
1 changed files with 4 additions and 4 deletions
|
|
@ -12,12 +12,12 @@ zstyle ':vcs_info:*' check-for-changes true
|
|||
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r'
|
||||
zstyle ':vcs_info:*' enable git svn
|
||||
|
||||
# check remote branch
|
||||
# check new commits in remote branchs
|
||||
function git_remotes() {
|
||||
git_dir=$(git rev-parse --git-dir 2> /dev/null ) || return
|
||||
remotes=""
|
||||
if [[ -d .git ]]; then
|
||||
if [[ -n $git_dir ]]; then
|
||||
if [[ $(git branch | awk '{ print $2}') == "master" ]]; then
|
||||
git_dir=$(git rev-parse --git-dir)
|
||||
fetchUpdate=3600
|
||||
remotes=()
|
||||
for remote in $(git remote)
|
||||
|
|
@ -47,7 +47,7 @@ function git_remotes() {
|
|||
fi
|
||||
echo $remotes
|
||||
}
|
||||
local remotes='%B%F{blue}$(git_remotes)%{$reset_color%}'
|
||||
local remotes='%B%F{green}$(git_remotes)%{$reset_color%}'
|
||||
|
||||
precmd () {
|
||||
if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue