title: Bash colon operator in variable substitution?
body: <p>I inherited some bash code and these two lines are bewildering me:</p>
  
  <pre><code>branch_name=`git describe --contains --all HEAD`
  branch_name=${branch_name:-HEAD}
  </code></pre>
  
  <p>My understanding of the <code>:</code> colon operator is that is creates a substring based on an index so using a string, <code>-HEAD</code> in this case, does not make any sense.</p>