Fixed race in CommitPusher, minor refactoring
Merge pull request #2900 from lutovich/2.0-race-in-commit-pusher

Fixed race in CommitPusher, minor refactoring