correctly report commit for / when directory=True
drastically speed up reporting commit for ls()