(t *testing.T)
| 192 | } |
| 193 | |
| 194 | func TestRemoteIdentity(t *testing.T) { |
| 195 | repo := initBareRepo(t) |
| 196 | // No origin remote yet: identity is empty. |
| 197 | p := NewWorkspaceProvider(repo, nil) |
| 198 | if got := p.RemoteIdentity(context.Background()); got != "" { |
| 199 | t.Errorf("RemoteIdentity without origin = %q, want empty", got) |
| 200 | } |
| 201 | // Add an origin with an embedded credential; identity must be credential-free. |
| 202 | runGitTest(t, repo, "remote", "add", "origin", "https://user:secret@example.com/acme/widget.git") |
| 203 | if got := p.RemoteIdentity(context.Background()); got != "example.com/acme/widget" { |
| 204 | t.Errorf("RemoteIdentity = %q, want %q", got, "example.com/acme/widget") |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | func TestResolveInput_UnbornWorkspace(t *testing.T) { |
| 209 | repo := initBareRepo(t) // no commits: HEAD is unborn |
nothing calls this directly
no test coverage detected