The more I think about it, the more it makes sense for all three parties that Gibraltar gets a different agreement to that of the the mainland UK. Their economy needs the free movement of people more than any part of the UK (excl. N.ireland), plus has a large interest in protecting due to the amount of workers that cross the border into/from Spain.
It's rather scandalous that the UK government didn't think to mention this in the triggering of Article 50. Still, let the war-mongers and nationalists get hyped up for a battle over the sovereignty of Gibraltar.