From: Junio C Hamano Date: Thu, 27 Jan 2011 00:04:23 GMT Subject: Re: [PATCH jn/fast-import-fix v3] fast-import: treat filemodify with empty tree as delete Message-ID: <7vd3nji54o.fsf@alter.siamese.dyndns.org> In-Reply-To: <20110126230608.GA26787@burratino> Jonathan Nieder writes: > Sverre Rabbelier wrote: > >> Should it go on maint now that it's factored out, since it shipped in >> 1.7.3, or just master? > > Hmm. I suppose on top of b2124125 (jn/fast-import-fix). Hmm, why not on top of v1.7.3-rc0~75^2 aka 334fba6 (Teach fast-import to import subtrees named by tree id, 2010-06-30) then? > While applying it there I noticed that the change to t9300 includes an > unrelated change (residue of an old rebase). Here's a fixed version. > diff --git a/fast-import.c b/fast-import.c > index d881630..9cf26f1 100644 > --- a/fast-import.c > +++ b/fast-import.c > @@ -2194,6 +2194,16 @@ static void file_change_m(struct branch *b) > p = uq.buf; > } > > + /* > + * Git does not track empty, non-toplevel directories. > + */ > + if (S_ISDIR(mode) && > + !memcmp(sha1, (const unsigned char *) EMPTY_TREE_SHA1_BIN, 20) && Do you need this cast?