Merge "Move ls implementation detail into ls."