Thread (27 messages) flat view 27 messages, 7 authors, 2016-08-13

Re: [PATCH 4/5] Make 'diff_populate_filespec()' use the new 'strbuf_readlink()'

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:47

Linus Torvalds [off-list ref] writes:
quoted hunk ↗ jump to hunk
diff --git a/diff.c b/diff.c
index afefe08..4b2029c 100644
--- a/diff.c
+++ b/diff.c
@@ -1773,19 +1773,17 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)
 		s->size = xsize_t(st.st_size);
 		if (!s->size)
 			goto empty;
-		if (size_only)
-			return 0;
 		if (S_ISLNK(st.st_mode)) {
 ...
 		}
+		if (size_only)
+			return 0;
It is unfortunate that we need to always readlink even when we only would
want to cull differences early (e.g. --raw without any fancy filters such
as rename detection), but symbolic links should be minorities in any sane
repo, and it should not be worth trying to optimize this for sane
filesystems by making it conditional.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help