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 in 27dedf0c and the code that really used it was removed in 7914053. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Miklos Vajna committed
Jun 7, 2008 at 22:38 UTC
39468defd306b7fb8ca0d381a2d66216a8eb9095
1 file changed
+1
-7
commit.c
+1
-7
@@ -243,7 +243,6 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
243
unsigned char parent[20];
244
struct commit_list **pptr;
245
struct commit_graft *graft;
246
- unsigned n_refs = 0;
246
247
if (item->object.parsed)
248
return 0;
@@ -255,8 +254,6 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
254
return error("bad tree pointer in commit %s",
255
sha1_to_hex(item->object.sha1));
256
item->tree = lookup_tree(parent);
258
- if (item->tree)
259
- n_refs++;
257
bufptr += 46; /* "tree " + "hex sha1" + "\n" */
258
pptr = &item->parents;
259
@@ -272,10 +269,8 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
269
if (graft)
270
continue;
271
new_parent = lookup_commit(parent);
275
- if (new_parent) {
272
+ if (new_parent)
273
pptr = &commit_list_insert(new_parent, pptr)->next;
277
- n_refs++;
278
- }
274
}
275
if (graft) {
276
int i;
@@ -285,7 +280,6 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
280
if (!new_parent)
281
continue;
282
pptr = &commit_list_insert(new_parent, pptr)->next;
288
- n_refs++;
283
}
284
}
285
item->date = parse_commit_date(bufptr, tail);