From bf4ac1c53de33c9d57f2c7f83a8bc02af7983ceb Mon Sep 17 00:00:00 2001 From: Petr Havlik Date: Wed, 24 Sep 2014 16:51:10 -0700 Subject: [PATCH] Updated Commit#diff method to honor options received in the parameter when calculating diffs. --- lib/grit/commit.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/grit/commit.rb b/lib/grit/commit.rb index a4af0d9b..506b34d0 100644 --- a/lib/grit/commit.rb +++ b/lib/grit/commit.rb @@ -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/ @@ -228,7 +228,7 @@ def show # # Returns Grit::Diff[] (baked) def diffs(options = {}) - show + show(options) end def stats