dart-lang / build

A build system for Dart written in Dart
https://pub.dev/packages/build
BSD 3-Clause "New" or "Revised" License
791 stars 211 forks source link

`_gitIsClean()` in `_test/test/common/utils.dart` broken in non-English environments #3754

Closed simolus3 closed 2 months ago

simolus3 commented 2 months ago

A low priority issue, but I wanted to mention it since it did just bite me. The output of git status is localized, but _gitIsClean() only considers the working tree to be clean if it contains nothing to commit, working tree clean. Mine actually outputs this:

_test$ git status .
Auf Branch bwc-fixes
Ihr Branch ist 1 Commit vor 'origin/bwc-fixes'.
  (benutzen Sie "git push", um lokale Commits zu publizieren)

nichts zu committen, Arbeitsverzeichnis unverändert

I think build_verify uses a command that list changed files, asserting that the output is empty. That might be more reliable to work around this issue, or perhaps the LANG environment variable should be set explicitly before invoking git.

jakemac53 commented 2 months ago

Relying on the specific text seems generally less than ideal so switching to something more robust seems like a good idea

jakemac53 commented 2 months ago

Looks like --porcelain gives a much more reliable output (no output means clean). Easy fix so I will send something out.