Fix 'Error: undefined method `sub' for nil:NilClass' when newline is included git alias

When there is at least one newline in git aliases like:

    ln = log --pretty=format:'%C(blue bold)%h %C(yellow bold)%cd %C(magenta bold)%cn %C(red bold)%d\n\n%C(white bold)%s\n%Creset%b'

tab completion fails with 'Error: undefined method `sub' for nil:NilClass'.

This commit fixes the issue.