status: reorder retrieve_head_tree error checks Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>