{"thread":{"id":"19838","subject":"error: * Ignoring funny ref 'refs/heads/' locally","startedAt":"2009-06-17T12:08:25Z","lastAt":"2009-06-17T13:38:36Z","messageCount":2,"participants":["Jon Seymour","Clemens Buchacher"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"116465","messageId":"2cfc40320906170508o4fc0fc14sca511742be03ee5@mail.gmail.com","threadId":"19838","inReplyTo":null,"subject":"error: * Ignoring funny ref 'refs/heads/' locally","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2009-06-17T12:08:25Z","receivedAt":"2009-06-17T12:08:25Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"Can someone tell me why this happens?\n\n    error: * Ignoring funny ref 'refs/heads/' locally\n\nIt also happens with 1.6.3.1\n\n$ mkdir root\n$ cd root\n$ git init\nInitialized empty Git repository in /tmp/root/.git/\n$ :> .gitignore\n$ git add .gitignore\n$ git commit -m \"initial\"\nCreated initial commit 6a7c768: initial\n 0 files changed, 0 insertions(+), 0 deletions(-)\n create mode 100644 .gitignore\n$ cd ..\n$ git clone root clone\nInitialized empty Git repository in /tmp/clone/.git/\n$ cd clone\n$ git fetch origin :\nerror: * Ignoring funny ref 'refs/heads/' locally\n$ git --version\ngit version 1.6.0.4\n$ exit\n"},{"id":"116472","messageId":"20090617133836.GA25155@localhost","threadId":"19838","inReplyTo":"2cfc40320906170508o4fc0fc14sca511742be03ee5@mail.gmail.com","subject":"[PATCH] fetch: do not create ref from empty name","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2009-06-17T13:38:36Z","receivedAt":"2009-06-17T13:38:36Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"Previously, the refspec \"<src>:\" would be expanded to\n\"<src>:refs/heads/\". Instead, treat an empty <dst> just like refspecs\nwithout a colon.\n\nSigned-off-by: Clemens Buchacher <drizzd@aon.at>\n---\n\nOn Wed, Jun 17, 2009 at 10:08:25PM +1000, Jon Seymour wrote:\n> Can someone tell me why this happens?\n> \n>     error: * Ignoring funny ref 'refs/heads/' locally\n\nThis fixes it.\n\nNote that \"git fetch origin :\" is short for \"git fetch origin\nHEAD\", which stores the remote HEAD in FETCH_HEAD. You probably want \"git\nfetch origin\", without an explicit refspec, which defaults to \"git fetch\norigin 'refs/heads/*:refs/remotes/origin/*'\", i.e. store remote branches in\nthe namespace for tracking branches.\n\nClemens\n\n remote.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/remote.c b/remote.c\nindex 08a5964..99e7797 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -1263,7 +1263,7 @@ struct ref *get_remote_ref(const struct ref *remote_refs, const char *name)\n \n static struct ref *get_local_ref(const char *name)\n {\n-\tif (!name)\n+\tif (!name || name[0] == '\\0')\n \t\treturn NULL;\n \n \tif (!prefixcmp(name, \"refs/\"))\n-- \n1.6.3.1.147.g637c3\n"}]}