mirror of
				https://github.com/ohmyzsh/ohmyzsh.git
				synced 2024-05-11 05:55:17 +00:00 
			
		
		
		
	Merge pull request #1077 from Mezzle/add-option-to-show-git-status
Add option to disable status notification
This commit is contained in:
		
							
								
								
									
										16
									
								
								lib/git.zsh
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								lib/git.zsh
									
									
									
									
									
								
							@@ -9,13 +9,15 @@ function git_prompt_info() {
 | 
			
		||||
# Checks if working tree is dirty
 | 
			
		||||
parse_git_dirty() {
 | 
			
		||||
  local SUBMODULE_SYNTAX=''
 | 
			
		||||
  if [[ $POST_1_7_2_GIT -gt 0 ]]; then
 | 
			
		||||
        SUBMODULE_SYNTAX="--ignore-submodules=dirty"
 | 
			
		||||
  fi
 | 
			
		||||
  if [[ -n $(git status -s ${SUBMODULE_SYNTAX}  2> /dev/null) ]]; then
 | 
			
		||||
    echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
 | 
			
		||||
  else
 | 
			
		||||
    echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
 | 
			
		||||
  if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
 | 
			
		||||
    if [[ $POST_1_7_2_GIT -gt 0 ]]; then
 | 
			
		||||
          SUBMODULE_SYNTAX="--ignore-submodules=dirty"
 | 
			
		||||
    fi
 | 
			
		||||
    if [[ -n $(git status -s ${SUBMODULE_SYNTAX}  2> /dev/null) ]]; then
 | 
			
		||||
      echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
 | 
			
		||||
    else
 | 
			
		||||
      echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
 | 
			
		||||
    fi
 | 
			
		||||
  fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user