Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> --- commit.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/commit.c b/commit.c index 4b39c19..946ea70 100644 --- a/commit.c +++ b/commit.c @@ -252,7 +252,7 @@ int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long s { const char *tail = buffer; const char *bufptr = buffer; - unsigned char parent[20]; + unsigned char sha1[20]; struct commit_list **pptr; struct commit_graft *graft; @@ -262,10 +262,10 @@ int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long s tail += size; if (tail <= bufptr + 46 || memcmp(bufptr, "tree ", 5) || bufptr[45] != '\n') return error("bogus commit object %s", sha1_to_hex(item->object.sha1)); - if (get_sha1_hex(bufptr + 5, parent) < 0) + if (get_sha1_hex(bufptr + 5, sha1) < 0) return error("bad tree pointer in commit %s", sha1_to_hex(item->object.sha1)); - item->tree = lookup_tree(parent); + item->tree = lookup_tree(sha1); bufptr += 46; /* "tree " + "hex sha1" + "\n" */ pptr = &item->parents; @@ -274,7 +274,7 @@ int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long s struct commit *new_parent; if (tail <= bufptr + 48 || - get_sha1_hex(bufptr + 7, parent) || + get_sha1_hex(bufptr + 7, sha1) || bufptr[47] != '\n') return error("bad parents in commit %s", sha1_to_hex(item->object.sha1)); bufptr += 48; @@ -284,7 +284,7 @@ int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long s */ if (graft && (graft->nr_parent < 0 || grafts_replace_parents)) continue; - new_parent = lookup_commit(parent); + new_parent = lookup_commit(sha1); if (new_parent) pptr = &commit_list_insert(new_parent, pptr)->next; } -- 1.7.3.1.256.g2539c.dirty -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html