gitlab_git 7.2.14 → 7.2.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 22bc4c47e1a258187a410d36f3c2dffe0f3050d7
4
- data.tar.gz: 37d23dc67e7a89e6278bb346a2359ce8619cd2f5
3
+ metadata.gz: e8300790e0ccabd6e3bd4002e7d6cb7470dec69a
4
+ data.tar.gz: 2ab3c31f0b61acb76aa9f6cefa6a646a8935fb48
5
5
  SHA512:
6
- metadata.gz: ec01d372f387f67a5e6df8f19262414f05590edc671e8615b85b92cfb04de7cccad3bd7bfb0eaf1ecb944730c61b2cb811a41574aaef5410f89c6b954bec713b
7
- data.tar.gz: a059436ab41194d430a1a1f7a5ef0a79ca04c91d90a77aa72a9c6adcff4193e72e0f8d75d456ae968f8d977ff7074577caa1276237c7ea3e6b5552be21e9ed07
6
+ metadata.gz: 919ebd7a6bc0edd28c29a72f1c193a3852b4d1318ac13dcd343cdb99e9df45f2b809ac7cded4ba9aa554f284c31c17578387aebd84543ed840436558139da0cf
7
+ data.tar.gz: 701f5e05964311896a145e60771455e8dfea685611a8d20db05c8fb6fe45eff5b8f7bcf459224930b51e362dc917c418b7f86e12794d73cc9da91b7d0ea75578
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.2.14
1
+ 7.2.15
@@ -1,6 +1,10 @@
1
+ require_relative 'encoding_helper'
2
+
1
3
  module Gitlab
2
4
  module Git
3
5
  class Blame
6
+ include EncodingHelper
7
+
4
8
  attr_reader :lines, :blames
5
9
 
6
10
  def initialize(repository, sha, path)
@@ -24,8 +28,10 @@ module Gitlab
24
28
 
25
29
  def load_blame
26
30
  cmd = %W(git --git-dir=#{@repo.path} blame -p #{@sha} -- #{@path})
27
- raw_output = IO.popen(cmd) {|io| io.read }
28
- process_raw_blame raw_output
31
+ # Read in binary mode to ensure ASCII-8BIT
32
+ raw_output = IO.popen(cmd, 'rb') {|io| io.read }
33
+ output = encode_utf8(raw_output)
34
+ process_raw_blame output
29
35
  end
30
36
 
31
37
  def process_raw_blame(output)
@@ -24,6 +24,15 @@ module EncodingHelper
24
24
  "--broken encoding: #{encoding}"
25
25
  end
26
26
 
27
+ def encode_utf8(message)
28
+ detect = CharlockHolmes::EncodingDetector.detect(message)
29
+ if detect
30
+ CharlockHolmes::Converter.convert(message, detect[:encoding], 'UTF-8')
31
+ else
32
+ clean(message)
33
+ end
34
+ end
35
+
27
36
  private
28
37
 
29
38
  def clean(message)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_git
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.2.14
4
+ version: 7.2.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitriy Zaporozhets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-17 00:00:00.000000000 Z
11
+ date: 2015-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitlab-linguist