pack-objects: hash basename and direname a bit differently.