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)
| 473 | // it was cloned. It returns "" when there is no origin remote, or when origin is |
| 474 | // a local-filesystem remote (the caller then omits repository identity). |
| 475 | func (p *Provider) RemoteIdentity(ctx context.Context) string { |
| 476 | out, err := p.runGit(ctx, "remote", "get-url", "origin") |
| 477 | if err != nil { |
| 478 | return "" |
| 479 | } |
| 480 | return canonicalRemote(firstLine(out)) |
| 481 | } |
| 482 | |
| 483 | // canonicalRemote reduces a git remote URL to a stable, credential-free identity |
| 484 | // string for hashing into repository.identity_sha256, so the same repository |