Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| db52e28f4d |
@@ -5,13 +5,13 @@
|
||||
},
|
||||
"metadata": {
|
||||
"description": "Codex plugins to use in Claude Code for delegation and code review.",
|
||||
"version": "1.0.5"
|
||||
"version": "1.0.6"
|
||||
},
|
||||
"plugins": [
|
||||
{
|
||||
"name": "codex",
|
||||
"description": "Use Codex from Claude Code to review code or delegate tasks.",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"author": {
|
||||
"name": "OpenAI"
|
||||
},
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@openai/codex-plugin-cc",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@openai/codex-plugin-cc",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@types/node": "^25.5.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openai/codex-plugin-cc",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"description": "Use Codex from Claude Code to review code or delegate tasks.",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "codex",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"description": "Use Codex from Claude Code to review code or delegate tasks.",
|
||||
"author": {
|
||||
"name": "OpenAI"
|
||||
|
||||
@@ -8,12 +8,13 @@ const MAX_UNTRACKED_BYTES = 24 * 1024;
|
||||
const DEFAULT_INLINE_DIFF_MAX_FILES = 2;
|
||||
const DEFAULT_INLINE_DIFF_MAX_BYTES = 256 * 1024;
|
||||
|
||||
// Git is directly executable on Windows. Repository-derived arguments must never pass through a shell.
|
||||
function git(cwd, args, options = {}) {
|
||||
return runCommand("git", args, { cwd, ...options });
|
||||
return runCommand("git", args, { cwd, ...options, shell: false });
|
||||
}
|
||||
|
||||
function gitChecked(cwd, args, options = {}) {
|
||||
return runCommandChecked("git", args, { cwd, ...options });
|
||||
return runCommandChecked("git", args, { cwd, ...options, shell: false });
|
||||
}
|
||||
|
||||
function listUniqueFiles(...groups) {
|
||||
|
||||
@@ -9,7 +9,7 @@ export function runCommand(command, args = [], options = {}) {
|
||||
input: options.input,
|
||||
maxBuffer: options.maxBuffer,
|
||||
stdio: options.stdio ?? "pipe",
|
||||
shell: process.platform === "win32" ? (process.env.SHELL || true) : false,
|
||||
shell: options.shell ?? (process.platform === "win32" ? (process.env.SHELL || true) : false),
|
||||
windowsHide: true
|
||||
});
|
||||
|
||||
|
||||
@@ -38,6 +38,35 @@ test("resolveReviewTarget falls back to branch diff when repo is clean", () => {
|
||||
assert.match(context.content, /Branch Diff/);
|
||||
});
|
||||
|
||||
test("default branch names with special characters are passed to git literally", () => {
|
||||
const cwd = makeTempDir();
|
||||
const branchName = "main&branch-helper&x";
|
||||
const helperOutputPath = path.join(cwd, "branch-helper-output");
|
||||
initGitRepo(cwd);
|
||||
fs.writeFileSync(path.join(cwd, "branch-helper.cmd"), "@echo branch-helper>branch-helper-output\r\n");
|
||||
fs.writeFileSync(path.join(cwd, "app.js"), "console.log('base');\n");
|
||||
run("git", ["add", "app.js", "branch-helper.cmd"], { cwd });
|
||||
run("git", ["commit", "-m", "base"], { cwd });
|
||||
run("git", ["branch", "-m", branchName], { cwd, shell: false });
|
||||
run("git", ["update-ref", `refs/remotes/origin/${branchName}`, branchName], { cwd, shell: false });
|
||||
run("git", ["symbolic-ref", "refs/remotes/origin/HEAD", `refs/remotes/origin/${branchName}`], {
|
||||
cwd,
|
||||
shell: false
|
||||
});
|
||||
run("git", ["checkout", "-b", "feature/test"], { cwd });
|
||||
fs.writeFileSync(path.join(cwd, "app.js"), "console.log('feature');\n");
|
||||
run("git", ["add", "app.js"], { cwd });
|
||||
run("git", ["commit", "-m", "feature"], { cwd });
|
||||
|
||||
const target = resolveReviewTarget(cwd, {});
|
||||
const context = collectReviewContext(cwd, target);
|
||||
|
||||
assert.equal(target.mode, "branch");
|
||||
assert.equal(target.baseRef, branchName);
|
||||
assert.match(context.content, /Branch Diff/);
|
||||
assert.equal(fs.existsSync(helperOutputPath), false);
|
||||
});
|
||||
|
||||
test("resolveReviewTarget honors explicit base overrides", () => {
|
||||
const cwd = makeTempDir();
|
||||
initGitRepo(cwd);
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ export function run(command, args, options = {}) {
|
||||
env: options.env,
|
||||
encoding: "utf8",
|
||||
input: options.input,
|
||||
shell: process.platform === "win32" && !path.isAbsolute(command),
|
||||
shell: options.shell ?? (process.platform === "win32" && !path.isAbsolute(command)),
|
||||
windowsHide: true
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user