refs.c: teach resolve_ref_unsafe() to solve dir-as-refname references
DEV