Re: [PATCH 3/5] refactor userdiff textconv code
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Oct 24, 2008, 14:01 UTC
- Message-ID
- <4901D557.90106@viscovery.net>
- In-Reply-To
- <20081024135132.GA11568@coredump.intra.peff.net>
Jeff King schrieb:
Show 7 quoted lines
> On Fri, Oct 24, 2008 at 09:15:54AM +0200, Johannes Sixt wrote: > Actually, I don't think this is right. The typechange has been broken > into two parts: the removal of the file contents and the addition of the > symlink. So the first part _should_ use the textconv, since it is just > comparing the file contents to /dev/null. But the second part should > not, since it is by definition just the text of the symlink. Ditto for > gitlinks, which have a special text representation. So how about this?
Your reasoning makes sense, of course. (I thought that forgoing textconv in these cases would have a simpler implementation; but it can't be a lot simpler than yours.)
Show 14 quoted lines
> diff --git a/diff.c b/diff.c > index 52feba7..ce1317d 100644 > --- a/diff.c > +++ b/diff.c > @@ -289,6 +289,9 @@ static int diff_filespec_textconv(struct diff_filespec *one) > if (!DIFF_FILE_VALID(one)) > return 0; > > + if (!S_ISREG(one->mode)) > + return 0; > + > diff_filespec_load_driver(one); > if (!one->driver->textconv) > return 0;
...
> +test_expect_failure 'textconv does not act on symlinks' '
Can we trust your solution if you still have 'test_expect_failure' here? ;-)
-- Hannes