It seems like you are loosely comparing $arg of type GitElephant\Objects\TreeishInterface|string|null against null; this is ambiguous if the string can be empty. Consider using a strict comparison !== instead.
It seems like $arg defined by parameter $arg on line 43 can also be of type object<GitElephant\Objects\TreeishInterface>; however, GitElephant\Command\Base...d::addCommandSubject2() does only seem to accept string, maybe add an additional type check?
This check looks at variables that have been passed in as parameters and are passed out again
to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.