Skip to content

Clear the remaining nullability analyzer findings - #588

Merged
hannesa2 merged 2 commits into
gitx:masterfrom
goneng:clear-nullability-analyzer-findings
Aug 23, 2026
Merged

hannesa2 merged 2 commits into
gitx:masterfrom
goneng:clear-nullability-analyzer-findings

Conversation

@goneng

@goneng goneng commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Say plainly that these two seams can come back empty, so the analyzer
stops reporting nulls that the callers already cope with.

  • Declare the index diff as absent, which is what it already returns
    once the diff task fails
  • Give up on the head ref when the branch it resolved to has no name,
    instead of building a ref out of a name that is not there

The head ref is the one behavior change: it now returns nothing where
it used to hand back a ref built from a missing name, and it differs
only once that lookup has already failed.

A second, cosmetic commit empties three fixture titles in the file
selection tests, so the localizability check stops flagging text that
no user ever sees.

Test plan:

  • xcodebuild test -only-testing:GitXTests is green, 41/41
  • The build drops six analyzer findings, 60 down to 54, and adds none
  • The index and repository suites cover the diff path, and the head
    ref guard only adds an early return where the lookup already failed

goneng added 2 commits August 23, 2026 16:53
Say where a result can be absent, and stop building a ref out of a
name that is not there.

- Declare the file diff as absent, which is what the callers in the
  commit view already receive when the diff task fails
- Return no head ref when the resolved branch has no name, rather than
  wrapping the missing name in a ref that cannot describe anything

Neither call site was reachable in normal use, but both told the
analyzer something the code does not honour, which hides the findings
that matter.
Stop naming the menus and the menu item the tests build, since nothing
reads those names.

- Leave the fixture titles empty so the analyzer stops treating them
  as text shown to a user

The tests tell the staged menu from the unstaged one by identity, not
by name, so the titles carried no meaning and only tripped the
localizability check.
@goneng
goneng marked this pull request as ready for review August 23, 2026 14:20
@hannesa2
hannesa2 merged commit eae3b6b into gitx:master Aug 23, 2026
3 checks passed
@goneng
goneng deleted the clear-nullability-analyzer-findings branch August 23, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants