deepcode-ai 1.1.10 → 1.1.12
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/dist/index.js +14 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10353,19 +10353,24 @@ async function solveIssueCommand(issueNumber, options) {
|
|
|
10353
10353
|
});
|
|
10354
10354
|
await writeStdout("\n");
|
|
10355
10355
|
const status = await runGit(options.cwd, ["status", "--porcelain"]);
|
|
10356
|
-
|
|
10356
|
+
const aheadLog = await runGit(options.cwd, ["log", `origin/${base}..HEAD`, "--oneline"]);
|
|
10357
|
+
const hasUncommitted = Boolean(status.stdout.trim());
|
|
10358
|
+
const hasCommits = Boolean(aheadLog.stdout.trim());
|
|
10359
|
+
if (!hasUncommitted && !hasCommits) {
|
|
10357
10360
|
throw new Error("Agent completed without file changes; no PR was created.");
|
|
10358
10361
|
}
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10365
|
-
|
|
10362
|
+
if (hasUncommitted) {
|
|
10363
|
+
await runGit(options.cwd, ["add", "."]);
|
|
10364
|
+
await runGit(options.cwd, [
|
|
10365
|
+
"commit",
|
|
10366
|
+
"-m",
|
|
10367
|
+
`fix: resolve issue #${issue.number}`,
|
|
10368
|
+
"-m",
|
|
10369
|
+
`${issue.title}
|
|
10366
10370
|
|
|
10367
10371
|
Closes #${issue.number}`
|
|
10368
|
-
|
|
10372
|
+
]);
|
|
10373
|
+
}
|
|
10369
10374
|
await runGit(options.cwd, ["push", "-u", "origin", branch]);
|
|
10370
10375
|
const pr = await client.createPullRequest({
|
|
10371
10376
|
...repo,
|