Skip to content

Fix NoMethodError: undefined method `sha'

Vasilii Iakliushin requested to merge 395480_fix_no_method_error into master

What does this MR do and why?

Contributes to #395480 (closed)

Problem

Empty repositories can have an default branch that doesn't point anywhere. Attempt to access their sha will raise a NoMethodError.

Solution

Verify that the default branch points to an existing commit before requesting sha.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading