Correctly identify the parent branch (bug #10014)