Skip to content

Commit 4dd06c3

Browse files
committed
Test trailing comma in args (>py3.6?)
1 parent 3b53d28 commit 4dd06c3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

git/repo/base.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
# typing ------------------------------------------------------
4040

41-
from git.types import TBD, PathLike, Lit_config_levels, Commit_ish, Tree_ish
41+
from git.types import TBD, PathLike, Lit_config_levels, Commit_ish, Tree_ish, assert_never
4242
from typing import (Any, BinaryIO, Callable, Dict,
4343
Iterator, List, Mapping, Optional, Sequence,
4444
TextIO, Tuple, Type, Union,
@@ -481,10 +481,12 @@ def _get_config_path(self, config_level: Lit_config_levels) -> str:
481481
raise NotADirectoryError
482482
else:
483483
return osp.normpath(osp.join(repo_dir, "config"))
484+
else:
484485

485-
raise ValueError("Invalid configuration level: %r" % config_level)
486+
assert_never(config_level, # type:ignore[unreachable]
487+
ValueError(f"Invalid configuration level: {config_level!r}"))
486488

487-
def config_reader(self, config_level: Optional[Lit_config_levels] = None
489+
def config_reader(self, config_level: Optional[Lit_config_levels] = None,
488490
) -> GitConfigParser:
489491
"""
490492
:return:

0 commit comments

Comments
 (0)