From fb787b5111d45ce50e3a09148cc106feeb2771bb Mon Sep 17 00:00:00 2001 From: Jake Coffman Date: Wed, 15 Jan 2025 09:17:38 -0600 Subject: [PATCH] remove more diffs --- common/lib/dependabot/workspace/change_attempt.rb | 2 +- common/lib/dependabot/workspace/git.rb | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/common/lib/dependabot/workspace/change_attempt.rb b/common/lib/dependabot/workspace/change_attempt.rb index e97d426add..af111a3eb2 100644 --- a/common/lib/dependabot/workspace/change_attempt.rb +++ b/common/lib/dependabot/workspace/change_attempt.rb @@ -28,7 +28,7 @@ class ChangeAttempt error: T.nilable(StandardError) ).void end - def initialize(workspace, id:, memo:, diff: nil, error: nil) + def initialize(workspace, id:, memo:, error: nil) @workspace = workspace @id = id @memo = memo diff --git a/common/lib/dependabot/workspace/git.rb b/common/lib/dependabot/workspace/git.rb index 28a6b63554..2b781ebe72 100644 --- a/common/lib/dependabot/workspace/git.rb +++ b/common/lib/dependabot/workspace/git.rb @@ -56,9 +56,9 @@ def store_change(memo = nil) return nil if changed_files(ignored_mode: "no").empty? debug("store_change - before: #{current_commit}") - sha, diff = commit(memo) + sha = commit(memo) - change_attempts << ChangeAttempt.new(self, id: sha, memo: memo, diff: diff) + change_attempts << ChangeAttempt.new(self, id: sha, memo: memo) ensure debug("store_change - after: #{current_commit}") end @@ -125,10 +125,9 @@ def stash(memo = nil) last_stash_sha end - sig { params(memo: T.nilable(String)).returns([String, String]) } + sig { params(memo: T.nilable(String)).returns(String) } def commit(memo = nil) run_shell_command("git add #{path}") - diff = run_shell_command("git diff --cached .") msg = memo || "workspace change" run_shell_command( @@ -137,7 +136,7 @@ def commit(memo = nil) allow_unsafe_shell_command: true ) - [head_sha, diff] + head_sha end sig { params(sha: String).returns(String) }