chore: use %w for error wrapping
Some checks failed
Security Scan / security (pull_request) Failing after 13s
Test / test (pull_request) Successful in 1m9s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude 2026-02-24 16:24:05 +00:00
parent da9c133f1f
commit 7ef7c3b107
No known key found for this signature in database
GPG key ID: AF404715446AEB41
2 changed files with 4 additions and 4 deletions

View file

@ -306,7 +306,7 @@ func syncPushUpstream(localPath, defaultBranch string) error {
cmd := exec.Command("git", "-C", localPath, "push", "--force", "forge", refspec)
output, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("%s", strings.TrimSpace(string(output)))
return fmt.Errorf("%s: %w", strings.TrimSpace(string(output)), err)
}
return nil
@ -316,7 +316,7 @@ func syncGitFetch(localPath, remote string) error {
cmd := exec.Command("git", "-C", localPath, "fetch", remote)
output, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("%s", strings.TrimSpace(string(output)))
return fmt.Errorf("%s: %w", strings.TrimSpace(string(output)), err)
}
return nil
}

View file

@ -321,7 +321,7 @@ func pushUpstream(localPath, defaultBranch string) error {
cmd := exec.Command("git", "-C", localPath, "push", "--force", "gitea", refspec)
output, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("%s", strings.TrimSpace(string(output)))
return fmt.Errorf("%s: %w", strings.TrimSpace(string(output)), err)
}
return nil
@ -332,7 +332,7 @@ func gitFetch(localPath, remote string) error {
cmd := exec.Command("git", "-C", localPath, "fetch", remote)
output, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("%s", strings.TrimSpace(string(output)))
return fmt.Errorf("%s: %w", strings.TrimSpace(string(output)), err)
}
return nil
}