{"thread":{"id":"16797","subject":"remote tracking branch deletion problem","startedAt":"2008-12-19T11:57:11Z","lastAt":"2008-12-19T14:56:55Z","messageCount":2,"participants":["Thomas Jarosch","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"98350","messageId":"200812191257.18678.thomas.jarosch@intra2net.com","threadId":"16797","inReplyTo":null,"subject":"remote tracking branch deletion problem","fromName":"Thomas Jarosch","fromEmail":"thomas.jarosch@intra2net.com","sentAt":"2008-12-19T11:57:11Z","receivedAt":"2008-12-19T11:57:11Z","isPatch":false,"sender":{"key":"thomas.jarosch@intra2net.com","avatar":"https://avatars.githubusercontent.com/u/1146758?v=4"},"body":"Hello together,\n\nwhile playing around with git, I stumbled upon a strange remote tracking \nbranch deletion problem. It seems I'm unable to delete the remote tracking \nbranch \"origin/HEAD\" using git 1.6.0.5. Here's what I did:\n\n[tomj@storm repo]$ git init\nInitialized empty Git repository in /tmp/repo/.git/\n\n[tomj@storm repo]$ echo \"test\" >test\n[tomj@storm repo]$ git add test\n[tomj@storm repo]$ git commit -m \"Test\"\n\n[tomj@storm tmp]$ git clone repo alice\nInitialized empty Git repository in /tmp/alice/.git/\n\n[tomj@storm alice]$ git branch -r\n  origin/HEAD\n  origin/master\n\n[tomj@storm alice]$ git branch -r -d origin/HEAD\nDeleted remote branch origin/HEAD.\n[tomj@storm alice]$ git branch -r -d origin/master\nDeleted remote branch origin/master.\n\n[tomj@storm alice]$ ls -al .git/refs/remotes/origin/HEAD\n-rw-rw---- 1 tomj intra2net 32 19. Dec 12:43 .git/refs/remotes/origin/HEAD\n[tomj@storm alice]$ git branch -r\nerror: refs/remotes/origin/HEAD points nowhere!\n\nIs this supposed to be? git 1.6.1.rc3.35.gc0ceb shows a similar behavior.\n\nCheers,\nThomas\n"},{"id":"98355","messageId":"494BB637.3070304@drmicha.warpmail.net","threadId":"16797","inReplyTo":"200812191257.18678.thomas.jarosch@intra2net.com","subject":"Re: remote tracking branch deletion problem","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2008-12-19T14:56:55Z","receivedAt":"2008-12-19T14:56:55Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Thomas Jarosch venit, vidit, dixit 19.12.2008 12:57:\n> Hello together,\n> \n> while playing around with git, I stumbled upon a strange remote tracking \n> branch deletion problem. It seems I'm unable to delete the remote tracking \n> branch \"origin/HEAD\" using git 1.6.0.5. Here's what I did:\n> \n> [tomj@storm repo]$ git init\n> Initialized empty Git repository in /tmp/repo/.git/\n> \n> [tomj@storm repo]$ echo \"test\" >test\n> [tomj@storm repo]$ git add test\n> [tomj@storm repo]$ git commit -m \"Test\"\n> \n> [tomj@storm tmp]$ git clone repo alice\n> Initialized empty Git repository in /tmp/alice/.git/\n> \n> [tomj@storm alice]$ git branch -r\n>   origin/HEAD\n>   origin/master\n> \n> [tomj@storm alice]$ git branch -r -d origin/HEAD\n> Deleted remote branch origin/HEAD.\n> [tomj@storm alice]$ git branch -r -d origin/master\n> Deleted remote branch origin/master.\n> \n> [tomj@storm alice]$ ls -al .git/refs/remotes/origin/HEAD\n> -rw-rw---- 1 tomj intra2net 32 19. Dec 12:43 .git/refs/remotes/origin/HEAD\n> [tomj@storm alice]$ git branch -r\n> error: refs/remotes/origin/HEAD points nowhere!\n> \n> Is this supposed to be? git 1.6.1.rc3.35.gc0ceb shows a similar behavior.\n\nI think the point here is that HEAD is really a symref. \"git remote rm\norigin\" makes sure that symrefs are removed, and is the right command to\nuse here.\n\n\"git branch -r -d\", as well as \"git update-ref -d\" fail to remove HEAD\nbecause it's really not a branch but a symref.\n\nYou can use \"git update-ref -d --no-deref\" to remove HEAD.\n\nMaking builtin-branch use delete_ref(,,REF_ISSYMREF) leads to success\nfor your above commands. I don't know about side effects, though all\ntests pass. Is this sensible?\n\nI guess I should come up with a test for this along with the patch.\n\nMichael\n"}]}