Skip to content

Commit 4583bfa

Browse files
committed
Changed call style for Git.blame and Git::Blame.new to allow passing options hash (don't know how I missed that the first time around... options are pretty useless if you don't have a way of setting them :)
1 parent e77add1 commit 4583bfa

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

lib/git/base.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ def status
176176
end
177177

178178
# return a Git::Blame object
179-
def blame(file = '', start = '', fin = '')
180-
Git::Blame.new(self, file, start, fin)
179+
def blame(file = '', opts = {})
180+
Git::Blame.new(self, file, opts)
181181
end
182182

183183
# returns a Git::Branches object of all the Git::Branch objects for this repo

lib/git/blame.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ module Git
33
class Blame
44
include Enumerable
55

6-
def initialize(base, file = '', start = '', fin = '')
6+
def initialize(base, file = '', opts = {})
77
@base = base
88

9-
construct_blame(file, start, fin)
9+
construct_blame(file, opts)
1010
end
1111

1212
# Todo - factor this in to BlameLine instead, and have this loop?
@@ -79,10 +79,12 @@ def initialize(line, hash)
7979

8080

8181
# This will run the blame (via our lib.rb), and parse the porcelain-formatted blame output into BlameLine objects
82-
def construct_blame(file = '', start = '', fin = '')
82+
def construct_blame(file = '', opts = {})
8383
@lines = {}
8484

85-
lines = @base.lib.blame({:file => file, :start => start, :fin => fin})
85+
opts[:file] = file
86+
87+
lines = @base.lib.blame(opts)
8688

8789
parsed_lines = {}
8890
commits = {}

0 commit comments

Comments
 (0)