diff --git a/segment-git.go b/segment-git.go index 2226d766..4d817b10 100644 --- a/segment-git.go +++ b/segment-git.go @@ -121,9 +121,9 @@ func parseGitBranchInfo(status []string) map[string]string { } func getGitDetachedBranch(p *powerline) string { - out, err := runGitCommand("git", "rev-parse", "--short", "HEAD") + out, err := runGitCommand("git", "--no-optional-locks", "rev-parse", "--short", "HEAD") if err != nil { - out, err := runGitCommand("git", "symbolic-ref", "--short", "HEAD") + out, err := runGitCommand("git", "--no-optional-locks", "symbolic-ref", "--short", "HEAD") if err != nil { return "Error" } @@ -160,7 +160,7 @@ func parseGitStats(status []string) repoStats { } func repoRoot(path string) (string, error) { - out, err := runGitCommand("git", "rev-parse", "--show-toplevel") + out, err := runGitCommand("git", "--no-optional-locks", "rev-parse", "--show-toplevel") if err != nil { return "", err } @@ -187,7 +187,7 @@ func segmentGit(p *powerline) []pwl.Segment { } args := []string{ - "status", "--porcelain", "-b", "--ignore-submodules", + "--no-optional-locks", "status", "--porcelain", "-b", "--ignore-submodules", } if p.cfg.GitAssumeUnchangedSize > 0 { @@ -262,7 +262,7 @@ func segmentGit(p *powerline) []pwl.Segment { } if stashEnabled { - out, err = runGitCommand("git", "rev-list", "-g", "refs/stash") + out, err = runGitCommand("git", "--no-optional-locks", "rev-list", "-g", "refs/stash") if err == nil { stats.stashed = strings.Count(out, "\n") } diff --git a/segment-gitlite.go b/segment-gitlite.go index b7f535e9..0b21293a 100644 --- a/segment-gitlite.go +++ b/segment-gitlite.go @@ -8,7 +8,7 @@ import ( func segmentGitLite(p *powerline) []pwl.Segment { if len(p.ignoreRepos) > 0 { - out, err := runGitCommand("git", "rev-parse", "--show-toplevel") + out, err := runGitCommand("git", "--no-optional-locks", "rev-parse", "--show-toplevel") if err != nil { return []pwl.Segment{} } @@ -18,7 +18,7 @@ func segmentGitLite(p *powerline) []pwl.Segment { } } - out, err := runGitCommand("git", "rev-parse", "--abbrev-ref", "HEAD") + out, err := runGitCommand("git", "--no-optional-locks", "rev-parse", "--abbrev-ref", "HEAD") if err != nil { return []pwl.Segment{} }