Re: git-send-pack SIGSEGV..
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 15, 2007, 06:01 UTC
- Message-ID
- <7vr6od92nj.fsf@assigned-by-dhcp.pobox.com>
- In-Reply-To
- <7vvedp935y.fsf@assigned-by-dhcp.pobox.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 16 quoted lines
> Linus Torvalds <torvalds@linux-foundation.org> writes: > >> I *suspect* it's due to the refspec pattern matching changes Daniel did, >> but again - I haven't actually debugged it any deeper. > > I am officially recuperating from an operation I had today, so I > cannot really take a deep look at this. > > I think what is going wrong is that struct refspec for pattern > match that is parsed by parse_ref_spec does not have ->dst > component filled for "refs/tags/*" refspec, but match_refs() > does not check if pat->dst is NULL, in which case it should > reuse pat->src value. > > Incidentally I have other remote.c fixes queued in 'next'. I > haven't yet checked if I (accidentally) fixed this already.
Completely untested, but this may fix it.
I suspect this has an side effect of allowing
fetch = refs/heads/*
to mean the same thing as
fetch = refs/heads/*:refs/heads/*
which is suitable for a bare mirroring repository, but I do not think of any downside, so it might be Ok.
But that is something from a person who was under anesthesia a few hours ago, so you should take it with a big grain of salt ;-)
---
remote.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/remote.c b/remote.c index ed62a62..356e6bc 100644 --- a/remote.c +++ b/remote.c @@ -252,6 +252,8 @@ static struct refspec *parse_ref_spec(int nr_refspec, const char **refspec) ep = gp; } rs[i].src = xstrndup(sp, ep - sp); + if (rs[i].pattern && !rs[i].dst) + rs[i].dst = xstrdup(rs[i].src); } return rs; }