Add support for creating detached heads