karajan-code 4.59.0 → 4.59.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -18,11 +18,14 @@ const baseOf = (range) => {
|
|
|
18
18
|
/** The repo's allow list at the base of the range; empty when the base has no such file. */
|
|
19
19
|
export async function repoPrivacyAllow({ projectDir, range, run = runCommand }) {
|
|
20
20
|
const base = baseOf(range);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
throw new Error(`
|
|
21
|
+
// KJC-BUG-0387: exit codes, never git's messages, which follow the user's language.
|
|
22
|
+
const git = (...args) => run("git", ["-C", projectDir, ...args]);
|
|
23
|
+
if ((await git("rev-parse", "--verify", "--quiet", `${base}^{commit}`)).exitCode !== 0) {
|
|
24
|
+
throw new Error(`cannot read the privacy allow list: the base ${base} is not a commit here`);
|
|
25
25
|
}
|
|
26
|
+
if ((await git("cat-file", "-e", `${base}:${REPO_PRIVACY}`)).exitCode !== 0) return [];
|
|
27
|
+
const res = await git("show", `${base}:${REPO_PRIVACY}`);
|
|
28
|
+
if (res.exitCode !== 0) throw new Error(`git show ${base}:${REPO_PRIVACY} failed: ${(res.stderr || "").trim()}`);
|
|
26
29
|
let raw;
|
|
27
30
|
try {
|
|
28
31
|
raw = parseYaml(res.stdout) || {};
|