RemoteIdentity returns a stable, credential-free identity string for the repository's "origin" remote, suitable for hashing into the run manifest's repository.identity_sha256. It reads the configured origin URL and canonicalizes it — dropping any embedded userinfo, query and fragment (so credentials
(ctx context.Context)
| 412 | // it was cloned. It returns "" when there is no origin remote, or when origin is |
| 413 | // a local-filesystem remote (the caller then omits repository identity). |
| 414 | func (p *Provider) RemoteIdentity(ctx context.Context) string { |
| 415 | out, err := p.runGit(ctx, "remote", "get-url", "origin") |
| 416 | if err != nil { |
| 417 | return "" |
| 418 | } |
| 419 | return canonicalRemote(firstLine(out)) |
| 420 | } |
| 421 | |
| 422 | // canonicalRemote reduces a git remote URL to a stable, credential-free identity |
| 423 | // string for hashing into repository.identity_sha256, so the same repository |