Don't split the initial branch list on all whitespace

If there is an explicit upstream HEAD pointing at master, the
"if -> in branch" is supposed to filter it out. Unfortunately,
because split() does all whitespace, we actually lose the -> in
the line so we can't exclude those lines.

Instead, split first on newlines explicitly. Then do the filter on
content. Then, when we're happy it's a good target, split on
whitespace.

Change-Id: I2ed39570eb26a0c7f1fa1f7381c1e14217c981bb
Merge "Don't split the initial branch list on all whitespace"