Browse Source

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 years ago
parent
commit
ecd78af07f
1 changed files with 1 additions and 1 deletions
  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)