lib/gitlab_git/repository.rb in gitlab_git-5.4.0 vs lib/gitlab_git/repository.rb in gitlab_git-5.5.0
- old
+ new
@@ -1,8 +1,10 @@
# Gitlab::Git::Commit is a wrapper around native Grit::Repository object
# We dont want to use grit objects inside app/
# It helps us easily migrate to rugged in future
+require_relative 'encoding_herlper'
+
module Gitlab
module Git
class Repository
include Gitlab::Git::Popen
@@ -293,9 +295,13 @@
# Ex.
# repo.branch_names_contains('master')
#
def branch_names_contains(commit)
output = grit.git.native(:branch, {contains: true}, commit)
+
+ # Fix encoding issue
+ output = EncodingHelper::encode!(output)
+
# The output is expected as follow
# fix-aaa
# fix-bbb
# * master
output.scan(/[^* \n]+/)