Preserve cancellation during build source inspection
This commit is contained in:
@@ -257,6 +257,9 @@ func cleanSource(ctx context.Context, repositoryDir string) (bool, error) {
|
||||
command := exec.CommandContext(ctx, "git", "-C", repositoryDir, "status", "--porcelain", "--untracked-files=all")
|
||||
output, err := command.Output()
|
||||
if err != nil {
|
||||
if ctx.Err() != nil {
|
||||
return false, fmt.Errorf("inspect build source: %w", ctx.Err())
|
||||
}
|
||||
return false, fmt.Errorf("inspect build source: %w", err)
|
||||
}
|
||||
return len(output) == 0, nil
|
||||
|
||||
Reference in New Issue
Block a user