Fix problem when changing a file into a directory
Add a second "allow_empty" mode to get_committed_file, which returns
the empty string is the named file is actually a directory. This is
used by the check_ident() function, which is ok since a directory
can't contain any expanded idents, so there is nothing to check.
Note that get_staged_file() ought to support this mode as well.
Currently, running get_staged_file() on a directory actually returns
the contents of the first file in the directory, which is a bug.