Cannot delete a remote with multiple fetch refspecs
未关闭
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 1.7k
- 派生
- 408
- 平均合并
- 2 天 57 分钟
- 30 天内合并 PR
- 7
描述
Steps to reproduce:
>>> import pygit2
>>> repo = pygit2.init_repository(".")
>>> repo.remotes.create("origin", "https://github.com/libgit2/pygit2.git")
>>> repo.remotes.add_fetch("origin", "refs/heads/master:refs/remotes/origin/master")
>>> repo.remotes.add_fetch("origin", "refs/tags/*:refs/tags/*")
>>> repo.remotes.delete("origin")
_pygit2.GitError, entry is not unique due to being a multivar
This is present in the latest release and I also saw it happen (though with different error text) in 0.27
There doesn't appear to be a viable workaround because the libgit2 function for deleting multivars in the config isn't exposed in pygit2. Otherwise I would have tried to remove the multiple fetch entries directly ahead of time and then delete the remote.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先复现提供的 pygit2 代码片段,并检查 pygit2 暴露的远程仓库删除和配置处理。删除具有多个 fetch refspec 的远程仓库时能够成功且不出现 multivar 错误,并有一个覆盖该示例的回归测试后,修复才算完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- git, python
- 领域
- tooling
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100