Repair patch state blob reuse
commit8c9118af2555a4558e094d6de725efcc599a27f8
authorPeter Grayson <pete@jpgrayson.net>
Fri, 10 Dec 2021 04:01:21 +0000 (9 23:01 -0500)
committerPeter Grayson <pete@jpgrayson.net>
Fri, 10 Dec 2021 18:33:10 +0000 (10 13:33 -0500)
treea8c2c578c4484e46c6388ea145186920ef8de871
parent2c4e2f4caad94908a9315fb7b9be3951876d8203
Repair patch state blob reuse

The patch state blobs found in refs/stacks/<branch>:patches/<patchname>
can/should be reused when saving new stack state. The intent was there,
but when testing whether a patch's state blob was in the previous
TreeData, i.e. with `pn in prev_tree.data`, the test would always fail
because TreeData.__iter__() iterated over (name, (perm, obj)) tuples and
not just patch names.

The issue is resolved by adding a TreeData.__contains__() method.

Signed-off-by: Peter Grayson <pete@jpgrayson.net>
stgit/lib/git/objects.py