This commit is contained in:
Jonas Rylund Glesaaen 2018-04-06 20:05:16 +00:00 committed by GitHub
commit 301c680f78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,6 +49,8 @@ function _ruby_version() {
# Determine the time since last commit. If branch is clean, # Determine the time since last commit. If branch is clean,
# use a neutral color, otherwise colors will vary according to time. # use a neutral color, otherwise colors will vary according to time.
function _git_time_since_commit() { function _git_time_since_commit() {
# Turn off fetching time if oh-my-zsh.hide-status == 1
if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then
# Only proceed if there is actually a commit. # Only proceed if there is actually a commit.
if git log -1 > /dev/null 2>&1; then if git log -1 > /dev/null 2>&1; then
# Get the last commit. # Get the last commit.
@ -76,6 +78,7 @@ function _git_time_since_commit() {
color=$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL color=$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL
echo "$color$commit_age%{$reset_color%}" echo "$color$commit_age%{$reset_color%}"
fi fi
fi
} }
if [[ $USER == "root" ]]; then if [[ $USER == "root" ]]; then