Fixed commit order logic for fetching and pushing.