Skip to content

Commit

Permalink
remove more diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
jakecoffman committed Jan 15, 2025
1 parent c08e96d commit fb787b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion common/lib/dependabot/workspace/change_attempt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions common/lib/dependabot/workspace/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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) }
Expand Down

0 comments on commit fb787b5

Please sign in to comment.