feat(label): add label +clone to copy labels from another repository #367
Loading…
Reference in New Issue
No description provided.
Delete Branch "heke1228/gitlink-cli:feat/label-clone"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景
对标
gh label clone。把源仓库的全部标签复制到当前仓库:按名称已存在则跳过(gh 语义),仅--force时就地PATCH覆盖(保留标签 id 与其 issue 关联)。改动
label +clone --source owner/repo [--force],纯组合现有的 list + create/update 端点。fetchLabelsForRepo(遍历issue_tags列表;实测端点确实支持 page/limit),并带 id 去重终止,即使端点忽略分页也不会死循环。fetchLabel,以避免与 PR #363(fix/label-update-pagination)冲突。验证
新增测试:clone 新建/按名跳过/
--force覆盖;fetchLabelsForRepo遍历两页。go build ./...、go test ./shortcuts/label/通过。