diff options
author | ytti <saku@ytti.fi> | 2015-07-07 11:20:05 +0300 |
---|---|---|
committer | ytti <saku@ytti.fi> | 2015-07-07 11:20:05 +0300 |
commit | 513e1375578396797d663398c653e6d64d54e2c0 (patch) | |
tree | 22f5cde19e3b5ba6d7507d17fa4f6db3711aada1 /lib/oxidized/output | |
parent | 4251ab700db12b0cf0197d1d43caa57a80ac214e (diff) | |
parent | a880f2a3cbabff9561aa0e99c3eca6e33775916d (diff) |
Merge pull request #145 from jwhited/master
fix fetching when groups are used and single_repo: true
Diffstat (limited to 'lib/oxidized/output')
-rw-r--r-- | lib/oxidized/output/git.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/oxidized/output/git.rb b/lib/oxidized/output/git.rb index 46e748a..b1212f1 100644 --- a/lib/oxidized/output/git.rb +++ b/lib/oxidized/output/git.rb @@ -50,13 +50,13 @@ class Git < Output def fetch node, group begin repo = @cfg.repo - if group - repo = File.join File.dirname(repo), group + '.git' - end + repo = File.join File.dirname(repo), group + '.git' if group and not @cfg.single_repo? repo = Rugged::Repository.new repo index = repo.index index.read_tree repo.head.target.tree unless repo.empty? - repo.read(index.get(node)[:oid]).data + file = node + file = File.join(group, node) if group and @cfg.single_repo? + repo.read(index.get(file)[:oid]).data rescue 'node not found' end |