Skip to content
Merged
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
10 changes: 10 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@ def self.ruby=(ruby)
ENV["GIT_CONFIG_NOSYSTEM"] = "1"
end

# Disable git background maintenance. Since Git 2.46, commands like
# `git commit` spawn a detached `git maintenance run --auto` process,
# which briefly creates `.git/objects/maintenance.lock`. That races with
# specs copying repositories with FileUtils.cp_r, causing flaky ENOENT
# failures. GIT_CONFIG_COUNT is available since Git 2.31 and silently
# ignored by older versions.
ENV["GIT_CONFIG_COUNT"] = "1"
ENV["GIT_CONFIG_KEY_0"] = "maintenance.auto"
ENV["GIT_CONFIG_VALUE_0"] = "false"

# Don't wrap output in tests
ENV["THOR_COLUMNS"] = "10000"

Expand Down