gitlab_git 7.2.8 → 7.2.9

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 +17 -44
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0fb286d72a72f537e6256122e9017c6901e7534f
4
- data.tar.gz: a65bf64b798e5bdc6ed45f8a9837b8bd9e5437bb
3
+ metadata.gz: 093a48bc5387399df0b770442205dbc5d782f840
4
+ data.tar.gz: 9bbc121aad494a63764ff35f97332fce368883b6
5
5
  SHA512:
6
- metadata.gz: cd4a03b4bc7fbeef4436f919855ad0f9f424387f22ab8e09a78d12fa60925017f4e59e2157bba93c39dd2e833b83fd5fddde92248fb70134a37452d91cb8a948
7
- data.tar.gz: 0002e83c7288132e5cd7a8ba70696bbc3dd8d04748b988abbf64777612c65be5cfbe81991c5cedc5474096f8bac03ab781fb32b832eecf16e1438a9fe931bbad
6
+ metadata.gz: c655e5aa4856d822a7b5e46b12efa7da8494226edeee121c8622148d7c239f262c8e95ead052fc159b20e5be210a24519c5b791ca717322aada3d8923399d19e
7
+ data.tar.gz: 276b8610c80c368daedb4f793311fc86564eb64b5f916d8f7b251b9635a4799e1d87ddfb9a8073db75d5c45ee58a67262e4e8d675bb152fa8be2dd37a8e4ab0e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.2.8
1
+ 7.2.9
@@ -278,10 +278,23 @@ module Gitlab
278
278
  options[:offset] ||= 0
279
279
  actual_ref = options[:ref] || root_ref
280
280
  sha = sha_from_ref(actual_ref)
281
- build_log(sha, options)
282
- rescue Rugged::OdbError, Rugged::InvalidError, Rugged::ReferenceError
283
- # Return an empty array if the ref wasn't found
284
- []
281
+ repo = options[:repo]
282
+
283
+ cmd = %W(git -C #{path} log)
284
+ cmd << %W(-n #{options[:limit].to_i})
285
+ cmd << %W(--skip=#{options[:offset].to_i})
286
+ cmd << %W(--follow) if options[:follow]
287
+ cmd << %W(--no-merges) if options[:skip_merges]
288
+ cmd << sha
289
+ cmd << %W(-- #{options[:path]}) if options[:path]
290
+
291
+ raw_output = IO.popen(cmd.flatten) {|io| io.read }
292
+
293
+ log = raw_output.scan(/commit\ ([0-9a-f]{40})/).flatten.map do |c|
294
+ Rugged::Commit.new(rugged, c)
295
+ end
296
+
297
+ log.is_a?(Array) ? log : []
285
298
  end
286
299
 
287
300
  def sha_from_ref(ref)
@@ -837,46 +850,6 @@ module Gitlab
837
850
  results
838
851
  end
839
852
 
840
- # Return an array of log commits, given an SHA hash and a hash of
841
- # options.
842
- def build_log(sha, options)
843
- # Instantiate a Walker and add the SHA hash
844
- walker = Rugged::Walker.new(rugged)
845
- walker.push(sha)
846
-
847
- commits = []
848
- skipped = 0
849
- current_path = options[:path]
850
- current_path = nil if current_path == ''
851
-
852
- limit = options[:limit].to_i
853
- offset = options[:offset].to_i
854
- skip_merges = options[:skip_merges]
855
-
856
- walker.sorting(Rugged::SORT_DATE)
857
- walker.each do |c|
858
- break if limit > 0 && commits.length >= limit
859
-
860
- if skip_merges
861
- # Skip merge commits
862
- next if c.parents.length > 1
863
- end
864
-
865
- if !current_path ||
866
- commit_touches_path?(c, current_path, options[:follow], walker)
867
-
868
- # This is a commit we care about, unless we haven't skipped enough
869
- # yet
870
- skipped += 1
871
- commits.push(c) if skipped > offset
872
- end
873
- end
874
-
875
- walker.reset
876
-
877
- commits
878
- end
879
-
880
853
  # Returns true if +commit+ introduced changes to +path+, using commit
881
854
  # trees to make that determination. Uses the history simplification
882
855
  # rules that `git log` uses by default, where a commit is omitted if it
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: 7.2.8
4
+ version: 7.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitriy Zaporozhets
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project:
111
- rubygems_version: 2.2.2
111
+ rubygems_version: 2.4.3
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Gitlab::Git library