Skip to content

Commit 59bda2e

Browse files
committed
Simplify: do not cache Index.conflicts
1 parent 81cdaf0 commit 59bda2e

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

pygit2/index.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
import typing
2727
import warnings
28-
import weakref
2928
from dataclasses import dataclass
3029

3130
# Import from pygit2
@@ -353,7 +352,6 @@ def diff_to_tree(
353352
#
354353
# Conflicts
355354
#
356-
_conflicts = None
357355

358356
@property
359357
def conflicts(self):
@@ -375,15 +373,9 @@ def conflicts(self):
375373
the particular conflict.
376374
"""
377375
if not C.git_index_has_conflicts(self._index):
378-
self._conflicts = None
379376
return None
380377

381-
if self._conflicts is None or self._conflicts() is None:
382-
conflicts = ConflictCollection(self)
383-
self._conflicts = weakref.ref(conflicts)
384-
return conflicts
385-
386-
return self._conflicts()
378+
return ConflictCollection(self)
387379

388380

389381
@dataclass

0 commit comments

Comments
 (0)