For functions like `lookupReference`, if the users specifies just `master`, try also looking at `refs/heads/master`, the way that command-line does.