Fix bug in push when the remoteHead is null.

TBR @devoncarew