summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorFrancisco Javier López <fjlopez@gitlab.com>2018-01-09 16:01:09 +0000
committerDouwe Maan <douwe@gitlab.com>2018-01-09 16:01:09 +0000
commit138e8ad1a211c02c1d7323a79e7ab4c1a983f31f (patch)
treee1fdf5744426907b1753ec93c6f0530bb6b25983 /config
parent596f270450c743c95237a5342b85bb8df3650395 (diff)
downloadgitlab-ce-138e8ad1a211c02c1d7323a79e7ab4c1a983f31f.tar.gz
Fixing bug related to wiki last version
Diffstat (limited to 'config')
-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