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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/gitlab_git/repository.rb +27 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14ccd03ccf2f97ca59ae88f4c50979b928e75f66
4
- data.tar.gz: 417da7b58a2102d460fe859a7d1b72cc13a02253
3
+ metadata.gz: 9de29ada902161092fb9e47fdeca8aa6181a13bf
4
+ data.tar.gz: 94075ed61b45d324b5d5766eac2476b52cdd2ee8
5
5
  SHA512:
6
- metadata.gz: b54ad94d138b1906ea3fccd0d31b808b937b456cff03c3e6981cb0e783a4035e6100eca2ad51411aa43518560ab8e2645b8591c34835623597dd187d75468f97
7
- data.tar.gz: 6baf99270d4261595eb34817fb964cb528b8d420d9caf214dddf475142e0ad5339e4773e4ff25fa993b6c0863076d32af279f0e025bf81343d166c04d8fe24ca
6
+ metadata.gz: 96fb73a3d63714cb9b00f05fc656c65efc4384c10da24aff43bf9eab3e39140da912b839da72b0d1e6459e767b0774e9a114035020d8e2d2941be323b0215055
7
+ data.tar.gz: 24fee34bba8b1db85b464aa69eace2d85be2be4f949fd627a123dafe817f08998cf101e554f6ec87eade7ee9932b68a5394f161ac2aa2844fd3e40919bb4f5a8
data/VERSION CHANGED
@@ -1 +1 @@
1
- 9.0.2
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_git
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.0.2
4
+ version: 9.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitriy Zaporozhets