Thread (33 messages) flat view 33 messages, 3 authors, 2016-06-15

Re: [PULL REQUEST] initial pack v4 support

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

Possibly related (same subject, not in this thread)

Nicolas Pitre [off-list ref] writes:
Junio, would you please pull the following into pu:

	git://git.linaro.org/people/nico/git

This is the pack v4 work to date which is somewhat getting usable.  It 
is time it gets more exposure, and possibly some more people's attention 
who would like to work on the missing parts as I need to scale down my 
own involvement.
Thanks.  Parked on 'pu'.
      packv4-parse.c: allow tree entry copying from a canonical tree object
This one needed a small fix-up to make it compile.

I do not particularly like reusing that "size" variable, but it
seemed to be dead at that point, so...

 packv4-parse.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/packv4-parse.c b/packv4-parse.c
index f96acc1..3f95ed4 100644
--- a/packv4-parse.c
+++ b/packv4-parse.c
@@ -365,13 +365,14 @@ static int copy_canonical_tree_entries(struct packed_git *p, off_t offset,
 		update_tree_entry(&desc);
 	end = desc.buffer;
 
-	if (end - from > *sizep) {
+	size = (const char *)end - (const char *)from;
+	if (size > *sizep) {
 		free(data);
 		return -1;
 	}
-	memcpy(*dstp, from, end - from);
-	*dstp += end - from;
-	*sizep -= end - from;
+	memcpy(*dstp, from, size);
+	*dstp += size;
+	*sizep -= size;
 	free(data);
 	return 0;
 }
-- 
1.8.4-468-g1185e84
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help