checkout: fix bug with ambiguous refs