@@ -354,21 +354,19 @@ def __ne__(self, rhs: object) -> bool:
354354 def __hash__ (self ) -> int :
355355 return hash (self .git_dir )
356356
357- # Description property
358- def _get_description (self ) -> str :
357+ @property
358+ def description (self ) -> str :
359+ """The project's description"""
359360 filename = osp .join (self .git_dir , "description" )
360361 with open (filename , "rb" ) as fp :
361362 return fp .read ().rstrip ().decode (defenc )
362363
363- def _set_description (self , descr : str ) -> None :
364+ @description .setter
365+ def description (self , descr : str ) -> None :
364366 filename = osp .join (self .git_dir , "description" )
365367 with open (filename , "wb" ) as fp :
366368 fp .write ((descr + "\n " ).encode (defenc ))
367369
368- description = property (_get_description , _set_description , doc = "the project's description" )
369- del _get_description
370- del _set_description
371-
372370 @property
373371 def working_tree_dir (self ) -> Optional [PathLike ]:
374372 """
@@ -885,13 +883,14 @@ def _set_daemon_export(self, value: object) -> None:
885883 elif not value and fileexists :
886884 os .unlink (filename )
887885
888- daemon_export = property (
889- _get_daemon_export ,
890- _set_daemon_export ,
891- doc = "If True, git-daemon may export this repository" ,
892- )
893- del _get_daemon_export
894- del _set_daemon_export
886+ @property
887+ def daemon_export (self ) -> bool :
888+ """If True, git-daemon may export this repository"""
889+ return self ._get_daemon_export ()
890+
891+ @daemon_export .setter
892+ def daemon_export (self , value : object ) -> None :
893+ self ._set_daemon_export (value )
895894
896895 def _get_alternates (self ) -> List [str ]:
897896 """The list of alternates for this repo from which objects can be retrieved.
@@ -929,11 +928,14 @@ def _set_alternates(self, alts: List[str]) -> None:
929928 with open (alternates_path , "wb" ) as f :
930929 f .write ("\n " .join (alts ).encode (defenc ))
931930
932- alternates = property (
933- _get_alternates ,
934- _set_alternates ,
935- doc = "Retrieve a list of alternates paths or set a list paths to be used as alternates" ,
936- )
931+ @property
932+ def alternates (self ) -> List [str ]:
933+ """Retrieve a list of alternates paths or set a list paths to be used as alternates"""
934+ return self ._get_alternates ()
935+
936+ @alternates .setter
937+ def alternates (self , alts : List [str ]) -> None :
938+ self ._set_alternates (alts )
937939
938940 def is_dirty (
939941 self ,
0 commit comments