浏览代码

Catch SymrefLoop in set_if_equals

Previously `self.follow(name)` raised `KeyError` which was handled, but now it raises `SymrefLoop` the exception is passed up to the caller. With this patch the old behaviour is restored.
Dominic Davis-Foster 2 年之前
父节点
当前提交
ecd78af07f
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      dulwich/refs.py

+ 1 - 1
dulwich/refs.py

@@ -835,7 +835,7 @@ class DiskRefsContainer(RefsContainer):
         try:
             realnames, _ = self.follow(name)
             realname = realnames[-1]
-        except (KeyError, IndexError):
+        except (KeyError, IndexError, SymrefLoop):
             realname = name
         filename = self.refpath(realname)