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