title: Git branches to be merged in shell script variable
body: <p>I'm creating a an script that merge the branches defined in a shell script variable. Here is part of the script</p>
  
  <pre><code># Here is how we are setting the variable 'branches'
  ALL_BRANCHES=`git ls-remote . | cut -d $'\t' -f 2` # THIS WILL INCLUDE THE FOLDER AS PREFIX
  includePattern=
  if [[ -n "$INCLUDE_PATTERN" ]] ; then
    export IFS=","
    for pattern in $INCLUDE_PATTERN; do
      includePattern="$includePattern -e $REMOTE_FOLDER$pattern"  
    done
  fi
  branches=`echo "$ALL_BRANCHES" | eval "grep $includePattern"`
  
  echo "B = $branches"
  echo "C = git merge -q --no-edit $branches"
  git merge -q --no-edit $branches
  </code></pre>
  
  <p>This is the output</p>
  
  <pre><code>B = refs/remotes/origin/XXX refs/remotes/origin/XXY
  C = git merge -q --no-edit refs/remotes/origin/XXX refs/remotes/origin/XXY
  merge: refs/remotes/origin/XXX refs/remotes/origin/XXY - not something we can merge
  </code></pre>
  
  <p>Why this is not working?</p>
  
  <p><strong>INFO:</strong> When I do a copy&amp;paste of the command (printed by the <code>echo "C = ..."</code> it works as expected </p>
  
  <p><strong>MORE INFO:</strong> When I run <code>eval "git merge -q --no-edit $branches"</code> I got another error</p>
  
  <pre><code>/usr/lib/git-core/git-merge-octopus: 1: eval: Bad substitution
  Merge with strategy octopus failed.
  </code></pre>