8000 Background tasks should use --no-optional-locks to prevent issues with other tools running at the same time. by jessehouwing · Pull Request #370 · justjanne/powerline-go · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Background tasks should use --no-optional-locks to prevent issues with other tools running at the same time. #370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions segment-git.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down Expand Up @@ -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
}
Expand All @@ -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 {
Expand Down Expand Up @@ -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")
}
Expand Down
4 changes: 2 additions & 2 deletions segment-gitlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
}
Expand All @@ -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{}
}
Expand Down
0