git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] parse_object: pass on the original sha1, not the replaced one
@ 2010-07-31 12:36 Nguyễn Thái Ngọc Duy
  2010-08-02  7:42 ` Christian Couder
  0 siblings, 1 reply; 14+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2010-07-31 12:36 UTC (permalink / raw)
  To: git, chriscool; +Cc: Nguyễn Thái Ngọc Duy

Commit 0e87c36 (object: call "check_sha1_signature" with the
replacement sha1) did this. I'm not sure if it's should be done this
way.

With "repl" as the first argument to parse_object_buffer, the returned
obj pointer will have the replaced SHA1 in obj->sha1, not the original
one. I sort of expect that, no matter the object is replaced,
obj->sha1 should stay the same.

This was observed by replacing commit tip. git log would show the
replaced sha1, not the original one.
---
 object.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/object.c b/object.c
index 277b3dd..7adfda7 100644
--- a/object.c
+++ b/object.c
@@ -199,7 +199,7 @@ struct object *parse_object(const unsigned char *sha1)
 			return NULL;
 		}
 
-		obj = parse_object_buffer(repl, type, size, buffer, &eaten);
+		obj = parse_object_buffer(sha1, type, size, buffer, &eaten);
 		if (!eaten)
 			free(buffer);
 		return obj;
-- 
1.7.1.rc1.69.g24c2f7

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-08-14  2:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-31 12:36 [PATCH RFC] parse_object: pass on the original sha1, not the replaced one Nguyễn Thái Ngọc Duy
2010-08-02  7:42 ` Christian Couder
2010-08-02  9:31   ` Nguyen Thai Ngoc Duy
2010-08-03  5:00     ` Christian Couder
2010-08-03  6:01       ` Nguyen Thai Ngoc Duy
2010-08-04 11:58         ` Christian Couder
2010-08-04 12:42           ` Nguyen Thai Ngoc Duy
2010-08-04 12:57             ` Christian Couder
2010-08-04 22:07               ` Nguyen Thai Ngoc Duy
2010-08-05 11:41                 ` Christian Couder
2010-08-07  4:03                   ` Nguyen Thai Ngoc Duy
2010-08-13  3:59                     ` Christian Couder
2010-08-13  9:02                       ` Nguyen Thai Ngoc Duy
2010-08-14  2:03                         ` Christian Couder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).