Corruption: empty refs/heads in otherwise filled repo: cannot clone?
- From
- Jan 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