Preserve cancellation during build source inspection

This commit is contained in:
2026-11-01 21:14:34 +00:00
parent b91a0d1914
commit 28a4144b49
3 changed files with 143 additions and 1 deletions

View File

@@ -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