Commit 57a987d Yegor Bugayenko
committed
1 parent 629e2d2 commit 57a987d Copy full SHA for 57a987d
File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -35,13 +35,20 @@ def hits
35
35
version = `git --version` . split ( / / ) [ 2 ]
36
36
fail "git version #{ version } is too old, upgrade it to 2.0+" unless
37
37
Gem ::Version . new ( version ) >= Gem ::Version . new ( '2.0' )
38
- log = `git '--git-dir=#{ @dir } /.git' log --pretty=tformat: --numstat`
38
+ cmd = [
39
+ 'git' ,
40
+ "'--git-dir=#{ @dir } /.git'" ,
41
+ 'log' , '--pretty=tformat:' , '--numstat' ,
42
+ '--ignore-space-change' , '--ignore-all-space' ,
43
+ '--ignore-submodules' , '--no-color' ,
44
+ '--find-copies-harder' , '-M' , '--diff-filter=ACDM'
45
+ ] . join ( ' ' )
39
46
[
40
47
Hits . new (
41
48
Time . now ,
42
- log . split ( /\n / ) . delete_if ( &:empty? ) . map do |t |
49
+ ` #{ cmd } ` . split ( /\n / ) . delete_if ( &:empty? ) . map do |t |
43
50
t . split ( /\t / ) . take ( 2 ) . map { |s | s . to_i } . inject ( :+ )
44
- end . inject ( :+ )
51
+ end . inject ( :+ ) || 0
45
52
)
46
53
]
47
54
end
You can’t perform that action at this time.
0 commit comments