Commit 3ca1653055ac692a4788d256c94d2aabc24552cb

Stefan Sperling 2019-02-04T18:48:07

append to tail of reflist, not to the head of the list

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/reference.c b/lib/reference.c
index 617c921..5bf2f2a 100644
--- a/lib/reference.c
+++ b/lib/reference.c
@@ -491,7 +491,7 @@ insert_ref(struct got_reflist_head *refs, struct got_reference *ref,
 	if (prev)
 		SIMPLEQ_INSERT_AFTER(refs, prev, re, entry);
 	else
-		SIMPLEQ_INSERT_HEAD(refs, re, entry);
+		SIMPLEQ_INSERT_TAIL(refs, re, entry);
 
 	return NULL;
 }