Skip to content

Commit 7419fef

Browse files
committed
getDiffRanges: decode filename special characters
1 parent 3dd972f commit 7419fef

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/analyze.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import * as configUtils from "./config-utils";
1818
import { addDiagnostic, makeDiagnostic } from "./diagnostics";
1919
import { EnvVar } from "./environment";
2020
import { FeatureEnablement, Feature } from "./feature-flags";
21+
import { decodeGitFilePath } from "./git-utils";
2122
import { isScannedLanguage, Language } from "./languages";
2223
import { Logger, withGroupAsync } from "./logging";
2324
import { DatabaseCreationTimings, EventReport } from "./status-report";
@@ -382,7 +383,9 @@ function getDiffRanges(
382383
// Diff-informed queries expect the file path to be absolute.
383384
const filename = path.join(
384385
actionsUtil.getRequiredInput("checkout_path"),
385-
fileDiff.filename,
386+
// GitHub API preserves non-ASCII characters in file paths as-is, so we only
387+
// need to decode the special characters.
388+
decodeGitFilePath(fileDiff.filename),
386389
);
387390

388391
let currentLine = 0;

0 commit comments

Comments
 (0)