Fixing unit tests on windows (#813)
* Add Windows stub for orphan cleanup * Fix account switch tests on Windows * Make query session events test portable * Disable beads daemon in query session events test * Add Windows bd stubs for sling tests * Make expandOutputPath test OS-agnostic * Make role_agents test Windows-friendly * Make config path tests OS-agnostic * Make HealthCheckStateFile test OS-agnostic * Skip orphan process check on Windows * Normalize sparse checkout detail paths * Make dog path tests OS-agnostic * Fix bare repo refspec config on Windows * Add Windows process detection for locks * Add Windows CI workflow * Make mail path tests OS-agnostic * Skip plugin file mode test on Windows * Skip tmux-dependent polecat tests on Windows * Normalize polecat paths and AGENTS.md content * Make beads init failure test Windows-friendly * Skip rig agent bead init test on Windows * Make XDG path tests OS-agnostic * Make exec tests portable on Windows * Adjust atomic write tests for Windows * Make wisp tests Windows-friendly * Make workspace find tests OS-agnostic * Fix Windows rig add integration test * Make sling var logging Windows-friendly * Fix sling attached molecule update ordering --------- Co-authored-by: Johann Dirry <johann.dirry@microsea.at>
This commit is contained in:
@@ -188,18 +188,25 @@ func configureHooksPath(repoPath string) error {
|
||||
// and origin/main never appears in refs/remotes/origin/main.
|
||||
// See: https://github.com/anthropics/gastown/issues/286
|
||||
func configureRefspec(repoPath string) error {
|
||||
cmd := exec.Command("git", "-C", repoPath, "config", "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*")
|
||||
gitDir := repoPath
|
||||
if _, err := os.Stat(filepath.Join(repoPath, ".git")); err == nil {
|
||||
gitDir = filepath.Join(repoPath, ".git")
|
||||
}
|
||||
gitDir = filepath.Clean(gitDir)
|
||||
|
||||
var stderr bytes.Buffer
|
||||
cmd.Stderr = &stderr
|
||||
if err := cmd.Run(); err != nil {
|
||||
configCmd := exec.Command("git", "--git-dir", gitDir, "config", "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*")
|
||||
configCmd.Stderr = &stderr
|
||||
if err := configCmd.Run(); err != nil {
|
||||
return fmt.Errorf("configuring refspec: %s", strings.TrimSpace(stderr.String()))
|
||||
}
|
||||
// Fetch to populate refs/remotes/origin/* so worktrees can use origin/main
|
||||
fetchCmd := exec.Command("git", "-C", repoPath, "fetch", "origin")
|
||||
|
||||
fetchCmd := exec.Command("git", "--git-dir", gitDir, "fetch", "origin")
|
||||
fetchCmd.Stderr = &stderr
|
||||
if err := fetchCmd.Run(); err != nil {
|
||||
return fmt.Errorf("fetching origin: %s", strings.TrimSpace(stderr.String()))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user