Skip to content
Snippets Groups Projects
Unverified Commit e81cbae4 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

Merge branch 'master' of github.com:noesya/osuny

parents c8997749 6de49e98
No related branches found
No related tags found
No related merge requests found
...@@ -53,7 +53,7 @@ class Git::Providers::Github < Git::Providers::Abstract ...@@ -53,7 +53,7 @@ class Git::Providers::Github < Git::Providers::Abstract
def git_sha(path) def git_sha(path)
return if path.nil? return if path.nil?
# Try to find in stored tree to avoid multiple queries # Try to find in stored tree to avoid multiple queries
return hash_for_paths[path] if hash_for_paths.has_key? path return find_in_tree(path)
# This is still generating too many requests, so we try based only on the tree # This is still generating too many requests, so we try based only on the tree
# begin # begin
# # The fast way, with no query, does not work. # # The fast way, with no query, does not work.
...@@ -96,9 +96,6 @@ class Git::Providers::Github < Git::Providers::Abstract ...@@ -96,9 +96,6 @@ class Git::Providers::Github < Git::Providers::Abstract
end end
def find_in_tree(path) def find_in_tree(path)
tree[:tree].each do |file| hash_for_paths[path] if hash_for_paths.has_key? path
return file if path == file[:path]
end
nil
end end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment