Merge origin/main, fix test git init for modern git

This commit is contained in:
Steve Yegge
2025-12-27 00:17:36 -08:00
114 changed files with 5869 additions and 787 deletions

View File

@@ -91,8 +91,12 @@ 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)
@@ -171,8 +175,12 @@ 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 {
@@ -250,8 +258,12 @@ 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 {
@@ -327,8 +339,12 @@ 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 {
@@ -374,8 +390,12 @@ 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)