diff --git a/lib/executor.rb b/lib/executor.rb index b161736..7890d13 100644 --- a/lib/executor.rb +++ b/lib/executor.rb @@ -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) diff --git a/lib/git_client.rb b/lib/git_client.rb index 98fd0b6..9b9cbe9 100644 --- a/lib/git_client.rb +++ b/lib/git_client.rb @@ -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? diff --git a/test/executor_test.rb b/test/executor_test.rb index 021dcc5..52f1fe1 100644 --- a/test/executor_test.rb +++ b/test/executor_test.rb @@ -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 @@ -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")