Skip to content

Commit 3ba831d

Browse files
author
solominskij
committed
fix: use --dry-run for fetch to prevent blocking git operations
Using --dry-run flag prevents fetch from blocking concurrent git operations like commit and push, while still getting remote information.
1 parent c385f78 commit 3ba831d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/statusline/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func collect(cwd string) repoInfo {
7575
up := git(root, "rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}")
7676
if up != "" {
7777
if parts := strings.SplitN(up, "/", 2); len(parts) == 2 {
78-
_ = git(root, "fetch", "--quiet", "--no-progress", "--prune", parts[0], parts[1])
78+
_ = git(root, "fetch", "--dry-run", "--quiet", "--no-progress", "--prune", parts[0], parts[1])
7979
}
8080
}
8181
}

0 commit comments

Comments
 (0)