Skip to content
This repository has been archived by the owner on Apr 19, 2018. It is now read-only.

Updated Grit::Commit#diffs method to honor options received in the parameter when calculating diffs. #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions lib/grit/commit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ def self.diff(repo, a, b = nil, paths = [], options = {})
Diff.list_from_string(repo, text)
end

def show
def show(options = {})
if parents.size > 1
diff = @repo.git.native(:diff, {:full_index => true}, "#{parents[0].id}...#{parents[1].id}")
diff = @repo.git.native(:diff, {:full_index => true}.update(options), "#{parents[0].id}...#{parents[1].id}")
else
diff = @repo.git.show({:full_index => true, :pretty => 'raw'}, @id)
diff = @repo.git.show({:full_index => true, :pretty => 'raw'}.update(options), @id)
end

if diff =~ /diff --git a/
Expand All @@ -228,7 +228,7 @@ def show
#
# Returns Grit::Diff[] (baked)
def diffs(options = {})
show
show(options)
end

def stats
Expand Down