(Yes, that’s a source text / Star Wars joke.)
党同伐異
tou.dou.batsu.i
Literally: faction – same – strike / punish – different
Alternately: Blind partisanship. Supporting one’s associates and attacking one’s rivals without any regard for what is actually correct or proper.
Notes: This phrase comes to us from our friend, the Book of the Later Han (Japanese 『後漢書』 = Gokanjo). It also has a more Japanese-style reading based on kanbun rules, 同じきに党がり異なるを伐つ (Onajiki ni muragari kotonaru wo utsu). Its parts may also be rearranged to give 党同伐異 (toudou ibatsu) or 伐異党同 (batsui toudou).

When a threat is felt, impartiality often takes a back seat compared to closing ranks and bristling up.