Thread (1 message) 1 message, 1 author, 2016-06-15
DORMANTno replies

[PATCH] diff: use filespec as in-place size cache

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:08
Subsystem: the rest · Maintainer: Linus Torvalds

When we have a filespec primed with size, later size_only
request should be fillable without recomputing it.

---
diff --git a/diff.c b/diff.c
index 0f8c68f..fb3eba5 100644
--- a/diff.c
+++ b/diff.c
@@ -1515,6 +1515,9 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)
 	if (s->data)
 		return err;
 
+	if (size_only && 0 < s->size)
+		return err;
+
 	if (S_ISDIRLNK(s->mode))
 		return diff_populate_gitlink(s, size_only);
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help