I'm using Grit in my rails app and I'm creating a commit which i know works:
repo = Repo.new(full_path, {:is_bare => true})
fname = "snippet"
File.open("#{full_path}/#{fname}", 'w') {|f| f.puts(data)}
Dir.chdir("#{full_path}") {repo.add(fname)}
if repo.commit_index('his amazing commit')
logger.info "commit succeeded"
else
logger.info "commit failed"
end
then, im trying to get the blobs which is showing up empty:
tree = Tree.construct(repo, 'master')
data = tree.blobs.map {|b| repo.blob(b.id).data}
logger.info "data.first = #{data.first}"
data.first
What am I doing wrong here?