Re: failed to lock
- From
Jay Soffian <jaysoffian@gmail.com>
- Date
- Apr 15, 2010, 04:00 UTC
- Message-ID
- <k2x76718491004142100v6e1ece6djc62aa540e51eed5@mail.gmail.com>
- In-Reply-To
- <t2i76718491004141402h33bb2044g155ef1715c63904e@mail.gmail.com>
On Wed, Apr 14, 2010 at 5:02 PM, Jay Soffian <jaysoffian@gmail.com> wrote:
Show 14 quoted lines
> Ah, this is the problem: > > $ git push mirror > Total 0 (delta 0), reused 0 (delta 0) > error: Ref refs/remotes/origin/master is at > 81358fbe72926d74bdeda85669d655e144572c48 but expected > 3c0a87afc2e9248890dd6de40b5039bcb48c8516 > remote: error: failed to lock refs/remotes/origin/master > To ssh://mirror/repo > 3c0a87a..81358fb origin/HEAD -> origin/HEAD > ! [remote rejected] origin/master -> origin/master (failed to lock) > error: failed to push some refs to 'ssh://mirror/repo' > > The origin/HEAD symref and --mirror do not get along together. Hmm.
Proposal: receive-pack should look through the list of heads it has received and check whether each is locally a symref. If so, and if the destination of the symref is also among the list of heads, it should ignore the symref update.
In the example above, receive-pack would determine that refs/remotes/origin/HEAD locally is a symref to refs/remotes/origin/master. Since refs/remotes/origin/master is in the list of heads, it would ignore the update for refs/remotes/origin/HEAD.
If that sounds reasonable, I can work on a patch.
In case you're wondering how I got into this situation:
server$ git clone --bare /shared/project.git ~/backup/project.git client$ git clone server:/shared/project.git client$ cd project client$ git remote add --mirror backup server:~/backup/project.git client$ work, commit, work, commit client$ git push backup
j.