gitlab-gollum-rugged_adapter 0.4.4.1 → 0.4.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rugged_adapter/git_layer_rugged.rb +23 -0
- data/lib/rugged_adapter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 415639f73ca1446976691bb097576d53e077e1b7
|
4
|
+
data.tar.gz: 9fca45257ca9a9349a347bad320f1319d58ab994
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ad11281e0d2166427d87cb343958021c6ee34aaf8a40a562c3f7c26cf9de0413b4aa178324c74b2f293937c55741c2933e1f97585cb8b845a8d7246494f731d
|
7
|
+
data.tar.gz: 29f6a3603a7fef2a6e8f813f4c39a5368c551c70e611914158326dbc3e0dba59200c82cd47eb62d08b4509defe1cb4f5b615da47a8cb46e023eb0be37c723396
|
@@ -625,6 +625,29 @@ module Gollum
|
|
625
625
|
@repo.checkout(ref, :strategy => :force) unless @repo.bare?
|
626
626
|
end
|
627
627
|
end
|
628
|
+
|
629
|
+
def files_sorted_by_created_at(sha = nil)
|
630
|
+
sha ||= @repo.head.target.oid
|
631
|
+
|
632
|
+
file_renamings = {}
|
633
|
+
sorting = Rugged::SORT_DATE | Rugged::SORT_TOPO
|
634
|
+
|
635
|
+
@repo.walk(sha, sorting).with_object([]) do |commit, files|
|
636
|
+
parent = commit.parents.first
|
637
|
+
|
638
|
+
diff = commit.diff(parent, reverse: true)
|
639
|
+
diff.find_similar!
|
640
|
+
diff.each_delta do |delta|
|
641
|
+
name = delta.new_file[:path]
|
642
|
+
|
643
|
+
if delta.added?
|
644
|
+
files << (file_renamings[name] || name)
|
645
|
+
elsif delta.renamed?
|
646
|
+
file_renamings[delta.old_file[:path]] = file_renamings[name] || name
|
647
|
+
end
|
648
|
+
end
|
649
|
+
end
|
650
|
+
end
|
628
651
|
end
|
629
652
|
|
630
653
|
class Tree
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-gollum-rugged_adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.4.
|
4
|
+
version: 0.4.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bart Kamphorst, Dawa Ometto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rugged
|