only textconv regular files
We treat symlinks as text containing the results of the symlink, so it doesn't make much sense to text-convert them. Similarly gitlink components just end up as the text "Subproject commit $sha1", which we should leave intact. Note that a typechange may be broken into two parts: the removal of the old part and the addition of the new. In that case, we _do_ show the textconv for any part which is the addition or removal of a file we would ordinarily textconv, since it is purely acting on the file contents. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Oct 26, 2008 at 00:46 UTC
2675773af893ae81f9b09f18c1f2ec86ca2158e7
2 files changed
+3
-1
diff.c
+2
@@ -1311,6 +1311,8 @@ static const char *get_textconv(struct diff_filespec *one)
1311
{
1312
if (!DIFF_FILE_VALID(one))
1313
return NULL;
1314
+ if (!S_ISREG(one->mode))
1315
+ return NULL;
1316
diff_filespec_load_driver(one);
1317
return one->driver->textconv;
1318
}
t/t4030-diff-textconv.sh
+1
-1
@@ -104,7 +104,7 @@ index ad8b3d2..67be421
104
\ No newline at end of file
105
EOF
106
# make a symlink the hard way that works on symlink-challenged file systems
107
-test_expect_failure 'textconv does not act on symlinks' '
107
+test_expect_success 'textconv does not act on symlinks' '
108
echo -n frotz > file &&
109
git add file &&
110
git ls-files -s | sed -e s/100644/120000/ |