Keep push recovery on captured endpoint
This commit is contained in:
@@ -92,12 +92,16 @@ func InspectLocalTag(ctx context.Context, repositoryDir, version, expectedObject
|
||||
return nil
|
||||
}
|
||||
|
||||
// QueryTag reads one exact authoritative version tag and its peeled commit.
|
||||
// Failed reads are unreadable and never interpreted as absence.
|
||||
// QueryTag verifies the captured endpoint still resolves to itself, then reads
|
||||
// one exact authoritative version tag and its peeled commit. Failed
|
||||
// verification or reads are unreadable and never interpreted as absence.
|
||||
func (endpoint Endpoint) QueryTag(ctx context.Context, repositoryDir, version string) (RemoteRef, error) {
|
||||
if !validVersionRef(version) {
|
||||
return RemoteRef{}, fmt.Errorf("invalid version tag name %q", version)
|
||||
}
|
||||
if err := endpoint.verifyScopedURLs(ctx, repositoryDir); err != nil {
|
||||
return RemoteRef{State: RefUnreadable}, fmt.Errorf("%w: verify authoritative endpoint before tag query: %w", ErrRemoteStateUnreadable, err)
|
||||
}
|
||||
ref := "refs/tags/" + version
|
||||
peeledRef := ref + "^{}"
|
||||
output, err := run(ctx, repositoryDir, endpoint.scopedConfig(), "ls-remote", endpoint.ScopedName, ref, peeledRef)
|
||||
|
||||
Reference in New Issue
Block a user