From: Jeff King Date: Sat, 01 Dec 2007 06:17:48 GMT Subject: Re: [RFC] use typechange as rename source Message-ID: <20071201061748.GA2606@coredump.intra.peff.net> In-Reply-To: <7v8x4f6iyu.fsf@gitster.siamese.dyndns.org> On Fri, Nov 30, 2007 at 10:08:41PM -0800, Junio C Hamano wrote: > I think it does make a difference, if you have a cross rename that > swaps: > > $ ls -F foo bar > bar foo@ > $ mv foo tmp; mv bar foo; mv tmp bar > $ ls -F foo bar > bar@ foo OK, I see now what you were saying before. Yes, we do want them actually broken, and my initial patch is not right in that sense. > > - if (!S_ISREG(src->mode) || !S_ISREG(dst->mode)) > > - return 0; /* leave symlink rename alone */ > > + if (object_type(src->mode) != object_type(dst->mode)) > > + return 1; /* even their types are different */ > > Oops, this part is wrong. It should be checking ISREG and stuff. OK, good. I was sitting there puzzling over what in the world this change meant. -Peff