gitlab_git 7.2.21 → 7.2.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/gitlab_git/repository.rb +31 -0
- 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: b0f98195d9f6a0ab4792c5e7505ca3a1e3715c48
|
4
|
+
data.tar.gz: 583593e0e7dc9b2f88cb13cc0b4435aa1287ef0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07e33ccaab4ae5eac1e0115481dae4eb60fa4eec50fd23fa3c235128f7f70a130cb6fa42b0c40a75edcc338f35451f2a12e43cccd725ef1a58cd043f129f6153
|
7
|
+
data.tar.gz: 4e5686646cbc15194ff4b556165a4a7366fc50700b61e1516305b6862d2f3c3e5b58a66b76434e38ed552c3b1379fed688b24561e6cc63f54f1ec44013ddfc3e
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
7.2.
|
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.
|
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-
|
11
|
+
date: 2015-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: github-linguist
|