@@ -620,13 +620,17 @@ def __init__(self) -> None:
620620 self .error_lines : List [str ] = []
621621 self .other_lines : List [str ] = []
622622
623- def _parse_progress_line (self , line : AnyStr ) -> None :
623+ def _parse_progress_line (self , line : AnyStr ) -> Optional [ object ] :
624624 """Parse progress information from the given line as retrieved by
625625 :manpage:`git-push(1)` or :manpage:`git-fetch(1)`.
626626
627627 - Lines that do not contain progress info are stored in :attr:`other_lines`.
628628 - Lines that seem to contain an error (i.e. start with ``error:`` or ``fatal:``)
629629 are stored in :attr:`error_lines`.
630+
631+ The base implementation returns ``None``. Subclasses may return another
632+ value for compatibility with existing overrides, but callers should treat
633+ the return value as unspecified.
630634 """
631635 # handle
632636 # Counting objects: 4, done.
@@ -641,7 +645,7 @@ def _parse_progress_line(self, line: AnyStr) -> None:
641645
642646 if self ._cur_line .startswith (("error:" , "fatal:" )):
643647 self .error_lines .append (self ._cur_line )
644- return
648+ return None
645649
646650 cur_count , max_count = None , None
647651 match = self .re_op_relative .match (line_str )
@@ -651,7 +655,7 @@ def _parse_progress_line(self, line: AnyStr) -> None:
651655 if not match :
652656 self .line_dropped (line_str )
653657 self .other_lines .append (line_str )
654- return
658+ return None
655659 # END could not get match
656660
657661 op_code = 0
@@ -682,7 +686,7 @@ def _parse_progress_line(self, line: AnyStr) -> None:
682686 self .line_dropped (line_str )
683687 # Note: Don't add this line to the other lines, as we have to silently
684688 # drop it.
685- return
689+ return None
686690 # END handle op code
687691
688692 # Figure out stage.
@@ -708,6 +712,7 @@ def _parse_progress_line(self, line: AnyStr) -> None:
708712 max_count and float (max_count ),
709713 message ,
710714 )
715+ return None
711716
712717 def new_message_handler (self ) -> Callable [[str ], None ]:
713718 """
@@ -717,7 +722,7 @@ def new_message_handler(self) -> Callable[[str], None]:
717722 """
718723
719724 def handler (line : AnyStr ) -> None :
720- return self ._parse_progress_line (line .rstrip ())
725+ self ._parse_progress_line (line .rstrip ())
721726
722727 # END handler
723728
0 commit comments