Move identification of parent branch's remote def up into stack class.