Skip to content

Commit

Permalink
add merge commit diff support
Browse files Browse the repository at this point in the history
  • Loading branch information
pjhyett committed Dec 2, 2009
1 parent 1911fe1 commit 5251fd6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/grit/commit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,12 @@ def self.diff(repo, a, b = nil, paths = [])
end

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

if diff =~ /diff --git a/
diff = diff.sub(/.+?(diff --git a)/m, '\1')
else
Expand Down

0 comments on commit 5251fd6

Please sign in to comment.