Error 500 creating a merge request when tmp ref does not actually exist
Rugged::ReferenceError: reference 'refs/tmp/f8f1b2b251bf1c142cdc7c57bd5f4a98/head' not found
https://sentry.gitlap.com/gitlab/gitlabcom/issues/41586/
NoMethodError: undefined method `sha' for nil:NilClass
app/models/repository.rb:1068:in `with_repo_branch_commit'
start_repository.commit(start_branch_name).sha
lib/gitlab/metrics/instrumentation.rb:156:in `block in with_repo_branch_commit'
trans.method_call_for(#{label.to_sym.inspect}).measure { super }
lib/gitlab/metrics/method_call.rb:23:in `measure'
retval = yield
lib/gitlab/metrics/instrumentation.rb:156:in `with_repo_branch_commit'
trans.method_call_for(#{label.to_sym.inspect}).measure { super }
app/services/compare_service.rb:15:in `execute'
target_project.repository.with_repo_branch_commit(
...
(125 additional frame(s) were not displayed)
Rugged::ReferenceError: reference 'refs/tmp/f8f1b2b251bf1c142cdc7c57bd5f4a98/head' not found
app/models/repository.rb:1074:in `delete'
rugged.references.delete(tmp_ref) if tmp_ref
app/models/repository.rb:1074:in `ensure in with_repo_branch_commit'
rugged.references.delete(tmp_ref) if tmp_ref
app/models/repository.rb:1074:in `with_repo_branch_commit'
rugged.references.delete(tmp_ref) if tmp_ref
lib/gitlab/metrics/instrumentation.rb:156:in `block in with_repo_branch_commit'
trans.method_call_for(#{label.to_sym.inspect}).measure { super }
lib/gitlab/metrics/method_call.rb:23:in `measure'
retval = yield
...
(127 additional frame(s) were not displayed)
Rugged::ReferenceError: reference 'refs/tmp/f8f1b2b251bf1c142cdc7c57bd5f4a98/head' not found