Update repository head successively during project update

It prevents situation when async worker slowly updates HEAD and we show
old branch as repository HEAD in project settings

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Merge branch 'improve/repo_head_update'

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	app/models/project.rb