dependabot-git_submodules 0.99.0 → 0.99.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93b9093543f7ff3719047d48055553fbeac1b515bcc4a94dd018ea006bede296
4
- data.tar.gz: cc89eb59967160f2f203cf5623c8fdadf4543a6c814f04192850a5e8b35c3f7f
3
+ metadata.gz: 82234c7cc2a6065facec4a9dca3fd1de04600f4225e1dc2dfc8a0bc65f341776
4
+ data.tar.gz: 8c522d7c32a9e7015420e9f31196bcf36d67fec395fd84df225e7fe12aa64e3b
5
5
  SHA512:
6
- metadata.gz: 1b59ce977c3d28f5d065e37a4dfe22d26afdaad71568edfa376ce6ac6b240ff93b01ebe0e7edbe2f345de36e158fec19c6e664dcc736f9dc319b49d20cbd3d23
7
- data.tar.gz: d90b90c5763ccbb489711f380fab5a8683cc11ed3567f8c9409c2c73e735f531a7dcff048a0658fdd92a2921a6859cdbd62f6445a0574250cf7f2906515dfba4
6
+ metadata.gz: ae3badbc820c7205c65b396ca09a3edbf43d3ac54d59cec1a6673c46789b72de9c0181ff955f31ba55cecd933155a3782b395f7be947f7b94c48bbe91b07e200
7
+ data.tar.gz: 34064329fe886403d959b44f58edc43a57380aae9bdaf646ac3bda8ec9255c1daac86288c740624846ab64561419d84265da1cfb9bd0b48116b635488fc3995e
@@ -30,16 +30,19 @@ module Dependabot
30
30
  end
31
31
 
32
32
  def submodule_refs
33
- submodule_paths.
33
+ @submodule_refs ||=
34
+ submodule_paths.
34
35
  map { |path| fetch_submodule_ref_from_host(path) }.
35
- tap { |refs| refs.each { |f| f.support_file = true } }
36
+ tap { |refs| refs.each { |f| f.support_file = true } }.
37
+ uniq
36
38
  end
37
39
 
38
40
  def submodule_paths
39
- Dependabot::SharedHelpers.in_a_temporary_directory do
40
- File.write(".gitmodules", gitmodules_file.content)
41
- ParseConfig.new(".gitmodules").params.values.map { |p| p["path"] }
42
- end
41
+ @submodule_paths ||=
42
+ Dependabot::SharedHelpers.in_a_temporary_directory do
43
+ File.write(".gitmodules", gitmodules_file.content)
44
+ ParseConfig.new(".gitmodules").params.values.map { |p| p["path"] }
45
+ end
43
46
  end
44
47
 
45
48
  def fetch_submodule_ref_from_host(submodule_path)
@@ -14,11 +14,13 @@ module Dependabot
14
14
  File.write(".gitmodules", gitmodules_file.content)
15
15
 
16
16
  ParseConfig.new(".gitmodules").params.map do |_, params|
17
- branch = params["branch"]
17
+ if params.fetch("path").end_with?("/")
18
+ raise DependencyFileNotParseable, gitmodules_file.path
19
+ end
18
20
 
19
21
  Dependency.new(
20
- name: params["path"],
21
- version: submodule_sha(params["path"]),
22
+ name: params.fetch("path"),
23
+ version: submodule_sha(params.fetch("path")),
22
24
  package_manager: "submodules",
23
25
  requirements: [{
24
26
  requirement: nil,
@@ -26,8 +28,8 @@ module Dependabot
26
28
  source: {
27
29
  type: "git",
28
30
  url: absolute_url(params["url"]),
29
- branch: branch,
30
- ref: branch
31
+ branch: params["branch"],
32
+ ref: params["branch"]
31
33
  },
32
34
  groups: []
33
35
  }]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-git_submodules
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.99.0
4
+ version: 0.99.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-05 00:00:00.000000000 Z
11
+ date: 2019-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dependabot-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.99.0
19
+ version: 0.99.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.99.0
26
+ version: 0.99.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement