Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions lib/git/lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ def process_commit_data(data, sha = nil, indent = 4)
}

loop do
key, *value = data.shift.split
datum = data.shift

break if datum.nil?

key, *value = datum.split

break if key.nil?

Expand Down Expand Up @@ -902,14 +906,24 @@ def meets_required_version?
def command_lines(cmd, opts = [], chdir = true, redirect = '')
cmd_op = command(cmd, opts, chdir)
if cmd_op.encoding.name != "UTF-8"
op = cmd_op.encode("UTF-8", "binary", {
:invalid => :replace,
:undef => :replace
})
op = command_line_convert(cmd_op)
else
op = cmd_op
end
op.split("\n")

begin
op.split("\n")
rescue ArgumentError
op = command_line_convert(cmd_op)
retry
end
end

def command_line_convert(cmd_op)
cmd_op.encode("UTF-8", "binary", {
:invalid => :replace,
:undef => :replace
})
end

# Takes the current git's system ENV variables and store them.
Expand Down