NaxxHua · GitHub

Heads-up / possible defensive workaround request. Root cause is upstream in VS Code's built-in Copilot, filed at microsoft/vscode#320880 — but it surfaces only through Dart-Code-spawned processes, so flagging here.

What happens

The built-in GitHub Copilot Chat extension mutates the shared extension host's process.env at runtime:

GIT_CONFIG_COUNT=1
GIT_CONFIG_KEY_0=safe.bareRepository
GIT_CONFIG_VALUE_0=explicit

The Flutter daemon Dart-Code spawns inherits it (confirmed via ps eww <daemon-pid> | tr ' ' '\n' | grep GIT_). That breaks xcodebuild/SwiftPM, whose repo caches are bare repos:

fatal: cannot use bare repository '.../org.swift.swiftpm/repositories/firebase-ios-sdk-...' (safe.bareRepository is 'explicit')
xcodebuild: error: Could not resolve package dependencies
→ Failed to build iOS app
→ Uncategorized (Xcode): xcodebuild encountered an error (74)

Terminal flutter run and Xcode work fine — only VS Code launches fail. It's intermittent: a daemon spawned before Copilot activates is clean.

Working workaround (via Dart-Code!)

"dart.env": { "GIT_CONFIG_COUNT": "0" }

then Reload Window. This makes git ignore the injected env config for Dart-spawned processes. Verified: poisoned git fetch → fatal; with GIT_CONFIG_COUNT=0 → exit 0.

Versions

  • Dart-Code with VS Code 1.122.1, macOS 26.4, Xcode 26.5, Flutter iOS + SwiftPM (Firebase)

Request

Could Dart-Code defend against env contamination from other extensions — e.g. strip/reset injected GIT_CONFIG_* (or set GIT_CONFIG_COUNT=0) when spawning the Flutter/xcodebuild toolchain? Or document this dart.env workaround for affected users? git config --global safe.bareRepository all does NOT help — env-injected config outranks global.

Read the original on github.com ↗