Skip to content

Commit db0bd53

Browse files
msukkariclaude
andcommitted
fix(web): Resolve variable shadowing in getFileSourceApi
Rename local `source` variable (git file content) to `fileContent` to avoid shadowing the `source` parameter, which caused a TypeScript "Block-scoped variable used before declaration" error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 69d8c28 commit db0bd53

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/web/src/features/git/getFileSourceApi.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ export const getFileSource = async ({ path: filePath, repo: repoName, ref }: Fil
6767
repo.defaultBranch ??
6868
'HEAD';
6969

70-
let source: string;
70+
let fileContent: string;
7171
try {
72-
source = await git.raw(['show', `${gitRef}:${filePath}`]);
72+
fileContent = await git.raw(['show', `${gitRef}:${filePath}`]);
7373
} catch (error: unknown) {
7474
const errorMessage = error instanceof Error ? error.message : String(error);
7575
if (errorMessage.includes('does not exist') || errorMessage.includes('fatal: path')) {
@@ -97,7 +97,7 @@ export const getFileSource = async ({ path: filePath, repo: repoName, ref }: Fil
9797
});
9898

9999
return {
100-
source,
100+
source: fileContent,
101101
language,
102102
path: filePath,
103103
repo: repoName,

0 commit comments

Comments
 (0)