Re: Bug in fetch-pack.c, please confirm

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: Bug in fetch-pack.c, please confirm

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:04:09

Junio C Hamano [off-list ref] writes:
"Kyle J. McKay" [off-list ref] writes:
quoted
Hi guys,

So I was looking at fetch-pack.c (from master @ 52cae643, but I think  
it's the same everywhere):
...
quoted
-		hashcpy(ref->new_sha1, local);
+		hashcpy(ref->new_sha1, o->sha1);
 		if (!args->verbose)
 			continue;
 		fprintf(stderr,
 			"already have %s (%s)\n", sha1_to_hex(remote),
 			ref->name);
 	}
 	return retval;
---
One thing I wonder is if this hashcpy() is doing anything useful,
though.  Is ref->new_sha1 used after we are done in this codepath,
or is the reason nobody noticed it is because it does not matter
whatever garbage is in that field nobody looks at it?

Re: Bug in fetch-pack.c, please confirm

From: Kyle J. McKay <hidden>
Date: 2016-06-15 23:04:10

On Mar 15, 2015, at 00:30, Junio C Hamano wrote:
Junio C Hamano [off-list ref] writes:
quoted
"Kyle J. McKay" [off-list ref] writes:
quoted
Hi guys,

So I was looking at fetch-pack.c (from master @ 52cae643, but I  
think
it's the same everywhere):
...
quoted
-		hashcpy(ref->new_sha1, local);
+		hashcpy(ref->new_sha1, o->sha1);
		if (!args->verbose)
			continue;
		fprintf(stderr,
			"already have %s (%s)\n", sha1_to_hex(remote),
			ref->name);
	}
	return retval;
---
One thing I wonder is if this hashcpy() is doing anything useful,
though.  Is ref->new_sha1 used after we are done in this codepath,
or is the reason nobody noticed it is because it does not matter
whatever garbage is in that field nobody looks at it?
My thoughts exactly. hence the "please confirm" request.  I'm not  
familiar enough with the fetch pack code to know the answer off the  
top of my head.  I was hoping someone else who's been in the fetch  
pack code recently (*Hi Peff*) might just already know.  :)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help