(t *testing.T)
| 61 | if strings.ContainsAny(got, "\n\t") { |
| 62 | t.Fatalf("status line contains raw whitespace: %q", got) |
| 63 | } |
| 64 | if !strings.Contains(got, "prepare_error=fatal:_clone_failed_try_again_later") { |
| 65 | t.Fatalf("status line %q missing normalized prepare error", got) |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | func TestFormatStatusLineRedactsPrepareError(t *testing.T) { |
| 70 | st := model.RepoRuntimeState{PrepareError: "clone https://token@example.com/org/repo.git?access_token=secret failed"} |
| 71 | |
| 72 | got := formatStatusLine(st) |
| 73 | if strings.Contains(got, "token@example.com") || strings.Contains(got, "secret") { |
| 74 | t.Fatalf("status line leaked prepare error credential: %q", got) |
| 75 | } |
| 76 | if !strings.Contains(got, "REDACTED") { |
nothing calls this directly
no test coverage detected