summaryrefslogtreecommitdiff
path: root/object-name.c
diff options
context:
space:
mode:
Diffstat (limited to 'object-name.c')
-rw-r--r--object-name.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/object-name.c b/object-name.c
index 72298055b5..a563635a8c 100644
--- a/object-name.c
+++ b/object-name.c
@@ -1401,7 +1401,7 @@ static int get_oid_oneline(struct repository *r,
const char *prefix, struct object_id *oid,
const struct commit_list *list)
{
- struct commit_list *copy = NULL;
+ struct commit_list *copy = NULL, **copy_tail = ©
const struct commit_list *l;
int found = 0;
int negative = 0;
@@ -1423,7 +1423,7 @@ static int get_oid_oneline(struct repository *r,
for (l = list; l; l = l->next) {
l->item->object.flags |= ONELINE_SEEN;
- commit_list_insert(l->item, &copy);
+ copy_tail = &commit_list_insert(l->item, copy_tail)->next;
}
while (copy) {
const char *p, *buf;