diff options
author | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2017-09-11 11:17:49 +0300 |
---|---|---|
committer | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2017-09-25 12:34:10 +0300 |
commit | 9c16958c309b0398af612d5f7653ca0affdd3758 (patch) | |
tree | 2004dad0ca0d3c648f75eea1d417ad0560c4506d /lib/gitlab/gitaly_client.rb | |
parent | 4d88f6496836c7fbf8a0f58e4d2604bf2c3f96d5 (diff) |
Migrate Gitlab::Git::Repository#log to Gitaly
Diffstat (limited to 'lib/gitlab/gitaly_client.rb')
-rw-r--r-- | lib/gitlab/gitaly_client.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb index cbd9ff406de..955d2307f88 100644 --- a/lib/gitlab/gitaly_client.rb +++ b/lib/gitlab/gitaly_client.rb @@ -228,10 +228,18 @@ module Gitlab path.read.chomp end + def self.timestamp(t) + Google::Protobuf::Timestamp.new(seconds: t.to_i) + end + def self.encode(s) s.dup.force_encoding(Encoding::ASCII_8BIT) end + def self.encode_repeated(a) + Google::Protobuf::RepeatedField.new(:bytes, a.map { |s| self.encode(s) } ) + end + # Count a stack. Used for n+1 detection def self.count_stack return unless RequestStore.active? |