Skip to content

Commit 9fd5cf7

Browse files
Merge branch 'main' into harry/pnpm-trust-downgrade-version-fallback
2 parents d68f59d + 4f03705 commit 9fd5cf7

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

common/lib/dependabot/workspace/git.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def store_change(memo = nil)
7171
.returns(T.nilable(T::Array[Dependabot::Workspace::ChangeAttempt]))
7272
end
7373
def capture_failed_change_attempt(memo = nil, error = nil)
74-
return nil if changed_files(ignored_mode: "matching").empty? && error.nil?
74+
return nil if changed_files(ignored_mode: "matching").empty?
7575

7676
sha = stash(memo)
7777
change_attempts << ChangeAttempt.new(self, id: sha, memo: memo, error: error)

common/spec/dependabot/workspace/git_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,17 @@
137137
expect(workspace.failed_change_attempts.size).to eq(1)
138138
end
139139
end
140+
141+
context "when error occurs with no file changes" do
142+
it "does not record a change attempt" do
143+
expect do
144+
workspace.change("no changes error") { raise "boom" }
145+
end.to raise_error(RuntimeError, "boom")
146+
147+
expect(workspace.change_attempts).to be_empty
148+
expect(workspace.failed_change_attempts).to be_empty
149+
end
150+
end
140151
end
141152
end
142153

0 commit comments

Comments
 (0)