"Unexpected output from git ls-tree" means that it failed to inspect the contents of a file, which would happen if it was a directory in that commit. The only thing that examines the contents of files (except for the .gitattributes file) is the ident check though. So the directory must have the ident attribute then?
Could you please put the result of "git format-patch" for your commits somewhere so that I can take a closer look?