◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
9 changes: 5 additions & 4 deletions git/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ def __setitem__(self, key: str, value: _T) -> None:
def add(self, key: str, value: Any) -> None:
if key not in self:
super().__setitem__(key, [value])
return None
super().__getitem__(key).append(value)

def setall(self, key: str, values: List[_T]) -> None:
Expand Down Expand Up @@ -579,7 +580,7 @@ def read(self) -> None: # type: ignore[override]
:raise IOError: If a file cannot be handled
"""
if self._is_initialized:
return None
self._is_initialized = True

files_to_read: List[Union[PathLike, IO]] = [""]
Expand Down Expand Up @@ -697,7 +698,7 @@ def write(self) -> None:
a file lock"""
self._assure_writable("write")
if not self._dirty:
return None

if isinstance(self._file_or_files, (list, tuple)):
raise AssertionError(
Expand All @@ -711,7 +712,7 @@ def write(self) -> None:
"Skipping write-back of configuration file as include files were merged in."
+ "Set merge_includes=False to prevent this."
)
return None
# END stop if we have include files

fp = self._file_or_files
Expand Down
8 changes: 4 additions & 4 deletions git/index/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def _set_cache_(self, attr: str) -> None:
except OSError:
# In new repositories, there may be no index, which means we are empty.
self.entries: Dict[Tuple[PathLike, StageType], IndexEntry] = {}
return None
# END exception handling

try:
Expand Down Expand Up @@ -1210,9 +1210,9 @@ def checkout(
def handle_stderr(proc: "Popen[bytes]", iter_checked_out_files: Iterable[PathLike]) -> None:
stderr_IO = proc.stderr
if not stderr_IO:
return None # Return early if stderr empty.
else:
stderr_bytes = stderr_IO.read()
# line contents:
stderr = stderr_bytes.decode(defenc)
# git-checkout-index: this already exists
Expand Down
2 changes: 1 addition & 1 deletion git/index/fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def run_commit_hook(name: str, index: "IndexFile", *args: str) -> None:
"""
hp = hook_path(name, index.repo.git_dir)
if not os.access(hp, os.X_OK):
return None

env = os.environ.copy()
env["GIT_INDEX_FILE"] = safe_decode(str(index.path))
Expand Down
2 changes: 1 addition & 1 deletion git/objects/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def git_cmp(t1: TreeCacheTup, t2: TreeCacheTup) -> int:

def merge_sort(a: List[TreeCacheTup], cmp: Callable[[TreeCacheTup, TreeCacheTup], int]) -> None:
if len(a) < 2:
return None

mid = len(a) // 2
lefthalf = a[:mid]
Expand Down
4 changes: 2 additions & 2 deletions git/objects/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,8 @@ def addToStack(
depth: int,
) -> None:
lst = self._get_intermediate_items(item)
if not lst: # empty list
return None
if branch_first:
stack.extendleft(TraverseNT(depth, i, src_item) for i in lst)
else:
Expand Down
2 changes: 1 addition & 1 deletion git/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ def _parse_progress_line(self, line: AnyStr) -> None:
self.line_dropped(line_str)
# Note: Don't add this line to the other lines, as we have to silently
# drop it.
return None
# END handle op code

# Figure out stage.
Expand Down
Toggle all file notes Toggle all file annotations