dependabot-common 0.156.5 → 0.156.9

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
  SHA256:
3
- metadata.gz: '04196eaeff8bc941ffd504cfbba6c5a3cb5b04b55b3ca7d8f48ca93210873503'
4
- data.tar.gz: c71029bee9231be559e3e45f017d59d9da2ff1f15a7ecebd88375bff59db8b8c
3
+ metadata.gz: 5b64bbea756471ef6276ee683a9b8894f0b80b4760836f47ce7e3d0b17b3c2ae
4
+ data.tar.gz: 3c36bcac93cbaa601e439c5b532c3797bb556fb89b763900f4163cdc9660fdc8
5
5
  SHA512:
6
- metadata.gz: e124fd94802c5430215bce88b2b1eb9465022364d99b8841dee7c97b55734b18e409ec858c35e15d22b02bde8d97b8200267bc45551a20b7db93e2529862b84a
7
- data.tar.gz: b1cdebbd613eb84535719fe377ae96cfeaefe74e4970182add66f565b8b659ad81840e285c8876208158b5988c8cec27e4cd8f3de9534372a06a6b59ca6bfe25
6
+ metadata.gz: bb4f58dfc6a6702618ca7d5cc8bb2cbdd6901e14960d8fdca43ac10f8b133a850935a7d833e59933d51d57b0882c2717bdfcc49ee8d11507de6bfdd5da926778
7
+ data.tar.gz: eae3d48724ce62134cf290d7fbd8d7becc9d935f36bb3e1f54d3b5278056eadb5cfce53e6851ecc4045e1b9d5f77a68d9edee3dd4c8c12eacfc5426ea04e8f76
@@ -157,11 +157,12 @@ module Dependabot
157
157
  path = Pathname.new(File.join(dir)).cleanpath.to_path.gsub(%r{^/*}, "")
158
158
 
159
159
  @repo_contents ||= {}
160
- @repo_contents[dir] ||= _fetch_repo_contents(
161
- path,
162
- raise_errors: raise_errors,
163
- fetch_submodules: fetch_submodules
164
- )
160
+ @repo_contents[dir] ||= if repo_contents_path
161
+ _cloned_repo_contents(path)
162
+ else
163
+ _fetch_repo_contents(path, raise_errors: raise_errors,
164
+ fetch_submodules: fetch_submodules)
165
+ end
165
166
  end
166
167
 
167
168
  #################################################
@@ -225,6 +226,31 @@ module Dependabot
225
226
  github_response.map { |f| _build_github_file_struct(f) }
226
227
  end
227
228
 
229
+ def _cloned_repo_contents(relative_path)
230
+ repo_path = File.join(clone_repo_contents, relative_path)
231
+ return [] unless Dir.exist?(repo_path)
232
+
233
+ Dir.entries(repo_path).map do |name|
234
+ next if [".", ".."].include?(name)
235
+
236
+ absolute_path = File.join(repo_path, name)
237
+ type = if File.symlink?(absolute_path)
238
+ "symlink"
239
+ elsif Dir.exist?(absolute_path)
240
+ "dir"
241
+ else
242
+ "file"
243
+ end
244
+
245
+ OpenStruct.new(
246
+ name: name,
247
+ path: Pathname.new(File.join(relative_path, name)).cleanpath.to_path,
248
+ type: type,
249
+ size: 0 # NOTE: added for parity with github contents API
250
+ )
251
+ end.compact
252
+ end
253
+
228
254
  def update_linked_paths(repo, path, commit, github_response)
229
255
  case github_response.type
230
256
  when "submodule"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.156.5"
4
+ VERSION = "0.156.9"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.156.5
4
+ version: 0.156.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-12 00:00:00.000000000 Z
11
+ date: 2021-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -469,7 +469,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
469
469
  - !ruby/object:Gem::Version
470
470
  version: 2.7.3
471
471
  requirements: []
472
- rubygems_version: 3.2.15
472
+ rubygems_version: 3.2.22
473
473
  signing_key:
474
474
  specification_version: 4
475
475
  summary: Shared code used between Dependabot package managers