localrepo: refactor prepush logic
Simplifies the prepush check logic and makes it a lot more direct and
comprehensible. Instead of comparing the total local vs. remote head count, it
compares the number of new vs. removed heads.
error: pretxncommit.nocommits hook failed: no commits allowed
transaction abort!
rollback completed
abort: no commits allowed
error: pretxncommit.nocommits hook failed: no commits allowed
transaction abort!
rollback completed
abort: no commits allowed