Fix current branch detection

When -C was used, that branch was considered to be the current one.