* error: * Ignoring funny ref 'refs/heads/' locally
@ 2009-06-17 12:08 Jon Seymour
2009-06-17 13:38 ` [PATCH] fetch: do not create ref from empty name Clemens Buchacher
0 siblings, 1 reply; 2+ messages in thread
From: Jon Seymour @ 2009-06-17 12:08 UTC (permalink / raw)
To: Git Mailing List
Can someone tell me why this happens?
error: * Ignoring funny ref 'refs/heads/' locally
It also happens with 1.6.3.1
$ mkdir root
$ cd root
$ git init
Initialized empty Git repository in /tmp/root/.git/
$ :> .gitignore
$ git add .gitignore
$ git commit -m "initial"
Created initial commit 6a7c768: initial
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 .gitignore
$ cd ..
$ git clone root clone
Initialized empty Git repository in /tmp/clone/.git/
$ cd clone
$ git fetch origin :
error: * Ignoring funny ref 'refs/heads/' locally
$ git --version
git version 1.6.0.4
$ exit
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] fetch: do not create ref from empty name
2009-06-17 12:08 error: * Ignoring funny ref 'refs/heads/' locally Jon Seymour
@ 2009-06-17 13:38 ` Clemens Buchacher
0 siblings, 0 replies; 2+ messages in thread
From: Clemens Buchacher @ 2009-06-17 13:38 UTC (permalink / raw)
To: Jon Seymour; +Cc: Git Mailing List, Junio C Hamano
Previously, the refspec "<src>:" would be expanded to
"<src>:refs/heads/". Instead, treat an empty <dst> just like refspecs
without a colon.
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---
On Wed, Jun 17, 2009 at 10:08:25PM +1000, Jon Seymour wrote:
> Can someone tell me why this happens?
>
> error: * Ignoring funny ref 'refs/heads/' locally
This fixes it.
Note that "git fetch origin :" is short for "git fetch origin
HEAD", which stores the remote HEAD in FETCH_HEAD. You probably want "git
fetch origin", without an explicit refspec, which defaults to "git fetch
origin 'refs/heads/*:refs/remotes/origin/*'", i.e. store remote branches in
the namespace for tracking branches.
Clemens
remote.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/remote.c b/remote.c
index 08a5964..99e7797 100644
--- a/remote.c
+++ b/remote.c
@@ -1263,7 +1263,7 @@ struct ref *get_remote_ref(const struct ref *remote_refs, const char *name)
static struct ref *get_local_ref(const char *name)
{
- if (!name)
+ if (!name || name[0] == '\0')
return NULL;
if (!prefixcmp(name, "refs/"))
--
1.6.3.1.147.g637c3
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-06-17 13:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-17 12:08 error: * Ignoring funny ref 'refs/heads/' locally Jon Seymour
2009-06-17 13:38 ` [PATCH] fetch: do not create ref from empty name Clemens Buchacher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).