gitlab_git 9.0.2 → 9.0.3
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 +27 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9de29ada902161092fb9e47fdeca8aa6181a13bf
|
4
|
+
data.tar.gz: 94075ed61b45d324b5d5766eac2476b52cdd2ee8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96fb73a3d63714cb9b00f05fc656c65efc4384c10da24aff43bf9eab3e39140da912b839da72b0d1e6459e767b0774e9a114035020d8e2d2941be323b0215055
|
7
|
+
data.tar.gz: 24fee34bba8b1db85b464aa69eace2d85be2be4f949fd627a123dafe817f08998cf101e554f6ec87eade7ee9932b68a5394f161ac2aa2844fd3e40919bb4f5a8
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
9.0.
|
1
|
+
9.0.3
|
@@ -921,6 +921,33 @@ module Gitlab
|
|
921
921
|
raw_output.compact
|
922
922
|
end
|
923
923
|
|
924
|
+
def copy_gitattributes(ref)
|
925
|
+
begin
|
926
|
+
commit = lookup(ref)
|
927
|
+
rescue Rugged::ReferenceError
|
928
|
+
raise InvalidRef.new("Ref #{ref} is invalid")
|
929
|
+
end
|
930
|
+
|
931
|
+
# Create the paths
|
932
|
+
info_dir_path = File.join(path, 'info')
|
933
|
+
info_attributes_path = File.join(info_dir_path, 'attributes')
|
934
|
+
|
935
|
+
begin
|
936
|
+
# Retrieve the contents of the blob
|
937
|
+
gitattributes_content = blob_content(commit, '.gitattributes')
|
938
|
+
rescue InvalidBlobName
|
939
|
+
# No .gitattributes found. Should now remove any info/attributes and return
|
940
|
+
File.delete(info_attributes_path) if File.exists?(info_attributes_path)
|
941
|
+
return
|
942
|
+
end
|
943
|
+
|
944
|
+
# Create the info directory if needed
|
945
|
+
Dir.mkdir(info_dir_path) unless File.directory?(info_dir_path)
|
946
|
+
|
947
|
+
# Write the contents of the .gitattributes file to info/attributes
|
948
|
+
File.write(info_attributes_path, gitattributes_content)
|
949
|
+
end
|
950
|
+
|
924
951
|
private
|
925
952
|
|
926
953
|
# Get the content of a blob for a given commit. If the blob is a commit
|