ls-tree: simplify prefix handling