Text streams like this should be read using a while loop rather than for, which is probably causing the issue (although I cannot reproduce it). A simple way to do this:
git branch | grepwhile IFS= read -vr line
do
echo "${line:2}"
done
Comparison:
$ cd -- "$(mktemp -d)"
$ git init
Initialized empty Git repository in /tmp/tmp.MJFmu7q7EH/.git/
$ touch README
$ git commit --allow-empty -m "Initial commit"
[master (root-commit) da46b03] Initial commit
$ git branch foo
$ git branch
foo
* master
$ for i in $(git branch)
> do
> echo $i
> done
foo
*
master
$ git branch | while IFS= read -r line
> do
> echo "${line:2}"
> done
foo
master