mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
Remove unused code in parse_commit_buffer()
The n_refs variable is no longer really used in this function, so there is no reason to keep it. It was introduced in27dedf0c
and the code that really used it was removed in7914053
. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
d633c882db
commit
39468defd3
8
commit.c
8
commit.c
|
@ -243,7 +243,6 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
|
||||||
unsigned char parent[20];
|
unsigned char parent[20];
|
||||||
struct commit_list **pptr;
|
struct commit_list **pptr;
|
||||||
struct commit_graft *graft;
|
struct commit_graft *graft;
|
||||||
unsigned n_refs = 0;
|
|
||||||
|
|
||||||
if (item->object.parsed)
|
if (item->object.parsed)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -255,8 +254,6 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
|
||||||
return error("bad tree pointer in commit %s",
|
return error("bad tree pointer in commit %s",
|
||||||
sha1_to_hex(item->object.sha1));
|
sha1_to_hex(item->object.sha1));
|
||||||
item->tree = lookup_tree(parent);
|
item->tree = lookup_tree(parent);
|
||||||
if (item->tree)
|
|
||||||
n_refs++;
|
|
||||||
bufptr += 46; /* "tree " + "hex sha1" + "\n" */
|
bufptr += 46; /* "tree " + "hex sha1" + "\n" */
|
||||||
pptr = &item->parents;
|
pptr = &item->parents;
|
||||||
|
|
||||||
|
@ -272,10 +269,8 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
|
||||||
if (graft)
|
if (graft)
|
||||||
continue;
|
continue;
|
||||||
new_parent = lookup_commit(parent);
|
new_parent = lookup_commit(parent);
|
||||||
if (new_parent) {
|
if (new_parent)
|
||||||
pptr = &commit_list_insert(new_parent, pptr)->next;
|
pptr = &commit_list_insert(new_parent, pptr)->next;
|
||||||
n_refs++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (graft) {
|
if (graft) {
|
||||||
int i;
|
int i;
|
||||||
|
@ -285,7 +280,6 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
|
||||||
if (!new_parent)
|
if (!new_parent)
|
||||||
continue;
|
continue;
|
||||||
pptr = &commit_list_insert(new_parent, pptr)->next;
|
pptr = &commit_list_insert(new_parent, pptr)->next;
|
||||||
n_refs++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item->date = parse_commit_date(bufptr, tail);
|
item->date = parse_commit_date(bufptr, tail);
|
||||||
|
|
Loading…
Reference in a new issue