gitlab_git 7.0.0.rc14 → 7.0.0.rc15

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: f3cf5080130d02af367a03688fd7532df357b2b8
4
- data.tar.gz: 4ff124240753faadb7c136936920463e0544afcb
3
+ metadata.gz: 032effd5ddcbdee163141fad8753e2e05b5be2d6
4
+ data.tar.gz: e95f2a74da65b5d3f73e34ecdf2322cc357c12ab
5
5
  SHA512:
6
- metadata.gz: c4fdac70760182bb518663fd0c9382cdfa77316363444238bb403efe9828fd7e1f95e568c0b3b0ac9c23a23ad76fb1173295acd63e727665365f4864a8782f60
7
- data.tar.gz: 0e357a87c45dd3ad9a186c371f72ae5c7b2385c910d9680d465763aefe477dc7ddeeacfc0247dd8a72d4d568f4bc059c71feb8e82e680459ec67082720ec09f4
6
+ metadata.gz: 8a7de66d53708e64ab2850a8baad0851d561bf8513f40d8cc4572170a8d76f80ada73d831ac2893502a9397532d46b469baf6ff5b0bd51804cae25da5c7fd352
7
+ data.tar.gz: c81d4b56dc3114276d96f905e5cf7803d15ace82b1d2f6546a154c3f55065f33e543b8ba107e4e21cd43adac9400d4c361b41e6f9671e5845c31f018f2135867
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.0.0.rc14
1
+ 7.0.0.rc15
@@ -52,12 +52,8 @@ module Gitlab
52
52
  def find(repo, commit_id = "HEAD")
53
53
  return decorate(commit_id) if commit_id.is_a?(Rugged::Commit)
54
54
 
55
- obj = repo.rugged.rev_parse(commit_id)
56
- commit = case obj
57
- when Rugged::Tag::Annotation then obj.target
58
- when Rugged::Commit then obj
59
- end
60
- decorate(commit) if commit
55
+ obj = repo.rev_parse_target(commit_id)
56
+ decorate(obj)
61
57
  rescue Rugged::ReferenceError, Rugged::ObjectError
62
58
  nil
63
59
  end
@@ -238,14 +238,15 @@ module Gitlab
238
238
  end
239
239
 
240
240
  def sha_from_ref(ref)
241
- sha = rugged.rev_parse_oid(ref)
242
- object = rugged.lookup(sha)
241
+ rev_parse_target(ref).oid
242
+ end
243
243
 
244
- if object.kind_of?(Rugged::Commit)
245
- sha
246
- elsif object.respond_to?(:target)
247
- sha_from_ref(object.target.oid)
248
- end
244
+ # Return the object that +revspec+ points to. If +revspec+ is an
245
+ # annotated tag, then return the tag's target instead.
246
+ def rev_parse_target(revspec)
247
+ obj = rugged.rev_parse(revspec)
248
+ obj = obj.target while obj.is_a?(Rugged::Tag::Annotation)
249
+ obj
249
250
  end
250
251
 
251
252
  # Return a collection of Rugged::Commits between the two SHA arguments.
@@ -720,17 +721,6 @@ module Gitlab
720
721
 
721
722
  private
722
723
 
723
- # Return the object that +revspec+ points to. If +revspec+ is an
724
- # annotated tag, then return the tag's target instead.
725
- def rev_parse_target(revspec)
726
- obj = rugged.rev_parse(revspec)
727
- if obj.is_a?(Rugged::Tag::Annotation)
728
- obj.target
729
- else
730
- obj
731
- end
732
- end
733
-
734
724
  # Get the content of a blob for a given commit. If the blob is a commit
735
725
  # (for submodules) then return the blob's OID.
736
726
  def blob_content(commit, blob_name)
@@ -907,6 +897,8 @@ module Gitlab
907
897
  # Get the compression process ready to accept data from the read end
908
898
  # of the pipe
909
899
  compress_pid = spawn(*compress_cmd, :in => pipe_rd, :out => file)
900
+ # Set the lowest priority for the compressing process
901
+ popen(nice_process(compress_pid), path)
910
902
  # The read end belongs to the compression process now; we should
911
903
  # close our file descriptor for it.
912
904
  pipe_rd.close
@@ -926,6 +918,16 @@ module Gitlab
926
918
  end
927
919
  end
928
920
 
921
+ def nice_process(pid)
922
+ niced_process = %W(renice -n 20 -p #{pid})
923
+
924
+ unless RUBY_PLATFORM.include?('darwin')
925
+ niced_process = %W(ionice -c 2 -n 7 -p #{pid}) + niced_process
926
+ end
927
+
928
+ niced_process
929
+ end
930
+
929
931
  # Returns true if the index entry has the special file mode that denotes
930
932
  # a submodule.
931
933
  def submodule?(index_entry)
@@ -934,9 +936,9 @@ module Gitlab
934
936
 
935
937
  # Return a Rugged::Index that has read from the tree at +ref_name+
936
938
  def populated_index(ref_name)
937
- tree = rugged.lookup(rugged.rev_parse_oid(ref_name)).tree
939
+ commit = rev_parse_target(ref_name)
938
940
  index = rugged.index
939
- index.read_tree(tree)
941
+ index.read_tree(commit.tree)
940
942
  index
941
943
  end
942
944
 
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.0.0.rc14
4
+ version: 7.0.0.rc15
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-01-10 00:00:00.000000000 Z
11
+ date: 2015-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gitlab-linguist
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: 1.3.1
109
109
  requirements: []
110
110
  rubyforge_project:
111
- rubygems_version: 2.4.3
111
+ rubygems_version: 2.4.5
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Gitlab::Git library