Skip to content

Commit c97cf55

Browse files
committed
Use explicit literal assignment for status
mypy doesn't narrow `letter` through the OR equality chain to `Literal["M", "A", "D"]`. Branch and assign each literal directly so no narrowing is required.
1 parent 31a2249 commit c97cf55

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

backend/app/services/git.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,12 @@ def _parse_changed_files(output: str) -> list[ChangedFile]:
513513
continue
514514
code, path = parts[0], parts[1]
515515
letter = code[:1]
516-
if letter == "M" or letter == "A" or letter == "D":
517-
statuses[path] = letter
516+
if letter == "M":
517+
statuses[path] = "M"
518+
elif letter == "A":
519+
statuses[path] = "A"
520+
elif letter == "D":
521+
statuses[path] = "D"
518522

519523
files = [
520524
ChangedFile(

0 commit comments

Comments
 (0)