3 test_description='clone --branch option'
 
   7         echo refs/heads/"$1" >expect &&
 
   8         git symbolic-ref HEAD >actual &&
 
  17 test_expect_success 'setup' '
 
  19         (cd parent && git init &&
 
  20          echo one >file && git add file && git commit -m one &&
 
  21          git checkout -b two &&
 
  22          echo two >file && git add file && git commit -m two &&
 
  26 test_expect_success 'vanilla clone chooses HEAD' '
 
  27         git clone parent clone &&
 
  34 test_expect_success 'clone -b chooses specified branch' '
 
  35         git clone -b two parent clone-two &&
 
  42 test_expect_success 'clone -b sets up tracking' '
 
  44          echo origin >expect &&
 
  45          git config branch.two.remote >actual &&
 
  46          echo refs/heads/two >>expect &&
 
  47          git config branch.two.merge >>actual &&
 
  48          test_cmp expect actual
 
  52 test_expect_success 'clone -b does not munge remotes/origin/HEAD' '
 
  54          echo refs/remotes/origin/master >expect &&
 
  55          git symbolic-ref refs/remotes/origin/HEAD >actual &&
 
  56          test_cmp expect actual
 
  60 test_expect_success 'clone -b with bogus branch chooses HEAD' '
 
  61         git clone -b bogus parent clone-bogus &&