Skip to content

Commit 6d4f577

Browse files
committed
Don't commit .bundle or vendor/bundle into update branches
\`git add -A\` was staging bundler files that \`ruby/setup-ruby\` writes into the workspace (.bundle/config, vendor/bundle/). These got committed into the first importmap branch. On the next checkout back to origin/main, git deleted them — and with the bundle path config and cached gems gone, subsequent \`bin/importmap pin\` calls failed with "Could not find gems". Unstaging both paths after \`git add -A\` keeps the commits clean and leaves bundler's environment intact across branch switches.
1 parent ce75bf9 commit 6d4f577

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lib/git_client.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def checkout_fresh_branch(branch:, base:)
3131
# commit (which usually means `bin/importmap pin` was a no-op).
3232
def commit_all(message:)
3333
@runner.run!("git", "add", "-A")
34+
@runner.run("git", "restore", "--staged", "--", ".bundle", "vendor/bundle")
3435
# `git diff --cached --quiet` exits 0 if there are no staged changes.
3536
diff = @runner.run("git", "diff", "--cached", "--quiet")
3637
return false if diff.success?

0 commit comments

Comments
 (0)