@@ -221,7 +221,8 @@ def _get_commit(self):
221221# END handle type
222222return obj
223223
224- def set_commit (self ,commit :Union [Commit ,'SymbolicReference' ,str ],logmsg = None ):
224+ def set_commit (self ,commit :Union [Commit ,'SymbolicReference' ,str ],logmsg :Union [str ,None ]= None
225+ )-> 'SymbolicReference' :
225226"""As set_object, but restricts the type of object to be a Commit
226227
227228 :raise ValueError: If commit is not a Commit object or doesn't point to
@@ -250,7 +251,8 @@ def set_commit(self, commit: Union[Commit, 'SymbolicReference', str], logmsg=Non
250251
251252return self
252253
253- def set_object (self ,object ,logmsg = None ):# @ReservedAssignment
254+ def set_object (self ,object :Union [Commit_ish ,'SymbolicReference' ,str ],logmsg :Union [str ,None ]= None
255+ )-> 'SymbolicReference' :
254256"""Set the object we point to, possibly dereference our symbolic reference first.
255257 If the reference does not exist, it will be created
256258
@@ -277,10 +279,10 @@ def set_object(self, object, logmsg=None): # @ReservedAssignment
277279# set the commit on our reference
278280return self ._get_reference ().set_object (object ,logmsg )
279281
280- commit = property (_get_commit ,set_commit ,doc = "Query or set commits directly" )
281- object = property (_get_object ,set_object ,doc = "Return the object our ref currently refers to" )
282+ commit = property (_get_commit ,set_commit ,doc = "Query or set commits directly" )# type: ignore
283+ object = property (_get_object ,set_object ,doc = "Return the object our ref currently refers to" )# type: ignore
282284
283- def _get_reference (self ):
285+ def _get_reference (self )-> 'SymbolicReference' :
284286""":return: Reference Object we point to
285287 :raise TypeError: If this symbolic reference is detached, hence it doesn't point
286288 to a reference, but to a commit"""
@@ -290,7 +292,7 @@ def _get_reference(self):
290292return self .from_path (self .repo ,target_ref_path )
291293
292294def set_reference (self ,ref :Union [Commit_ish ,'SymbolicReference' ,str ],
293- logmsg :Union [str ,None ]= None )-> Union [ Commit_ish , 'SymbolicReference' ] :
295+ logmsg :Union [str ,None ]= None )-> 'SymbolicReference' :
294296"""Set ourselves to the given ref. It will stay a symbol if the ref is a Reference.
295297 Otherwise an Object, given as Object instance or refspec, is assumed and if valid,
296298 will be set which effectively detaches the refererence if it was a purely