dependabot-common 0.119.0.beta1 → 0.119.0

This diff has not been reviewed by any users.
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: 80651d092678ba4841245e6a4fc002dfba1ab3b2e1a46ed84882885ece8e4989
4
- data.tar.gz: f8a26ab2da34de5159d7a94d53a0d81d6f490c7ef8e045dca662bfec0d024dd8
3
+ metadata.gz: 11774a38db75940a3727571cdf972d5faa8cf2c165c5df9b62584dd9222d7a1d
4
+ data.tar.gz: f29fba0197829fac53e36527ba0555eac9ae227cf59beda92794bbdb0fe9afc1
5
5
  SHA512:
6
- metadata.gz: efe477821294e613b73ff714056185aa7c8bfaa1133e833d0c9b10ec45316de0937245faa87b81566b5fd4fa671463908e2079a65803eee032cd3028f8070304
7
- data.tar.gz: 5b3e6f20b0df041c73eb3f5313474d62910d283748a46c4b5808123c41b6d8ec4a0d213ab33667f9770ff1a9502f6a2906e0ddaec09892e8b37ed167843e032d
6
+ metadata.gz: eff4565d876fb1fe64908023ea1d44147733543e772a5fba9cca46f166c8bc497c537f2d4968b17f8268faa523167e7a9292f235ec1630bb069231ccc30ad72a
7
+ data.tar.gz: 129157964c2f049c0165e2ff9b6c868ccedea66812d1b267cb102b2151e5e42eb6e14a541c2612f0e89acf3b5169f842fd8684ad93d7c4d786573ba8f125eb4a
@@ -83,6 +83,12 @@ module Dependabot
83
83
  content_encoding == ContentEncoding::BASE64
84
84
  end
85
85
 
86
+ def decoded_content
87
+ return Base64.decode64(content) if binary?
88
+
89
+ content
90
+ end
91
+
86
92
  private
87
93
 
88
94
  def clean_directory(directory)
@@ -428,12 +428,16 @@ module Dependabot
428
428
  def _clone_repo_contents(target_directory:)
429
429
  SharedHelpers.with_git_configured(credentials: credentials) do
430
430
  path = target_directory || File.join("tmp", source.repo)
431
+ # Assume we're retrying the same branch, or that a `target_directory`
432
+ # is specified when retrying a different branch.
431
433
  return path if Dir.exist?(File.join(path, ".git"))
432
434
 
433
435
  FileUtils.mkdir_p(path)
434
436
  br_opt = " --branch=#{source.branch} --single-branch" if source.branch
435
437
  SharedHelpers.run_shell_command(
436
- "git clone --depth=1#{br_opt} #{source.url} #{path}"
438
+ <<~CMD
439
+ git clone --no-tags --no-recurse-submodules --depth=1#{br_opt} #{source.url} #{path}
440
+ CMD
437
441
  )
438
442
  path
439
443
  end
@@ -170,13 +170,13 @@ module Dependabot
170
170
  sha: file.content
171
171
  }
172
172
  else
173
- content = if file.binary?
173
+ content = if file.deleted?
174
+ { sha: nil }
175
+ elsif file.binary?
174
176
  sha = github_client_for_source.create_blob(
175
177
  source.repo, file.content, "base64"
176
178
  )
177
179
  { sha: sha }
178
- elsif file.deleted?
179
- { sha: nil }
180
180
  else
181
181
  { content: file.content }
182
182
  end
@@ -124,14 +124,7 @@ module Dependabot
124
124
 
125
125
  def create_tree
126
126
  file_trees = files.map do |file|
127
- if %w(file symlink).include?(file.type)
128
- {
129
- path: (file.symlink_target || file.path).sub(%r{^/}, ""),
130
- mode: "100644",
131
- type: "blob",
132
- content: file.content
133
- }
134
- elsif file.type == "submodule"
127
+ if file.type == "submodule"
135
128
  {
136
129
  path: file.path.sub(%r{^/}, ""),
137
130
  mode: "160000",
@@ -139,7 +132,23 @@ module Dependabot
139
132
  sha: file.content
140
133
  }
141
134
  else
142
- raise "Unknown file type #{file.type}"
135
+ content = if file.deleted?
136
+ { sha: nil }
137
+ elsif file.binary?
138
+ sha = github_client_for_source.create_blob(
139
+ source.repo, file.content, "base64"
140
+ )
141
+ { sha: sha }
142
+ else
143
+ { content: file.content }
144
+ end
145
+
146
+ {
147
+ path: (file.symlink_target ||
148
+ file.path).sub(%r{^/}, ""),
149
+ mode: "100644",
150
+ type: "blob"
151
+ }.merge(content)
143
152
  end
144
153
  end
145
154
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.119.0.beta1"
4
+ VERSION = "0.119.0"
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.119.0.beta1
4
+ version: 0.119.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-20 00:00:00.000000000 Z
11
+ date: 2020-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-codecommit
@@ -393,7 +393,7 @@ homepage: https://github.com/dependabot/dependabot-core
393
393
  licenses:
394
394
  - Nonstandard
395
395
  metadata: {}
396
- post_install_message:
396
+ post_install_message:
397
397
  rdoc_options: []
398
398
  require_paths:
399
399
  - lib
@@ -408,8 +408,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
408
408
  - !ruby/object:Gem::Version
409
409
  version: 2.7.3
410
410
  requirements: []
411
- rubygems_version: 3.1.4
412
- signing_key:
411
+ rubygems_version: 3.1.2
412
+ signing_key:
413
413
  specification_version: 4
414
414
  summary: Shared code used between Dependabot package managers
415
415
  test_files: []