Patch #37614
closedCleanup app/models/repository/git.rb
Description
The attached patches improve the readability of app/models/repository/git.rb.
Files
Updated by Holger Just 9 months ago
The changes should all be equivalent to what's currently there.
As a tiny personal preference though, I'm not a huge fan of the explicit fetch in your 0005 patch. While it makes it make sit very explicit that we expect a nil
here (which I guess is why Rubocop recommends this) but it looks rather in-elegant and verbose, especially considering that we check for the nil just one line below.
Apart from that, it looks good to me. If there is no simple way to shut up Rubocop about the explicit fetch, I would be fine with that too if it helps keep the coding style consistent.
Updated by Go MAEDA 8 months ago
Holger Just wrote:
As a tiny personal preference though, I'm not a huge fan of the explicit fetch in your 0005 patch. While it makes it make sit very explicit that we expect a
nil
here (which I guess is why Rubocop recommends this) but it looks rather in-elegant and verbose, especially considering that we check for the nil just one line below.
Thank you for reviewing the patches. The point you made about report_last_commit
method is right. I will commit the patches after removing the change to the method.