Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/executor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def pin_packages_and_commit(spec)
end
end
return false if applied.empty?
@git.commit_all(message: commit_message_for(spec))
@git.commit_changes(message: commit_message_for(spec))
end

def commit_message_for(spec)
Expand Down
4 changes: 2 additions & 2 deletions lib/git_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def checkout_fresh_branch(branch:, base:)
# Stages all changes and commits with the given message. Returns true
# if a commit was actually created, false if there was nothing to
# commit (which usually means `bin/importmap pin` was a no-op).
def commit_all(message:)
@runner.run!("git", "add", "-A")
def commit_changes(message:)
@runner.run!("git", "add", "config/importmap.rb", "vendor/javascript")
# `git diff --cached --quiet` exits 0 if there are no staged changes.
diff = @runner.run("git", "diff", "--cached", "--quiet")
return false if diff.success?
Expand Down
4 changes: 2 additions & 2 deletions test/executor_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def checkout_fresh_branch(branch:, base:)
nil
end

def commit_all(message:)
def commit_changes(message:)
@commits << message
@commit_returns
end
Expand Down Expand Up @@ -162,7 +162,7 @@ def test_open_action_pins_pushes_and_creates_pr
def test_open_action_skips_pr_creation_when_pinning_produced_no_changes
# Race condition: the importmap was updated between the planner's read
# and the executor's run, so `bin/importmap pin` is a no-op. The
# `git diff --cached --quiet` step returns true; commit_all returns
# `git diff --cached --quiet` step returns true; commit_changes returns
# false; we abort the open and record a skip.
s = spec(branch: "importmap-updates/patch", packages: [bump("lodash", "4.17.20", "4.17.21")])
@runner.add(pattern: ["bin/importmap", "pin", "lodash@4.17.21"], stdout: "pinned\n")
Expand Down
Loading