Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix fetching when groups are used and single_repo: true #145

Merged
merged 2 commits into from Jul 7, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/oxidized/output/git.rb
Expand Up @@ -50,13 +50,13 @@ def store file, outputs, opt={}
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
Expand Down