Explorar o código

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 %!s(int64=2) %!d(string=hai) anos
pai
achega
ecd78af07f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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)