Comment 2 for bug 1335638

Revision history for this message
Anders Kaseorg (andersk) wrote :

I believe Git is working as designed. You asked it to fetch the empty set of branches, so that’s what it did.

It is slightly confusing that, in the normal non-detached case, ‘git clone’ creates the refs/remotes/origin/HEAD symref pointing to the remote’s default branch; however, even in this case, ‘git fetch’ does not update it.

If you think the design is wrong, you may want to bring this up with the upstream developers.

But I don’t believe that the AOSP repositories have no branches. They look completely normal to me.

$ git clone https://android.googlesource.com/platform/packages/apps/Email
$ cd Email
$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/donut-release
  remotes/origin/donut-release2
  remotes/origin/eclair-passion-release
  […]
  remotes/origin/master
  remotes/origin/tools_r20
  remotes/origin/tools_r21
  remotes/origin/tools_r22
  remotes/origin/tools_r22.2

I think the answer is that you should not create repositories with no branches.