gitlab_git 7.0.0.rc14 → 7.0.0.rc15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/gitlab_git/commit.rb +2 -6
- data/lib/gitlab_git/repository.rb +22 -20
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 032effd5ddcbdee163141fad8753e2e05b5be2d6
|
4
|
+
data.tar.gz: e95f2a74da65b5d3f73e34ecdf2322cc357c12ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a7de66d53708e64ab2850a8baad0851d561bf8513f40d8cc4572170a8d76f80ada73d831ac2893502a9397532d46b469baf6ff5b0bd51804cae25da5c7fd352
|
7
|
+
data.tar.gz: c81d4b56dc3114276d96f905e5cf7803d15ace82b1d2f6546a154c3f55065f33e543b8ba107e4e21cd43adac9400d4c361b41e6f9671e5845c31f018f2135867
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
7.0.0.
|
1
|
+
7.0.0.rc15
|
data/lib/gitlab_git/commit.rb
CHANGED
@@ -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.
|
56
|
-
|
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
|
-
|
242
|
-
|
241
|
+
rev_parse_target(ref).oid
|
242
|
+
end
|
243
243
|
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
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
|
-
|
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.
|
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-
|
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.
|
111
|
+
rubygems_version: 2.4.5
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: Gitlab::Git library
|