import type { RepoAdapter, RepoHost } from './types.ts' export const gitlabRepoAdapter: RepoAdapter = { id: 'gitlab', displayName: 'GitLab', parseRef(ref) { const cleaned = ref.replace(/^https?:\/\/gitlab\.com\//, '').replace(/\.git$/, '') return { ref: cleaned, defaultBranch: 'main' } }, changeRequestUrl({ ref, branch, title }) { return `https://gitlab.com/${ref}/-/merge_requests/new?merge_request[source_branch]=${encodeURIComponent(branch)}&merge_request[title]=${encodeURIComponent(title)}` }, } export const gitlabRepoHost: RepoHost = { id: 'gitlab', async proposeChange(input) { return { ok: false, note: input.dryRun ? `dry-run GitLab change on ${input.repo.ref}` : 'GitLab adapter is a stub in v1.', } }, }