fix(lint): resolve all golangci-lint errors
- Mark unused ctx parameter with underscore in getRepoRootForWorktree
- Replace exec.Command("test", "-d") with os.Stat for directory check
- Handle file.Close() errors properly in compact.go and migrate_tombstones.go
- Explicitly ignore cleanup errors with _ assignment
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ package git
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -106,7 +107,7 @@ func GetMainRepoRoot() (string, error) {
|
||||
commonDir := getGitDirNoError("--git-common-dir")
|
||||
if commonDir != "" {
|
||||
// Validate that commonDir exists
|
||||
if _, err := exec.Command("test", "-d", commonDir).Output(); err == nil {
|
||||
if info, err := os.Stat(commonDir); err == nil && info.IsDir() {
|
||||
return filepath.Dir(commonDir), nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user