224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
|
# File 'lib/datadog/ci/git/local_repository.rb', line 224
def self.git_generate_packfiles(included_commits:, excluded_commits:, path:)
return nil unless File.exist?(path)
commit_tree = git_commits_rev_list(included_commits: included_commits, excluded_commits: excluded_commits)
return nil if commit_tree.nil?
basename = SecureRandom.hex(4)
Telemetry.git_command(Ext::Telemetry::Command::PACK_OBJECTS)
duration_ms = Core::Utils::Time.measure(:float_millisecond) do
exec_git_command(
"git pack-objects --compression=9 --max-pack-size=3m #{path}/#{basename}",
stdin: commit_tree
)
end
Telemetry.git_command_ms(Ext::Telemetry::Command::PACK_OBJECTS, duration_ms)
basename
rescue => e
log_failure(e, "git generate packfiles")
telemetry_track_error(e, Ext::Telemetry::Command::PACK_OBJECTS)
nil
end
|