Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion lib/git/diff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ def process_full_diff
}
final = {}
current_file = nil
@full_diff.split("\n").each do |line|
full_diff_utf8_encoded = @full_diff.encode("UTF-8", "binary", :invalid => "replace", :undef => "replace")
full_diff_utf8_encoded.split("\n").each do |line|
if m = /^diff --git a\/(.*?) b\/(.*?)/.match(line)
current_file = m[1]
final[current_file] = defaults.merge({:patch => line, :path => current_file})
Expand Down
4 changes: 3 additions & 1 deletion lib/git/lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,9 @@ def meets_required_version?
ENV_VARIABLE_NAMES = ['GIT_DIR', 'GIT_WORK_TREE', 'GIT_INDEX_FILE', 'GIT_SSH']

def command_lines(cmd, opts = [], chdir = true, redirect = '')
command(cmd, opts, chdir).split("\n")
cmd_op = command(cmd, opts, chdir)
op = cmd_op.encode("UTF-8", "binary", :invalid => "replace", :undef => "replace")
op.split("\n")
end

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