Skip to content

Commit df3eace

Browse files
Merge master into feature/v2-to-v3-migration
2 parents af36b95 + 29a73ca commit df3eace

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

packages/core/src/codewhisperer/service/transformByQ/transformApiHandler.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ function isExcludedSourceFile(path: string): boolean {
275275
return sourceExcludedExtensions.some((extension) => path.endsWith(extension))
276276
}
277277

278-
// zip all dependency files and all source files excluding "target" (contains large JARs) plus ".git" and ".idea" (may appear in diff.patch)
278+
// zip all dependency files and all source files
279+
// excludes "target" (contains large JARs) plus ".git", ".idea", and ".github" (may appear in diff.patch)
279280
export function getFilesRecursively(dir: string, isDependenciesFolder: boolean): string[] {
280281
const entries = nodefs.readdirSync(dir, { withFileTypes: true })
281282
const files = entries.flatMap((entry) => {
@@ -284,7 +285,12 @@ export function getFilesRecursively(dir: string, isDependenciesFolder: boolean):
284285
if (isDependenciesFolder) {
285286
// include all dependency files
286287
return getFilesRecursively(res, isDependenciesFolder)
287-
} else if (entry.name !== 'target' && entry.name !== '.git' && entry.name !== '.idea') {
288+
} else if (
289+
entry.name !== 'target' &&
290+
entry.name !== '.git' &&
291+
entry.name !== '.idea' &&
292+
entry.name !== '.github'
293+
) {
288294
// exclude the above directories when zipping source code
289295
return getFilesRecursively(res, isDependenciesFolder)
290296
} else {

packages/core/src/test/codewhisperer/commands/transformByQ.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,10 @@ dependencyManagement:
503503
await fs.mkdir(gitFolder)
504504
await fs.writeFile(path.join(gitFolder, 'config'), 'sample content for the test file')
505505

506+
const githubFolder = path.join(tempDir, '.github')
507+
await fs.mkdir(githubFolder)
508+
await fs.writeFile(path.join(githubFolder, 'config'), 'more sample content for the test file')
509+
506510
const zippedFiles = getFilesRecursively(tempDir, false)
507511
assert.strictEqual(zippedFiles.length, 1)
508512
})

0 commit comments

Comments
 (0)