Ref T13589. In D21510, not every ref selector got touched, and this isn't a valid construction in Git:
$ git ls-tree ... -- ''
Thus:
- Disambiguate more (all?) ref selectors.
- Correct the construction of "git ls-tree" when there is no path.
- Clean some stuff up: make the construction of some flags and arguments more explicit, get rid of a needless "%C", prefer "%Ls" over acrobatics, etc.