docs(git): Add thread-safety warning to ResetCaches() (bd-43xj)

This commit is contained in:
Steve Yegge
2025-12-25 22:43:54 -08:00
parent 1d3a7f98df
commit 19a182a26a

View File

@@ -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