Skip to content

Commit

Permalink
fix(amazonq): Skip including deleted files for FeatureDev context. (#…
Browse files Browse the repository at this point in the history
…5228)

Co-authored-by: C Tidd <[email protected]>
  • Loading branch information
ctidd and C Tidd authored Jan 7, 2025
1 parent ba6ab38 commit 05d7054
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type" : "bugfix",
"description" : "Amazon Q /dev: Fix issue when files are deleted while preparing context"
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,12 @@ class FeatureDevSessionContext(val project: Project, val maxProjectSizeBytes: Lo

createTemporaryZipFileAsync { zipOutput ->
filesToIncludeFlow.collect { file ->
val relativePath = Path(file.path).relativeTo(projectRoot.toNioPath())
zipOutput.putNextEntry(relativePath.toString(), Path(file.path))
try {
val relativePath = Path(file.path).relativeTo(projectRoot.toNioPath())
zipOutput.putNextEntry(relativePath.toString(), Path(file.path))
} catch (e: NoSuchFileException) {
// Noop: Skip if file was deleted
}
}
}
}.toFile()
Expand Down

0 comments on commit 05d7054

Please sign in to comment.