diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-05-01 11:44:39 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-05-01 11:49:58 +0300 |
commit | 5e75d377059a78f7bb13d954fa3c1cb4ed653766 (patch) | |
tree | bdcf91108d4ee8d3a11eac2dbe141d1f91cb0926 /lib/gitlab/git/raw_diff_change.rb | |
parent | 87f1736a7381f39e373ce5bdae2d7185b9523108 (diff) |
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
Diffstat (limited to 'lib/gitlab/git/raw_diff_change.rb')
-rw-r--r-- | lib/gitlab/git/raw_diff_change.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/git/raw_diff_change.rb b/lib/gitlab/git/raw_diff_change.rb index eb3d8819239..92f6c45ce25 100644 --- a/lib/gitlab/git/raw_diff_change.rb +++ b/lib/gitlab/git/raw_diff_change.rb @@ -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' |