Make _WinBashStatus instances carry all their info · gitpython-developers/GitPython@7ff3cee · GitHub
Skip to content

Commit 7ff3cee

Browse files
committed
Make _WinBashStatus instances carry all their info
This changes _WinBashStatus from an enum to a sum type so that, rather than having a global _WinBashStatus.ERROR_WHILE_CHECKING object whose error_or_process attribute may be absent and, if present, carries an object set on the most recent call to check(), we get a _WinBashStatus.ErrorWhileChecking instance that carries an error_or_process attribute specific to the call. Ordinarily this would not make a difference, other than that the global attribute usage was confusing in the code, because typically _WinBashStatus.check() is called only once. However, when debugging, having the old attribute on the same object be clobbered is undesirable. This adds the sumtypes library as a test dependency, to allow the enum to be rewritten as a sum type without loss of clarity. This is a development-only dependency; the main dependencies are unchanged.
1 parent 8621e89 commit 7ff3cee

2 files changed

Lines changed: 32 additions & 35 deletions

File tree

test-requirements.txt

Lines changed: 1 addition & 0 deletions

test/test_index.py

Lines changed: 31 additions & 35 deletions

0 commit comments

Comments
 (0)