From 19a182a26ae7f46d76667b6c50cd9fb4ed29fd75 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Thu, 25 Dec 2025 22:43:54 -0800 Subject: [PATCH] docs(git): Add thread-safety warning to ResetCaches() (bd-43xj) --- internal/git/gitdir.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/git/gitdir.go b/internal/git/gitdir.go index 7895dd7c..b425b064 100644 --- a/internal/git/gitdir.go +++ b/internal/git/gitdir.go @@ -212,6 +212,8 @@ func getGitDirNoError(flag string) string { // by tests that need to change directory between subtests. // In production, these caches are safe because the working directory // doesn't change during a single command execution. +// +// WARNING: Not thread-safe. Only call from single-threaded test contexts. func ResetCaches() { isWorktreeOnce = sync.Once{} isWorktreeResult = false