Lookup a reference by DWIMing its short name
Apply the git precendence rules to the given shorthand to determine which reference the user is refering to.
pointer in which to store the reference
the repository in which to look
the short name for the reference
0 or an error code