Skip to content

Commit

Permalink
Merge pull request #46 from repotag/dometto-patch-1
Browse files Browse the repository at this point in the history
Refactor Tree#/
  • Loading branch information
dometto committed Oct 21, 2018
2 parents 84a9240 + f529613 commit 0623e2a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/tree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ def trees
end

def /(file)
begin
if file =~ /^\/+$/
self
else
treewalk = TreeWalk.forPath(@jrepo, file, @jtree)
rescue Java::JavaLang::IllegalArgumentException
return self
treewalk.nil? ? nil :
wrap_tree_or_blob(treewalk.get_file_mode(0), treewalk.get_path_string, treewalk.get_object_id(0))
end
treewalk.nil? ? nil :
wrap_tree_or_blob(treewalk.get_file_mode(0), treewalk.get_path_string, treewalk.get_object_id(0))
end

def self.new_from_hashmap(repository, hashmap, base_tree = nil)
Expand Down

0 comments on commit 0623e2a

Please sign in to comment.