Commit 72acb3d8f4f1aa47fe21329180083cef02695490

Stefan Sperling 2021-08-06T12:43:33

remove unused 'repo' argument from got_reflist_insert()

diff --git a/gotadmin/gotadmin.c b/gotadmin/gotadmin.c
index 928fcd8..9c2f838 100644
--- a/gotadmin/gotadmin.c
+++ b/gotadmin/gotadmin.c
@@ -499,7 +499,7 @@ add_ref(struct got_reflist_entry **new, struct got_reflist_head *refs,
 		err = got_ref_list(refs, repo, refname,
 		    got_ref_cmp_by_name, NULL);
 	} else {
-		err = got_reflist_insert(new, refs, ref, repo,
+		err = got_reflist_insert(new, refs, ref,
 		    got_ref_cmp_by_name, NULL);
 		if (err || *new == NULL /* duplicate */)
 			got_ref_close(ref);
diff --git a/include/got_reference.h b/include/got_reference.h
index 89ec5aa..d242c36 100644
--- a/include/got_reference.h
+++ b/include/got_reference.h
@@ -131,8 +131,7 @@ void got_ref_list_free(struct got_reflist_head *);
  */
 const struct got_error *
 got_reflist_insert(struct got_reflist_entry **newp, struct got_reflist_head *refs,
-    struct got_reference *ref, struct got_repository *repo,
-    got_ref_cmp_cb cmp_cb, void *cmp_arg);
+    struct got_reference *ref, got_ref_cmp_cb cmp_cb, void *cmp_arg);
 
 /* Indicate whether the provided reference is symbolic (points at another
  * refernce) or not (points at an object ID). */
diff --git a/lib/reference.c b/lib/reference.c
index 1f7e7d1..a326d18 100644
--- a/lib/reference.c
+++ b/lib/reference.c
@@ -810,8 +810,7 @@ done:
 
 const struct got_error *
 got_reflist_insert(struct got_reflist_entry **newp, struct got_reflist_head *refs,
-    struct got_reference *ref, struct got_repository *repo,
-    got_ref_cmp_cb cmp_cb, void *cmp_arg)
+    struct got_reference *ref, got_ref_cmp_cb cmp_cb, void *cmp_arg)
 {
 	const struct got_error *err;
 	struct got_reflist_entry *new, *re;
@@ -902,7 +901,7 @@ gather_on_disk_refs(struct got_reflist_head *refs, const char *path_refs,
 				goto done;
 			if (ref) {
 				struct got_reflist_entry *new;
-				err = got_reflist_insert(&new, refs, ref, repo,
+				err = got_reflist_insert(&new, refs, ref,
 				    cmp_cb, cmp_arg);
 				if (err || new == NULL /* duplicate */)
 					got_ref_close(ref);
@@ -953,8 +952,7 @@ got_ref_list(struct got_reflist_head *refs, struct got_repository *repo,
 		err = open_ref(&ref, path_refs, "", GOT_REF_HEAD, 0);
 		if (err)
 			goto done;
-		err = got_reflist_insert(&new, refs, ref, repo,
-		    cmp_cb, cmp_arg);
+		err = got_reflist_insert(&new, refs, ref, cmp_cb, cmp_arg);
 		if (err || new == NULL /* duplicate */)
 			got_ref_close(ref);
 		if (err && err->code != GOT_ERR_NOT_REF)
@@ -973,7 +971,7 @@ got_ref_list(struct got_reflist_head *refs, struct got_repository *repo,
 				goto done;
 			/* Try to look up references in a given namespace. */
 		} else {
-			err = got_reflist_insert(&new, refs, ref, repo,
+			err = got_reflist_insert(&new, refs, ref,
 			    cmp_cb, cmp_arg);
 			if (err || new == NULL /* duplicate */)
 				got_ref_close(ref);
@@ -1065,7 +1063,7 @@ got_ref_list(struct got_reflist_head *refs, struct got_repository *repo,
 						continue;
 					}
 				}
-				err = got_reflist_insert(&new, refs, ref, repo,
+				err = got_reflist_insert(&new, refs, ref,
 				    cmp_cb, cmp_arg);
 				if (err || new == NULL /* duplicate */)
 					got_ref_close(ref);
@@ -1316,7 +1314,7 @@ delete_packed_ref(struct got_reference *delref, struct got_repository *repo)
 			continue;
 		}
 
-		err = got_reflist_insert(&new, &refs, ref, repo,
+		err = got_reflist_insert(&new, &refs, ref,
 		    got_ref_cmp_by_name, NULL);
 		if (err || new == NULL /* duplicate */)
 			got_ref_close(ref);