(ctx context.Context, query *Query, source string)
| 189 | } |
| 190 | |
| 191 | func resolveModuleSourceCommit(ctx context.Context, query *Query, source string) (string, error) { |
| 192 | bk, err := query.Engine(ctx) |
| 193 | if err != nil { |
| 194 | return "", fmt.Errorf("failed to get engine client: %w", err) |
| 195 | } |
| 196 | |
| 197 | parsedRef, err := ParseRefString(ctx, NewCallerStatFS(bk), source, "") |
| 198 | if err != nil { |
| 199 | return "", fmt.Errorf("parse module source %q: %w", source, err) |
| 200 | } |
| 201 | if parsedRef.Kind != ModuleSourceKindGit { |
| 202 | return "", fmt.Errorf("module source %q is not a git source", source) |
| 203 | } |
| 204 | |
| 205 | return resolveParsedGitRefCommit(ctx, parsedRef.Git, "") |
| 206 | } |
| 207 | |
| 208 | func parseGitLookupInputs(operation string, inputs []any) (string, string, error) { |
| 209 | if len(inputs) != 2 { |
no test coverage detected