Git-plugin: Get the current action externally
The current action hasn't anything to do with git status
This commit is contained in:
parent
2db2b401e1
commit
f41485a296
1 changed files with 7 additions and 8 deletions
|
@ -235,14 +235,6 @@ function git-info() {
|
|||
(( line_number++ ))
|
||||
|
||||
if (( line_number == 1 )) && [[ "$line" == *'(no branch)'* ]]; then
|
||||
# Get action.
|
||||
action="$(_git-action)"
|
||||
|
||||
# Format action.
|
||||
if [[ -n "$action" ]]; then
|
||||
zstyle -s ':omz:plugin:git:prompt' action 'action_format'
|
||||
zformat -f action_formatted "$action_format" "s:$action"
|
||||
fi
|
||||
elif (( line_number == 1 )) \
|
||||
&& [[ "$line" == (#b)'## Initial commit on '(?##) ]]; then
|
||||
elif (( line_number == 1 )); then
|
||||
|
@ -270,6 +262,13 @@ function git-info() {
|
|||
fi
|
||||
done < <("${(z)status_cmd}" 2>/dev/null)
|
||||
|
||||
# Format action.
|
||||
action="$(_git-action)"
|
||||
if [[ -n "$action" ]]; then
|
||||
zstyle -s ':omz:plugin:git:prompt' action 'action_format'
|
||||
zformat -f action_formatted "$action_format" "s:$action"
|
||||
fi
|
||||
|
||||
# Get current status.
|
||||
while IFS=$'\n' read line; do
|
||||
# Count added, deleted, modified, renamed, unmerged, untracked, dirty.
|
||||
|
|
Loading…
Add table
Reference in a new issue