gitlab-grit 2.7.2 → 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 +7 -2
- metadata +2 -2
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
@@ -117,7 +117,9 @@ module Grit
|
|
117
117
|
#
|
118
118
|
# Returns Boolean
|
119
119
|
def fs_exist?(file)
|
120
|
-
File.
|
120
|
+
path = File.join(self.git_dir, file)
|
121
|
+
raise "Invalid path: #{path}" unless File.absolute_path(path) == path
|
122
|
+
File.exist?(path)
|
121
123
|
end
|
122
124
|
|
123
125
|
# Read a normal file from the filesystem.
|
@@ -125,7 +127,9 @@ module Grit
|
|
125
127
|
#
|
126
128
|
# Returns the String contents of the file
|
127
129
|
def fs_read(file)
|
128
|
-
File.
|
130
|
+
path = File.join(self.git_dir, file)
|
131
|
+
raise "Invalid path: #{path}" unless File.absolute_path(path) == path
|
132
|
+
File.read(path)
|
129
133
|
end
|
130
134
|
|
131
135
|
# Write a normal file to the filesystem.
|
@@ -135,6 +139,7 @@ module Grit
|
|
135
139
|
# Returns nothing
|
136
140
|
def fs_write(file, contents)
|
137
141
|
path = File.join(self.git_dir, file)
|
142
|
+
raise "Invalid path: #{path}" unless File.absolute_path(path) == path
|
138
143
|
FileUtils.mkdir_p(File.dirname(path))
|
139
144
|
File.open(path, 'w') do |f|
|
140
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
|