How about using `GIT_REFS_HEADS_DIR` (defined in `refs.h`)?