When Gitlab::GitPostReceive#changes_refs is empty user would not get defined and nil would be passed to PostReceive#after_project_changes_hooks which would then throw an error.