gitlab-grit 2.7.1 → 2.7.3
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/grit/git-ruby/repository.rb +3 -1
- data/lib/grit/git.rb +14 -5
- metadata +2 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a8c6f512f0477d03aeb48a9626fa774dd9f062d4
|
|
4
|
+
data.tar.gz: 284e6614616088e8e0f607240ae231ad89126b43
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 348f57115329b50107c46e2a12f9d1d100d7c7aa69b2c6949fa3a15734bdff0098523f44ad57df11e26873037311628e4957d3b7c806b6454a386e1fc4d7aa83
|
|
7
|
+
data.tar.gz: 40fd462abe147a14c0883756a55ba11a69c054df8c87233d9271f98beabed8949d6db886ebd7503dc90d53285db413c53cda738e52d3649a9c28f7722f177939
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.7.
|
|
1
|
+
2.7.3
|
|
@@ -683,7 +683,9 @@ module Grit
|
|
|
683
683
|
end
|
|
684
684
|
|
|
685
685
|
def self.add_file(name, contents)
|
|
686
|
-
File.
|
|
686
|
+
path = File.join(Dir.pwd, name)
|
|
687
|
+
raise "Invalid path: #{path}" unless File.absolute_path(path) == path
|
|
688
|
+
File.open(path, 'w') do |f|
|
|
687
689
|
f.write contents
|
|
688
690
|
end
|
|
689
691
|
end
|
data/lib/grit/git.rb
CHANGED
|
@@ -90,9 +90,13 @@ module Grit
|
|
|
90
90
|
|
|
91
91
|
def self.with_timeout(timeout = 10)
|
|
92
92
|
old_timeout = Grit::Git.git_timeout
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
|
|
94
|
+
begin
|
|
95
|
+
Grit::Git.git_timeout = timeout
|
|
96
|
+
yield
|
|
97
|
+
ensure
|
|
98
|
+
Grit::Git.git_timeout = old_timeout
|
|
99
|
+
end
|
|
96
100
|
end
|
|
97
101
|
|
|
98
102
|
attr_accessor :git_dir, :bytes_read, :work_tree
|
|
@@ -113,7 +117,9 @@ module Grit
|
|
|
113
117
|
#
|
|
114
118
|
# Returns Boolean
|
|
115
119
|
def fs_exist?(file)
|
|
116
|
-
File.
|
|
120
|
+
path = File.join(self.git_dir, file)
|
|
121
|
+
raise "Invalid path: #{path}" unless File.absolute_path(path) == path
|
|
122
|
+
File.exist?(path)
|
|
117
123
|
end
|
|
118
124
|
|
|
119
125
|
# Read a normal file from the filesystem.
|
|
@@ -121,7 +127,9 @@ module Grit
|
|
|
121
127
|
#
|
|
122
128
|
# Returns the String contents of the file
|
|
123
129
|
def fs_read(file)
|
|
124
|
-
File.
|
|
130
|
+
path = File.join(self.git_dir, file)
|
|
131
|
+
raise "Invalid path: #{path}" unless File.absolute_path(path) == path
|
|
132
|
+
File.read(path)
|
|
125
133
|
end
|
|
126
134
|
|
|
127
135
|
# Write a normal file to the filesystem.
|
|
@@ -131,6 +139,7 @@ module Grit
|
|
|
131
139
|
# Returns nothing
|
|
132
140
|
def fs_write(file, contents)
|
|
133
141
|
path = File.join(self.git_dir, file)
|
|
142
|
+
raise "Invalid path: #{path}" unless File.absolute_path(path) == path
|
|
134
143
|
FileUtils.mkdir_p(File.dirname(path))
|
|
135
144
|
File.open(path, 'w') do |f|
|
|
136
145
|
f.write(contents)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gitlab-grit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.7.
|
|
4
|
+
version: 2.7.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tom Preston-Werner
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2014-
|
|
13
|
+
date: 2014-12-12 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: charlock_holmes
|
|
@@ -157,4 +157,3 @@ signing_key:
|
|
|
157
157
|
specification_version: 4
|
|
158
158
|
summary: Ruby Git bindings.
|
|
159
159
|
test_files: []
|
|
160
|
-
has_rdoc:
|