summaryrefslogtreecommitdiff
path: root/config/initializers/gollum.rb
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2018-01-11 15:04:34 +0000
committerMarin Jankovski <marin@gitlab.com>2018-01-11 15:04:34 +0000
commitdf4afa19a5b267b66e6941c35cfd52e8b6cb8030 (patch)
tree7a847eb03a8271ca4c798f927743cc3ee6f09001 /config/initializers/gollum.rb
parent6eca65fcdd87951d27acd07612b1c9bd21721063 (diff)
parentc55003442a81786aed844e1e170ba238879d597b (diff)
downloadgitlab-ce-df4afa19a5b267b66e6941c35cfd52e8b6cb8030.tar.gz
Merge branch '10-4-stable-prepare-rc3' into '10-4-stable'
Prepare 10.4 RC3 release See merge request gitlab-org/gitlab-ce!16334
Diffstat (limited to 'config/initializers/gollum.rb')
-rw-r--r--config/initializers/gollum.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/config/initializers/gollum.rb b/config/initializers/gollum.rb
index f1066f83dd9..0b86cac51a7 100644
--- a/config/initializers/gollum.rb
+++ b/config/initializers/gollum.rb
@@ -36,6 +36,26 @@ module Gollum
end
end
end
+
+ module Git
+ class Git
+ def tree_entry(commit, path)
+ pathname = Pathname.new(path)
+ tmp_entry = nil
+
+ pathname.each_filename do |dir|
+ tmp_entry = if tmp_entry.nil?
+ commit.tree[dir]
+ else
+ @repo.lookup(tmp_entry[:oid])[dir]
+ end
+
+ return nil unless tmp_entry
+ end
+ tmp_entry
+ end
+ end
+ end
end
Rails.application.configure do