If a reference is broken, suppress its peeled value.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
/*
* Regardless of what the file header said, we
- * definitely know the value of *this* reference:
+ * definitely know the value of *this* reference. But
+ * we suppress it if the reference is broken:
*/
- iter->base.flags |= REF_KNOWS_PEELED;
+ if ((iter->base.flags & REF_ISBROKEN)) {
+ oidclr(&iter->peeled);
+ iter->base.flags &= ~REF_KNOWS_PEELED;
+ } else {
+ iter->base.flags |= REF_KNOWS_PEELED;
+ }
} else {
oidclr(&iter->peeled);
}