git_handler.local_heads: drop compat for ancient Mercurial versions
git_handler.local_heads: use a generator comprehension

The list comprehension is unnecessary.
git_handler.get_changed_refs: drop unnecessary computation of local heads

It doesn't change between iterations of the generator expression, and it's
non-trivial to calculate.
git_handler.update_references: fix variable name
git_handler.local_heads: return git ref with sha

This allows extensions to add other sources of git refs.

The returned git ref is currently unused -- the following patch will use it.
git_handler.update_references: use git ref returned from local_heads
git_handler.update_references: use iteritems
git_handler: write inequality more idiomatically