File tree Expand file tree Collapse file tree
Open diff view settings
Expand file tree Collapse file tree
Open diff view settings
Original file line number Diff line number Diff line change @@ -528,13 +528,13 @@ def _terminate(self) -> None:
528528 try :
529529 if proc .poll () is not None :
530530 self .status = self ._status_code_if_terminate or proc .poll ()
531- return None
531+ return
532532 except OSError as ex :
533533 log .info ("Ignored error after process had died: %r" , ex )
534534
535535 # It can be that nothing really exists anymore...
536536 if os is None or getattr (os , "kill" , None ) is None :
537- return None
537+ return
538538
539539 # Try to kill it.
540540 try :
Original file line number Diff line number Diff line change @@ -203,7 +203,8 @@ def __setitem__(self, key: str, value: _T) -> None:
203203 def add (self , key : str , value : Any ) -> None :
204204 if key not in self :
205205 super ().__setitem__ (key , [value ])
206- return None
206+ return
207+
207208 super ().__getitem__ (key ).append (value )
208209
209210 def setall (self , key : str , values : List [_T ]) -> None :
@@ -579,7 +580,7 @@ def read(self) -> None: # type: ignore[override]
579580 :raise IOError: If a file cannot be handled
580581 """
581582 if self ._is_initialized :
582- return None
583+ return
583584 self ._is_initialized = True
584585
585586 files_to_read : List [Union [PathLike , IO ]] = ["" ]
@@ -697,7 +698,7 @@ def write(self) -> None:
697698 a file lock"""
698699 self ._assure_writable ("write" )
699700 if not self ._dirty :
700- return None
701+ return
701702
702703 if isinstance (self ._file_or_files , (list , tuple )):
703704 raise AssertionError (
@@ -711,7 +712,7 @@ def write(self) -> None:
711712 "Skipping write-back of configuration file as include files were merged in."
712713 + "Set merge_includes=False to prevent this."
713714 )
714- return None
715+ return
715716 # END stop if we have include files
716717
717718 fp = self ._file_or_files
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ def _set_cache_(self, attr: str) -> None:
166166 except OSError :
167167 # In new repositories, there may be no index, which means we are empty.
168168 self .entries : Dict [Tuple [PathLike , StageType ], IndexEntry ] = {}
169- return None
169+ return
170170 # END exception handling
171171
172172 try :
@@ -1210,9 +1210,9 @@ def checkout(
12101210 def handle_stderr (proc : "Popen[bytes]" , iter_checked_out_files : Iterable [PathLike ]) -> None :
12111211 stderr_IO = proc .stderr
12121212 if not stderr_IO :
1213- return None # Return early if stderr empty.
1214- else :
1215- stderr_bytes = stderr_IO .read ()
1213+ return # Return early if stderr empty.
1214+
1215+ stderr_bytes = stderr_IO .read ()
12161216 # line contents:
12171217 stderr = stderr_bytes .decode (defenc )
12181218 # git-checkout-index: this already exists
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ def run_commit_hook(name: str, index: "IndexFile", *args: str) -> None:
8383 """
8484 hp = hook_path (name , index .repo .git_dir )
8585 if not os .access (hp , os .X_OK ):
86- return None
86+ return
8787
8888 env = os .environ .copy ()
8989 env ["GIT_INDEX_FILE" ] = safe_decode (str (index .path ))
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ def git_cmp(t1: TreeCacheTup, t2: TreeCacheTup) -> int:
6868
6969def merge_sort (a : List [TreeCacheTup ], cmp : Callable [[TreeCacheTup , TreeCacheTup ], int ]) -> None :
7070 if len (a ) < 2 :
71- return None
71+ return
7272
7373 mid = len (a ) // 2
7474 lefthalf = a [:mid ]
Original file line number Diff line number Diff line change @@ -500,8 +500,8 @@ def addToStack(
500500 depth : int ,
501501 ) -> None :
502502 lst = self ._get_intermediate_items (item )
503- if not lst : # empty list
504- return None
503+ if not lst : # Empty list
504+ return
505505 if branch_first :
506506 stack .extendleft (TraverseNT (depth , i , src_item ) for i in lst )
507507 else :
Original file line number Diff line number Diff line change @@ -644,7 +644,7 @@ def _parse_progress_line(self, line: AnyStr) -> None:
644644 self .line_dropped (line_str )
645645 # Note: Don't add this line to the other lines, as we have to silently
646646 # drop it.
647- return None
647+ return
648648 # END handle op code
649649
650650 # Figure out stage.
You can’t perform that action at this time.
0 commit comments