mirror of
1
Fork 0

[BUG] Use correct format

- `%w` is to wrap errors, but can only be used by `fmt.Errorf`. Instead
use `%v` to display the error.
- Regression of #2763

Before:
[E] failed to run attr-check. Error: %!w(*exec.ExitError=&{0xc006568e28 []})
Stderr: fatal: this operation must be run in a work tree

After:
[E] failed to run attr-check. Error: exit status 128
Stderr: fatal: this operation must be run in a work tree
This commit is contained in:
Gusted 2024-03-28 22:27:53 +01:00
parent a11116602e
commit 1ebf4abddc
No known key found for this signature in database
GPG Key ID: FD821B732837125F
1 changed files with 1 additions and 1 deletions

View File

@ -268,7 +268,7 @@ func (repo *Repository) GitAttributeChecker(treeish string, attributes ...string
if err != nil && // If there is an error we need to return but:
cmd.parentContext.Err() != err && // 1. Ignore the context error if the context is cancelled or exceeds the deadline (RunWithContext could return c.ctx.Err() which is Canceled or DeadlineExceeded)
err.Error() != "signal: killed" { // 2. We should not pass up errors due to the program being killed
log.Error("failed to run attr-check. Error: %w\nStderr: %s", err, stdErr.String())
log.Error("failed to run attr-check. Error: %v\nStderr: %s", err, stdErr.String())
}
}()