gitlab_git 10.2.3 → 10.3.0

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: 06d8964a48ea1e58af0c08789e18528b29dbeef0
4
- data.tar.gz: feeaa56ce0eead8d7a430c50a2daf12ed734fbf2
3
+ metadata.gz: ca09a45c8fe5e808f16e090009e0669606c1254d
4
+ data.tar.gz: b08c10952c847eb9fd8d08fcfdd80882a9437a2e
5
5
  SHA512:
6
- metadata.gz: e8f2f996918cc0126513e995ec96da377fb71a9f3d3144baf97fbed4a87119506feb88b1509ea0815d9b071b4c991ac355f007bcb9acc443e442bbe0b722e45c
7
- data.tar.gz: edd493f535ff384a6e54f90c3a08475156bffcfde1d9878df2bd54cb5435323e6a9d37d454bde8b0bda3b83024c0f03f63d9b51ae589aeeab908e3db379e4537
6
+ metadata.gz: 445297ffa695d881561323fa05aeb4417ba2adff06803015d669e1faff23f33dd3f2ad15cc9c9e4bedc88e1785e7e54695d8d21f07bf9c30631cf1c74c868152
7
+ data.tar.gz: 61b5e4a480731886eb94f28aa1b7dfaaf1f93d625efb5cf5318a91afc44356a709559386d76d830318308ecd1e19f669e6bde058cc4f8a54f6edc61d1134887c
data/VERSION CHANGED
@@ -1 +1 @@
1
- 10.2.3
1
+ 10.3.0
@@ -150,7 +150,13 @@ module Gitlab
150
150
  if action == :remove
151
151
  index.remove(filename)
152
152
  else
153
- mode = 0100644
153
+ if action == :rename
154
+ old_path_name = PathHelper.normalize_path(file[:previous_path])
155
+ old_filename = old_path_name.to_s
156
+ index.remove(old_filename)
157
+ end
158
+
159
+ mode = 0o100644
154
160
  file_entry = index.get(filename)
155
161
 
156
162
  if file_entry
@@ -207,6 +213,35 @@ module Gitlab
207
213
  def remove(repository, options)
208
214
  commit(repository, options, :remove)
209
215
  end
216
+
217
+
218
+ # Rename file from repository and return commit sha
219
+ #
220
+ # options should contain next structure:
221
+ # file: {
222
+ # previous_path: 'documents/old_story.txt'
223
+ # path: 'documents/story.txt'
224
+ # content: 'Lorem ipsum...',
225
+ # update: true
226
+ # },
227
+ # author: {
228
+ # email: 'user@example.com',
229
+ # name: 'Test User',
230
+ # time: Time.now
231
+ # },
232
+ # committer: {
233
+ # email: 'user@example.com',
234
+ # name: 'Test User',
235
+ # time: Time.now
236
+ # },
237
+ # commit: {
238
+ # message: 'Rename FILENAME',
239
+ # branch: 'master'
240
+ # }
241
+ #
242
+ def rename(repository, options)
243
+ commit(repository, options, :rename)
244
+ end
210
245
  end
211
246
 
212
247
  def initialize(options)
@@ -751,30 +751,6 @@ module Gitlab
751
751
  raise InvalidRef.new("Invalid reference #{start_point}")
752
752
  end
753
753
 
754
- # Add a tag with +tag_name++ name to the repository in corresponding +ref_target++
755
- # supports passing a hash of options to create an annotated tag
756
- #
757
- # Valid annotation options are:
758
- # :tagger ::
759
- # same structure as a committer, the user that is creating the tag
760
- #
761
- # :message ::
762
- # the message to include in the tag annotation
763
- #
764
- # Returns a Gitlab::Git::Tag
765
- def add_tag(tag_name, ref_target, options = nil)
766
- tag = rugged.tags.create(tag_name, ref_target, options)
767
- if tag.annotated?
768
- Tag.new(tag_name, ref_target, tag.annotation.message)
769
- else
770
- Tag.new(tag_name, ref_target)
771
- end
772
- rescue Rugged::TagError
773
- raise InvalidRef.new("Tag #{tag_name} already exists")
774
- rescue Rugged::ReferenceError
775
- raise InvalidRef.new("Target #{ref_target} is invalid")
776
- end
777
-
778
754
  # Return an array of this repository's remote names
779
755
  def remote_names
780
756
  rugged.remotes.each_name.to_a
@@ -809,22 +785,6 @@ module Gitlab
809
785
  rugged.remotes[remote_name].push(refspecs)
810
786
  end
811
787
 
812
- # Return a String containing the mbox-formatted diff between +from+ and
813
- # +to+. See #diff for the allowed keys in the +options+ hash.
814
- def format_patch(from, to, options = {})
815
- options ||= {}
816
- break_rewrites = options[:break_rewrites]
817
- actual_options = Diff.filter_diff_options(options)
818
-
819
- from_sha = rugged.rev_parse_oid(from)
820
- to_sha = rugged.rev_parse_oid(to)
821
- commits_between(from_sha, to_sha).map do |commit|
822
- # Ignore merge commits, which have more than one parent,
823
- # in creation of patch to mimic the behavior of `git format-patch`
824
- commit.to_mbox(actual_options) if commit.parents.length <= 1
825
- end.flatten.join("\n")
826
- end
827
-
828
788
  # Merge the +source_name+ branch into the +target_name+ branch. This is
829
789
  # equivalent to `git merge --no_ff +source_name+`, since a merge commit
830
790
  # is always created.
@@ -1171,7 +1131,7 @@ module Gitlab
1171
1131
  end
1172
1132
 
1173
1133
  def unsupported_platform?
1174
- %w( darwin freebsd solaris ).map{ |platform| RUBY_PLATFORM.include?(platform) }.any?
1134
+ %w[darwin freebsd solaris].map { |platform| RUBY_PLATFORM.include?(platform) }.any?
1175
1135
  end
1176
1136
 
1177
1137
  # Returns true if the index entry has the special file mode that denotes
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: 10.2.3
4
+ version: 10.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitriy Zaporozhets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-23 00:00:00.000000000 Z
11
+ date: 2016-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: github-linguist
@@ -105,7 +105,7 @@ files:
105
105
  - lib/gitlab_git/tag.rb
106
106
  - lib/gitlab_git/tree.rb
107
107
  - lib/gitlab_git/util.rb
108
- homepage: http://rubygems.org/gems/gitlab_git
108
+ homepage: https://gitlab.com/gitlab-org/gitlab_git
109
109
  licenses:
110
110
  - MIT
111
111
  metadata: {}
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubyforge_project:
128
- rubygems_version: 2.6.2
128
+ rubygems_version: 2.4.8
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Gitlab::Git library