X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=sha1_file.c;h=956422ba4a5df5f46caaf85f10e4c85321439272;hb=4df989f9537cc9f168e96da7700f012b6367c63f;hp=34013014442e18bd02ae0ce33df34a89ec8d6171;hpb=8963314c77af9a4eda5dcbdbab3d4001af83ad81;p=git.git diff --git a/sha1_file.c b/sha1_file.c index 340130144..956422ba4 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -1267,7 +1267,8 @@ unsigned long unpack_object_header_buffer(const unsigned char *buf, while (c & 0x80) { if (len <= used || bitsizeof(long) <= shift) { error("bad object header"); - return 0; + size = used = 0; + break; } c = buf[used++]; size += (c & 0x7f) << shift; @@ -1987,7 +1988,7 @@ off_t find_pack_entry_one(const unsigned char *sha1, return 0; } -static int is_pack_valid(struct packed_git *p) +int is_pack_valid(struct packed_git *p) { /* An already open pack is known to be valid. */ if (p->pack_fd != -1) @@ -2038,7 +2039,7 @@ static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e) * was loaded! */ if (!is_pack_valid(p)) { - error("packfile %s cannot be accessed", p->pack_name); + warning("packfile %s cannot be accessed", p->pack_name); goto next; } e->offset = offset; @@ -2616,7 +2617,7 @@ static int index_mem(unsigned char *sha1, void *buf, size_t size, if ((type == OBJ_BLOB) && path) { struct strbuf nbuf = STRBUF_INIT; if (convert_to_git(path, buf, size, &nbuf, - write_object ? safe_crlf : 0)) { + write_object ? safe_crlf : SAFE_CRLF_FALSE)) { buf = strbuf_detach(&nbuf, &size); re_allocated = 1; }