WIP: rework the branch analysis.

Signed-off-by: Jean-Yves Tinevez <jean-yves.tinevez@pasteur.fr>