gitlab_git 7.2.21 → 7.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/gitlab_git/repository.rb +31 -0
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 449eca74aecd426432bda2b90b598114b1f6483b
4
- data.tar.gz: 8552cc076a3b204352d6d063efb1ff290e450dab
3
+ metadata.gz: b0f98195d9f6a0ab4792c5e7505ca3a1e3715c48
4
+ data.tar.gz: 583593e0e7dc9b2f88cb13cc0b4435aa1287ef0b
5
5
  SHA512:
6
- metadata.gz: a130a367a8400c37fe2f61a16f076e382087a864e470396be1c02686d23a81322ab2dc8f2b389591bb0c6af34e3699886f0c9ef68c1b8cdd639975162a98b0d8
7
- data.tar.gz: ec9f8a5a6890edbdc94deab47f681122095de2f8f427d619b9095d643001b88d5168520d7b4daf2370be09c0bb0500be732a785cc48747db614e44e9e3ba40df
6
+ metadata.gz: 07e33ccaab4ae5eac1e0115481dae4eb60fa4eec50fd23fa3c235128f7f70a130cb6fa42b0c40a75edcc338f35451f2a12e43cccd725ef1a58cd043f129f6153
7
+ data.tar.gz: 4e5686646cbc15194ff4b556165a4a7366fc50700b61e1516305b6862d2f3c3e5b58a66b76434e38ed552c3b1379fed688b24561e6cc63f54f1ec44013ddfc3e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.2.21
1
+ 7.2.22
@@ -839,6 +839,37 @@ module Gitlab
839
839
  Blob.commit(self, options)
840
840
  end
841
841
 
842
+ # Returns result like "git ls-files" , recursive and full file path
843
+ #
844
+ # Ex.
845
+ # repo.ls_files('master')
846
+ #
847
+ def ls_files(ref)
848
+ actual_ref = ref || root_ref
849
+
850
+ begin
851
+ sha_from_ref(actual_ref)
852
+ rescue Rugged::OdbError, Rugged::InvalidError, Rugged::ReferenceError
853
+ # Return an empty array if the ref wasn't found
854
+ return []
855
+ end
856
+
857
+ cmd = %W(git --git-dir=#{path} ls-tree)
858
+ cmd += %w(-r)
859
+ cmd += %w(--full-tree)
860
+ cmd += %w(--full-name)
861
+ cmd += %W(-- #{actual_ref})
862
+
863
+ raw_output = IO.popen(cmd, &:read).split("\n").map do |f|
864
+ stuff, path = f.split("\t")
865
+ mode, type, sha = stuff.split(" ")
866
+ path if type == "blob"
867
+ # Contain only blob type
868
+ end
869
+
870
+ raw_output.compact
871
+ end
872
+
842
873
  private
843
874
 
844
875
  # Get the content of a blob for a given commit. If the blob is a commit
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_git
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.2.21
4
+ version: 7.2.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitriy Zaporozhets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-07 00:00:00.000000000 Z
11
+ date: 2015-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github-linguist