[Bug 1335638] Re: git fetch fails silently if remote repo is not checked out on any branch

Anders Kaseorg andersk at mit.edu
Sun Jun 29 23:08:57 UTC 2014


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.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to git in Ubuntu.
https://bugs.launchpad.net/bugs/1335638

Title:
  git fetch fails silently if remote repo is not checked out on any
  branch

Status in “git” package in Ubuntu:
  New

Bug description:
  Reproduction steps:
  1) Create a git repository that has no branches at all (detached HEAD and no branches).
  2) Let this repository serve as a remote to another repository.
     Now, 'git fetch <name>' fails silently.

  Notes:
  1) If it cannot succeed, let it fail loudly at least, if possible providing a useful hint.
  2) A repository with no branches at all is not that rare thing as one might think - e.g. clone AOSP (Android Open Source Project) - every one of its git repos is checked out at some point with no branches at all.
  3) I have built git version 2 - the bug is still there.

  ProblemType: Bug
  DistroRelease: Ubuntu 14.04
  Package: git 1:1.9.1-1
  ProcVersionSignature: Ubuntu 3.13.0-29.53-generic 3.13.11.2
  Uname: Linux 3.13.0-29-generic x86_64
  NonfreeKernelModules: nvidia
  ApportVersion: 2.14.1-0ubuntu3.2
  Architecture: amd64
  CurrentDesktop: Unity
  Date: Sun Jun 29 18:25:16 2014
  InstallationDate: Installed on 2011-10-23 (980 days ago)
  InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111011)
  SourcePackage: git
  UpgradeStatus: Upgraded to trusty on 2014-05-25 (35 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/git/+bug/1335638/+subscriptions



More information about the foundations-bugs mailing list