summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTibshoOT <tib@rocknroot.org>2016-04-27 12:38:25 +0200
committerTibshoOT <tib@rocknroot.org>2016-04-27 12:38:25 +0200
commit60cd19857c2f722a1b39b8ee0f5b09440612d0ed (patch)
treecd7cfaf4aec6cfd24c27172ab95339aea4071284
parent525b1fe5f56b91082172cbbcaba90290118e5590 (diff)
Fix exception when using git, groups, and single_repo method
-rw-r--r--lib/oxidized/output/git.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/oxidized/output/git.rb b/lib/oxidized/output/git.rb
index 8b605f6..3678126 100644
--- a/lib/oxidized/output/git.rb
+++ b/lib/oxidized/output/git.rb
@@ -70,7 +70,10 @@ class Git < Output
def version node, group
begin
repo = @cfg.repo
- if group
+ path = node
+ if group and @cfg.single_repo?
+ path = "#{group}/#{node}"
+ elsif group
repo = File.join File.dirname(repo), group + '.git'
end
repo = Rugged::Repository.new repo
@@ -80,7 +83,7 @@ class Git < Output
i = -1
tab = []
walker.each do |commit|
- if commit.diff(paths: [node]).size > 0
+ if commit.diff(paths: [path]).size > 0
hash = {}
hash[:date] = commit.time.to_s
hash[:oid] = commit.oid
@@ -100,7 +103,7 @@ class Git < Output
def get_version node, group, oid
begin
repo = @cfg.repo
- if group && group != ''
+ if group && group != '' && !@cfg.single_repo?
repo = File.join File.dirname(repo), group + '.git'
end
repo = Rugged::Repository.new repo
@@ -115,7 +118,7 @@ class Git < Output
begin
repo = @cfg.repo
diff_commits = nil
- if group && group != ''
+ if group && group != '' && !@cfg.single_repo?
repo = File.join File.dirname(repo), group + '.git'
end
repo = Rugged::Repository.new repo