The code is missing a branch to take the given reference name into account.
This should be postponed after I decide if the explicit references flag is useful or not. Currently tending towards that the flag is useless, but it might have some use in automating things.