Re: [PATCH 2/2] fetch/push: readd rsync support
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Sep 28, 2007, 22:48 UTC
- Message-ID
- <Pine.LNX.4.64.0709282348040.28395@racer.site>
- In-Reply-To
- <7vtzpeo5ar.fsf@gitster.siamese.dyndns.org>
Hi,
On Fri, 28 Sep 2007, Junio C Hamano wrote:
Show 46 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > diff --git a/transport.c b/transport.c
> > index 4f9cddc..c8eed95 100644
> > --- a/transport.c
> > +++ b/transport.c
> > @@ -6,6 +6,330 @@
> > ...
> > +static int direntry_cmp(const void *a, const void *b)
> > +{
> > + const struct dirent *d1 = a;
> > + const struct dirent *d2 = b;
> > +
> > + return strcmp(d1->d_name, d2->d_name);
> > +}
> > ...
> > +/*
> > + * path is assumed to point to a buffer of PATH_MAX bytes, and
> > + * path + name_offset is expected to point to "refs/".
> > + */
> > +
> > +static int read_loose_refs(struct strbuf *path, int name_offset,
> > + struct ref **tail)
> > +{
> > + DIR *dir = opendir(path->buf);
> > + struct dirent *de;
> > + struct {
> > + char **entries;
> > + int nr, alloc;
> > + } list;
> > ...
> > + while ((de = readdir(dir))) {
> > + if (de->d_name[0] == '.' && (de->d_name[1] == '\0' ||
> > + (de->d_name[1] == '.' &&
> > + de->d_name[2] == '\0')))
> > + continue;
> > + ALLOC_GROW(list.entries, list.nr + 1, list.alloc);
> > + list.entries[list.nr++] = xstrdup(de->d_name);
> > + }
> > + closedir(dir);
> > +
> > + /* sort the list */
> > +
> > + qsort(list.entries, list.nr, sizeof(*de), direntry_cmp);
>
> Hmmmph...?Ouch. Sorry.
Will resend in a few minutes. (After reading the patch -- again)
Ciao, Dscho