Method: Technologist::GitRepository#find_blob
- Defined in:
- lib/technologist/git_repository.rb
#find_blob(blob_name, current_tree = root_tree) ⇒ Rugged::Blob
Recursively searches for the blob identified by ‘blob_name` in all subdirectories in the repository. A blob is usually either a file or a directory.
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/technologist/git_repository.rb', line 35 def find_blob(blob_name, current_tree = root_tree) blob = current_tree[blob_name] if blob repository.lookup(blob[:oid]) else current_tree.each_tree do |sub_tree| blob = find_blob(blob_name, repository.lookup(sub_tree[:oid])) break blob if blob end end end |