()
| 121 | |
| 122 | // Setup test repository with subdirectories |
| 123 | async function setupTestRepo() { |
| 124 | await fs.ensureDir(TEST_REPO_DIR) |
| 125 | await fs.ensureDir(TEST_SUBDIR) |
| 126 | |
| 127 | // Initialize git repo |
| 128 | gitExec("git init") |
| 129 | gitExec('git config user.email "test@bearly.ai"') |
| 130 | gitExec('git config user.name "Test User"') |
| 131 | |
| 132 | // Create files at different levels |
| 133 | await fs.writeFile(path.join(TEST_REPO_DIR, "root-file.txt"), "Root level file") |
| 134 | await fs.ensureDir(path.join(TEST_REPO_DIR, "subdir")) |
| 135 | await fs.writeFile(path.join(TEST_REPO_DIR, "subdir", "subdir-file.txt"), "Subdirectory file") |
| 136 | await fs.writeFile(path.join(TEST_SUBDIR, "nested-file.txt"), "Nested file") |
| 137 | |
| 138 | // Commit files |
| 139 | gitExec("git add .") |
| 140 | gitExec('git commit -m "Initial commit"') |
| 141 | |
| 142 | // Create main branch explicitly (some git versions use master) |
| 143 | try { |
| 144 | gitExec("git branch -M main") |
| 145 | } catch { |
| 146 | // Already on main |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | // Cleanup test directory |
| 151 | async function cleanupTestRepo() { |
no test coverage detected