Fix Style/GuardClause issue in app/services/commits/commit_patch_service.rb

This issue is part of the Source Code Management backend team's effort to resolve RuboCop violations.

Violation

File: app/services/commits/commit_patch_service.rb Cop: Style/GuardClause

Steps to resolve

  1. Remove the entry from the RuboCop todo file
  2. Fix the violation in the code
  3. Ensure tests pass
  4. Submit the merge request