Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/CLI/RodelCommit/CommitService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,11 @@ private static async Task GenerateCommitAsync(string commitMessage, bool needEdi
_ = await commitProcess.StandardOutput.ReadToEndAsync().ConfigureAwait(false);
var commitError = await commitProcess.StandardError.ReadToEndAsync().ConfigureAwait(false);
await commitProcess.WaitForExitAsync();
if (commitProcess.ExitCode != 0)
{
throw new InvalidOperationException($"git commit failed with exit code {commitProcess.ExitCode}: {commitError}");
}

AnsiConsole.MarkupLine("[green]Commit successfully.[/]");
if (!string.IsNullOrEmpty(commitError))
{
Expand Down Expand Up @@ -550,6 +555,11 @@ private static async Task PushCommitAsync(string commitMessage)
_ = await pushProcess.StandardOutput.ReadToEndAsync().ConfigureAwait(false);
var pushError = await pushProcess.StandardError.ReadToEndAsync().ConfigureAwait(false);
await pushProcess.WaitForExitAsync();
if (pushProcess.ExitCode != 0)
{
throw new InvalidOperationException($"git push failed with exit code {pushProcess.ExitCode}: {pushError}");
}

AnsiConsole.MarkupLine("[green]Push successfully.[/]");
if (!string.IsNullOrEmpty(pushError))
{
Expand Down