bd sync: 2025-12-27 15:56:42
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"github.com/steveyegge/beads/internal/git"
|
||||
"github.com/steveyegge/beads/internal/storage/sqlite"
|
||||
"github.com/steveyegge/beads/internal/types"
|
||||
)
|
||||
@@ -92,11 +91,6 @@ func testFreshCloneAutoImport(t *testing.T) {
|
||||
// Test checkGitForIssues detects issues.jsonl
|
||||
t.Chdir(dir)
|
||||
|
||||
git.ResetCaches() // Reset git caches after changing directory
|
||||
|
||||
git.ResetCaches()
|
||||
|
||||
|
||||
count, path, gitRef := checkGitForIssues()
|
||||
if count != 1 {
|
||||
t.Errorf("Expected 1 issue in git, got %d", count)
|
||||
@@ -176,11 +170,6 @@ func testDatabaseRemovalScenario(t *testing.T) {
|
||||
// Change to test directory
|
||||
t.Chdir(dir)
|
||||
|
||||
git.ResetCaches() // Reset git caches after changing directory
|
||||
|
||||
git.ResetCaches()
|
||||
|
||||
|
||||
// Test checkGitForIssues finds issues.jsonl (canonical name)
|
||||
count, path, gitRef := checkGitForIssues()
|
||||
if count != 2 {
|
||||
@@ -259,11 +248,6 @@ func testLegacyFilenameSupport(t *testing.T) {
|
||||
// Change to test directory
|
||||
t.Chdir(dir)
|
||||
|
||||
git.ResetCaches() // Reset git caches after changing directory
|
||||
|
||||
git.ResetCaches()
|
||||
|
||||
|
||||
// Test checkGitForIssues finds issues.jsonl
|
||||
count, path, gitRef := checkGitForIssues()
|
||||
if count != 1 {
|
||||
@@ -340,11 +324,6 @@ func testPrecedenceTest(t *testing.T) {
|
||||
// Change to test directory
|
||||
t.Chdir(dir)
|
||||
|
||||
git.ResetCaches() // Reset git caches after changing directory
|
||||
|
||||
git.ResetCaches()
|
||||
|
||||
|
||||
// Test checkGitForIssues prefers issues.jsonl
|
||||
count, path, _ := checkGitForIssues()
|
||||
if count != 2 {
|
||||
@@ -391,11 +370,6 @@ func testInitSafetyCheck(t *testing.T) {
|
||||
// Change to test directory
|
||||
t.Chdir(dir)
|
||||
|
||||
git.ResetCaches() // Reset git caches after changing directory
|
||||
|
||||
git.ResetCaches()
|
||||
|
||||
|
||||
// Create empty database (simulating failed import)
|
||||
dbPath := filepath.Join(beadsDir, "test.db")
|
||||
store, err := sqlite.New(context.Background(), dbPath)
|
||||
@@ -435,14 +409,8 @@ func testInitSafetyCheck(t *testing.T) {
|
||||
// Helper functions
|
||||
|
||||
// runCmd runs a command and fails the test if it returns an error
|
||||
// If the command is "git init", it automatically adds --initial-branch=main
|
||||
// for modern git compatibility.
|
||||
func runCmd(t *testing.T, dir string, name string, args ...string) {
|
||||
t.Helper()
|
||||
// Add --initial-branch=main to git init for modern git compatibility
|
||||
if name == "git" && len(args) > 0 && args[0] == "init" {
|
||||
args = append(args, "--initial-branch=main")
|
||||
}
|
||||
cmd := exec.Command(name, args...)
|
||||
cmd.Dir = dir
|
||||
if output, err := cmd.CombinedOutput(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user