func (p *processor) isRepoCurrentlyCloning(ctx context.Context, repoID int, commit string) (_ bool, err error) {
	ctx, endOperation := p.metrics.RepoStateOperation.With(ctx, &err, observation.Args{})
	defer endOperation(1, observation.Args{})

	repo, err := backend.Repos.Get(ctx, api.RepoID(repoID))
	if err != nil {
		return false, errors.Wrap(err, "Repos.Get")
	}

	if _, err := backend.Repos.ResolveRev(ctx, repo, commit); err != nil {
		if vcs.IsCloneInProgress(err) {
			return true, nil
		}

		return false, errors.Wrap(err, "Repos.ResolveRev")
	}

	return false, nil
}
// isRepoCurrentlyCloning determines if the target repository is currently being cloned.
// This function returns an error if the repo or commit cannot be resolved.
isRepoCurrentlyCloning determines if the target repository is currently being cloned.
This function returns an error if the repo or commit cannot be resolved.
// isRepoCurrentlyCloning determines if the target repository is currently being cloned . // This function returns an error if the repo or commit cannot be resolved .
func (p *processor) isRepoCurrentlyCloning(ctx context.Context, repoID int, commit string) (_ bool, err error) {
	ctx, endOperation := p.metrics.RepoStateOperation.With(ctx, &err, observation.Args{})
	defer endOperation(1, observation.Args{})
	repo, err := backend.Repos.Get(ctx, api.RepoID(repoID))
	if err != nil {
		return false, errors.Wrap(err, "Repos.Get")
	}
	if _, err := backend.Repos.ResolveRev(ctx, repo, commit); err != nil {
		if vcs.IsCloneInProgress(err) {
			return true, nil
		}
		return false, errors.Wrap(err, "Repos.ResolveRev")
	}
	return false, nil
}
func ( p * processor ) isRepoCurrentlyCloning ( ctx context . Context , repoID int , commit string ) ( _ bool , err error ) { ctx , endOperation := p . metrics . RepoStateOperation . With ( ctx , & err , observation . Args { } ) defer endOperation ( 1 , observation . Args { } ) repo , err := backend . Repos . Get ( ctx , api . RepoID ( repoID ) ) if err != nil { return false , errors . Wrap ( err , " " ) } if _ , err := backend . Repos . ResolveRev ( ctx , repo , commit ) ; err != nil { if vcs . IsCloneInProgress ( err ) { return true , nil } return false , errors . Wrap ( err , " " ) } return false , nil }
isRepoCurrentlyCloning determines if the target repository is currently being cloned.
isRepoCurrentlyCloning determines if the target repository is currently being cloned .