autotest/autotest — pull request #669 by vinsonlee (2013-06-19 18:33:51+00:00)
Title: get_autotest_from_git doesn't work for non-master branches.

The get_autotest_from_git function fails when trying to checkout a branch that is not the master branch.

This reproduction case demonstrates the failure.

$ git init
$ git remote add origin git://github.com/autotest/autotest.git
$ git config branch.next.remote origin
$ git config branch.next.merge refs/heads/next
$ git pull
[...]
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull ').
See git-pull(1) for details.

If you often merge with the same branch, you may want to
use something like the following in your configuration file:
[branch "master"]
remote =
merge =

[remote ""]
url =
fetch =

See git-config(1) for details.

$ cat .git/config
[...]
[remote "origin"]
url = git://github.com/autotest/autotest.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "next"]
remote = origin
merge = refs/heads/next