One function

fg_validator in amoffat/sh

The author described this change as fixes regression where `_fg` validator fails if `_fg=False`. closes #520. It counts as a record because the check below fails on the code as it stood at c62b0335a and passes on e2cb0202e, with nothing else changed between the two runs.

Projectamoffat/sh
Fix saved2020-04-28
Sharing licenceMIT · LICENSE.txt
Change size+1 1

What the code was meant to do, written into the code itself as a docstring

fg is not valid with basically every other option

The change

99 whitelist = set(("env", "fg", "cwd"))
1010 offending = set(passed_kwargs.keys()) - whitelist
1111
12- if "fg" in passed_kwargs and offending:
12+ if "fg" in passed_kwargs and passed_kwargs["fg"] and offending:
1313 invalid.append(("fg", msg))
1414 return invalid

The check that tells the two apart

failpass·test.py::FunctionalTests::test_fg_false

Check file test.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before itc62b0335a66059fca9598019643f58a58e3c3e4d
Broken version dated2020-04-27
Modulesh
Units changedfg_validator
Fingerprint88b3552c36cd0b67
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in amoffat/sh