Skip to content

Commit c3840e6

Browse files
committed
getDiffRanges: decode filename special characters
1 parent b4f41bd commit c3840e6

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";
@@ -393,7 +394,9 @@ function getDiffRanges(
393394
// Diff-informed queries expect the file path to be absolute.
394395
const filename = path.join(
395396
actionsUtil.getRequiredInput("checkout_path"),
396-
fileDiff.filename,
397+
// GitHub API preserves non-ASCII characters in file paths as-is, so we only
398+
// need to decode the special characters.
399+
decodeGitFilePath(fileDiff.filename),
397400
);
398401

399402
let currentLine = 0;

0 commit comments

Comments
 (0)