Skip to content

Commit 0652bcb

Browse files
committed
Merge pull request #9681 from ruby/claude/forward-port-a27d3e
Disable git background maintenance in bundler specs (cherry picked from commit c452a34)
1 parent 65c7c23 commit 0652bcb

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

bundler/spec/spec_helper.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ def self.ruby=(ruby)
115115
ENV["GIT_CONFIG_NOSYSTEM"] = "1"
116116
end
117117

118+
# Disable git background maintenance. Since Git 2.46, commands like
119+
# `git commit` spawn a detached `git maintenance run --auto` process,
120+
# which briefly creates `.git/objects/maintenance.lock`. That races with
121+
# specs copying repositories with FileUtils.cp_r, causing flaky ENOENT
122+
# failures. GIT_CONFIG_COUNT is available since Git 2.31 and silently
123+
# ignored by older versions.
124+
ENV["GIT_CONFIG_COUNT"] = "1"
125+
ENV["GIT_CONFIG_KEY_0"] = "maintenance.auto"
126+
ENV["GIT_CONFIG_VALUE_0"] = "false"
127+
118128
# Don't wrap output in tests
119129
ENV["THOR_COLUMNS"] = "10000"
120130

0 commit comments

Comments
 (0)