Skip to content

Commit

Permalink
fix: git operation fials log
Browse files Browse the repository at this point in the history
  • Loading branch information
sshivaditya committed Jan 11, 2025
1 parent 9676f6d commit e29228f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tools/create-pr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class CreatePr implements Tool<PullRequestResult> {
execSync("git add .", { stdio: "pipe" });

// Get status to log what's being committed
const status = execSync("git status --porcelain", { stdio: "pipe" }).toString();
const status = execSync("git status", { stdio: "pipe" }).toString();
this._context.logger.info("Changes to be committed:", { status });

// Only proceed if there are changes to commit
Expand All @@ -64,6 +64,7 @@ export class CreatePr implements Tool<PullRequestResult> {
this._context.logger.info(`Pushing branch ${currentBranch} to remote`);
execSync(`git push origin ${currentBranch}`, { stdio: "pipe" });
} catch (error) {
console.log("Error:", error);
const gitError = error instanceof Error ? error : new Error(String(error));
this._context.logger.error("Git operation failed:", { error: gitError });
throw gitError;
Expand Down

0 comments on commit e29228f

Please sign in to comment.