summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2009-01-23 09:07:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-06-01 00:02:59 (GMT)
commit0e87c36763a384d5bf6fae4bda44fd035c0b75ff (patch)
tree0c8a9ed3598faf889eae8bc733ab65190aadd82d /object.c
parentf5552aee39d664bb8774c205341abd6db74b38d3 (diff)
downloadgit-0e87c36763a384d5bf6fae4bda44fd035c0b75ff.zip
git-0e87c36763a384d5bf6fae4bda44fd035c0b75ff.tar.gz
git-0e87c36763a384d5bf6fae4bda44fd035c0b75ff.tar.bz2
object: call "check_sha1_signature" with the replacement sha1
Otherwise we get a "sha1 mismatch" error for replaced objects. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object.c')
-rw-r--r--object.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/object.c b/object.c
index a6ef439..fe8eaaf 100644
--- a/object.c
+++ b/object.c
@@ -188,17 +188,18 @@ struct object *parse_object(const unsigned char *sha1)
unsigned long size;
enum object_type type;
int eaten;
- void *buffer = read_sha1_file(sha1, &type, &size);
+ const unsigned char *repl;
+ void *buffer = read_sha1_file_repl(sha1, &type, &size, &repl);
if (buffer) {
struct object *obj;
- if (check_sha1_signature(sha1, buffer, size, typename(type)) < 0) {
+ if (check_sha1_signature(repl, buffer, size, typename(type)) < 0) {
free(buffer);
- error("sha1 mismatch %s\n", sha1_to_hex(sha1));
+ error("sha1 mismatch %s\n", sha1_to_hex(repl));
return NULL;
}
- obj = parse_object_buffer(sha1, type, size, buffer, &eaten);
+ obj = parse_object_buffer(repl, type, size, buffer, &eaten);
if (!eaten)
free(buffer);
return obj;