libgit2 / libgit2/pygit2

Cannot delete a remote with multiple fetch refspecs

未关闭
#939 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先复现提供的 pygit2 代码片段,并检查 pygit2 暴露的远程仓库删除和配置处理。删除具有多个 fetch refspec 的远程仓库时能够成功且不出现 multivar 错误,并有一个覆盖该示例的回归测试后,修复才算完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
git, python
领域
tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。