From c1bf1d5af280235f21901da694ec7275e8ae7aa5 Mon Sep 17 00:00:00 2001 From: Von Random Date: Thu, 31 Jan 2019 14:58:16 +0300 Subject: [PATCH] do not spawn more than one git status for current shell --- zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zshrc b/zshrc index 07d0add..606d862 100644 --- a/zshrc +++ b/zshrc @@ -98,7 +98,7 @@ precmd.is_git_repo() { precmd.git() { precmd.is_git_repo || return 0 - local raw_status="$(git --no-optional-locks status --porcelain -bu 2>/dev/null)" + local raw_status="$(flock -w 1 $prompt_state_file git --no-optional-locks status --porcelain -bu 2>/dev/null)" local branch_info full_status git_status= IFS= local staged_count=0 unstaged_count=0 untracked_count=0 unmerged_count=0