@@ -661,7 +661,8 @@ def rename(self, new_path: PathLike, force: bool = False) -> "SymbolicReference"
661
661
662
662
@classmethod
663
663
def _iter_items (
664
- cls : Type [T_References ], repo : "Repo" , common_path : Union [PathLike , None ] = None
664
+ cls : Type [T_References ], repo : "Repo" , common_path : Union [PathLike , None ] = None ,
665
+ packed_refs : bool = True
665
666
) -> Iterator [T_References ]:
666
667
if common_path is None :
667
668
common_path = cls ._common_path_default
@@ -685,10 +686,11 @@ def _iter_items(
685
686
# END for each directory to walk
686
687
687
688
# read packed refs
688
- for _sha , rela_path in cls ._iter_packed_refs (repo ):
689
- if rela_path .startswith (str (common_path )):
690
- rela_paths .add (rela_path )
691
- # END relative path matches common path
689
+ if packed_refs :
690
+ for _sha , rela_path in cls ._iter_packed_refs (repo ):
691
+ if rela_path .startswith (str (common_path )):
692
+ rela_paths .add (rela_path )
693
+ # END relative path matches common path
692
694
# END packed refs reading
693
695
694
696
# return paths in sorted order
@@ -704,6 +706,7 @@ def iter_items(
704
706
cls : Type [T_References ],
705
707
repo : "Repo" ,
706
708
common_path : Union [PathLike , None ] = None ,
709
+ packed_refs : bool = True ,
707
710
* args : Any ,
708
711
** kwargs : Any ,
709
712
) -> Iterator [T_References ]:
@@ -723,7 +726,7 @@ def iter_items(
723
726
724
727
List is lexicographically sorted
725
728
The returned objects represent actual subclasses, such as Head or TagReference"""
726
- return (r for r in cls ._iter_items (repo , common_path ) if r .__class__ == SymbolicReference or not r .is_detached )
729
+ return (r for r in cls ._iter_items (repo , common_path , packed_refs ) if r .__class__ == SymbolicReference or not r .is_detached )
727
730
728
731
@classmethod
729
732
def from_path (cls : Type [T_References ], repo : "Repo" , path : PathLike ) -> T_References :
0 commit comments