Use Ruby methods, not Rails' String#first

Gitaly-Ruby is not a Rails application, which made the method not exist
after the vendor. This patch uses direct indexing, which has the same
properties that `#first` has.

Found while working on: https://gitlab.com/gitlab-org/gitaly/merge_requests/699
This commit is contained in:
Zeger-Jan van de Weg 2018-05-01 10:44:39 +02:00
parent 87f1736a73
commit 5e75d37705
No known key found for this signature in database
GPG Key ID: 65F6A8D64A88ABAC
1 changed files with 3 additions and 1 deletions

View File

@ -38,7 +38,9 @@ module Gitlab
end
def extract_operation
case @raw_operation&.first(1)
return :unknown unless @raw_operation
case @raw_operation[0]
when 'A'
:added
when 'C'