git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Corruption: empty refs/heads in otherwise filled repo: cannot clone?

From
JWJan Wielemaker <j.wielemaker@uva.nl>
Date
Jun 30, 2008, 09:49 UTC
Message-ID
<200806301149.18115.J.Wielemaker@uva.nl>
Hi,

I'm a bit puzzled. I have a bare repository, somehow without any files in refs/heads.

It started using conversion from CVS via SVN using git-1.5.3.4. It is configured for group access and there are a number of SSH accounts on the machine in the proper group using git-shell for fellow developers.

I never have any problems, but after upgrading to git-git (1.5.6.rc3) fellow users get error:

error: no such remote ref refs/heads/JPL31 error: no such remote ref refs/heads/V57X error: no such remote ref refs/heads/V5_4_patches error: no such remote ref refs/heads/XML_UNICODE error: no such remote ref refs/heads/attvar error: no such remote ref refs/heads/gmp

Creating a new account and doing a fresh clone I even got the fatal error there are no remote branches!? Still, using my own user id, I could do anything I wanted. I checked permissions to see whether there are differences between group and owner permissions, but couldn't find anything suspicious. git fsck --full on the repo gives no errors.

It turns out the directory refs/heads is empty!?

I made a fresh clone of the repo as myself, creating all references nicely in refs/remotes/origin. Then I copied these files to refs/heads into the main bare repository and now all appears to work nicely again. Still, this is a bit worrying ... My questions:

    * Is my work-around safe and sound?
    * How can this have happened?
    * Why can I clone as myself and not as anyone else!?  Stranger:
    after a "sudo -u <someone> /bin/bash" I could not clone.  I can
    copy the entire tree using cp -a, but I still cannot clone the
    copy with this user, while as myself I can clone the copy. 
    Somehow `as myself' appears to get the branchheads from somewhere.
    There is only one copy of git installed, so both users use the
    same.  What can cause this difference?
	Thanks --- Jan
Next: Jakub Narebski
Message 1 of 10 in “Corruption: empty refs/heads in otherwise filled repo: cannot clone?”
  1. Jan WielemakerJun 30, 2008
  2. Jakub NarebskiJun 30, 2008
  3. Jan WielemakerJun 30, 2008
  4. Jakub NarebskiJun 30, 2008
  5. Jan WielemakerJun 30, 2008
  6. Jakub NarebskiJun 30, 2008
  7. Jan WielemakerJun 30, 2008
  8. Daniel BarkalowJun 30, 2008
  9. Jan WielemakerJun 30, 2008
  10. Björn SteinbrinkJun 30, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.