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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b65d506c0864d701816dbad994ada60f244a724f
4
- data.tar.gz: 459eb1742eebae5bc2fe59f129612df371bad7d0
3
+ metadata.gz: 415639f73ca1446976691bb097576d53e077e1b7
4
+ data.tar.gz: 9fca45257ca9a9349a347bad320f1319d58ab994
5
5
  SHA512:
6
- metadata.gz: 02c6ad3e3df5a2775092d84c2de1898d9aa616d09081fd6ffd41c8602c2051684c4ec547ea4c8bf89492f771e083090143028ac87e5748f15f6318e4f89d85b1
7
- data.tar.gz: 6dadd4c7fa7605e6128202e627c463794c1cbc5bde0f20e4ee33308fe93111ef082e1886fe8e84a0a99a35a72192d234de6d5b631785d08d3cd09c34a31668a3
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
@@ -1,7 +1,7 @@
1
1
  module Gollum
2
2
  module Lib
3
3
  module Git
4
- VERSION = '0.4.4.1'
4
+ VERSION = '0.4.4.2'
5
5
  end
6
6
  end
7
7
  end
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.1
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: 2018-06-11 00:00:00.000000000 Z
11
+ date: 2019-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rugged