Commit 05e1230b0e68bb81cdae380edccc969dd16215dc

Stefan Sperling 2018-11-05T12:42:03

rename got_commit_object_mini to got_mini_commit_object

diff --git a/lib/commit_graph.c b/lib/commit_graph.c
index 08c1ddd..1356457 100644
--- a/lib/commit_graph.c
+++ b/lib/commit_graph.c
@@ -163,12 +163,12 @@ is_merge_point(struct got_commit_graph_node *node)
 }
 
 static const struct got_error *
-detect_changed_path(int *changed, struct got_commit_object_mini *commit,
+detect_changed_path(int *changed, struct got_mini_commit_object *commit,
     struct got_object_id *commit_id, const char *path,
     struct got_repository *repo)
 {
 	const struct got_error *err = NULL;
-	struct got_commit_object_mini *pcommit = NULL;
+	struct got_mini_commit_object *pcommit = NULL;
 	struct got_tree_object *tree = NULL, *ptree = NULL;
 	struct got_object_qid *pid;
 
@@ -275,7 +275,7 @@ close_branch(struct got_commit_graph *graph, struct got_object_id *commit_id)
 static const struct got_error *
 advance_branch(struct got_commit_graph *graph,
     struct got_commit_graph_node *node,
-    struct got_object_id *commit_id, struct got_commit_object_mini *commit,
+    struct got_object_id *commit_id, struct got_mini_commit_object *commit,
     struct got_repository *repo)
 {
 	const struct got_error *err;
@@ -382,7 +382,7 @@ free_node(struct got_commit_graph_node *node)
 static const struct got_error *
 add_node(struct got_commit_graph_node **new_node,
     struct got_commit_graph *graph, struct got_object_id *commit_id,
-    struct got_commit_object_mini *commit,
+    struct got_mini_commit_object *commit,
     struct got_commit_graph_node *child_node, struct got_repository *repo)
 {
 	const struct got_error *err = NULL;
@@ -456,7 +456,7 @@ got_commit_graph_open(struct got_commit_graph **graph,
     int first_parent_traversal, struct got_repository *repo)
 {
 	const struct got_error *err = NULL;
-	struct got_commit_object_mini *commit;
+	struct got_mini_commit_object *commit;
 
 	*graph = NULL;
 
@@ -547,7 +547,7 @@ fetch_commits_from_open_branches(int *ncommits,
 	for (i = 0; i < arg.ntips; i++) {
 		struct got_object_id *commit_id;
 		struct got_commit_graph_node *child_node, *new_node;
-		struct got_commit_object_mini *commit;
+		struct got_mini_commit_object *commit;
 		int changed;
 
 		commit_id = &graph->tips[i].id;
@@ -628,7 +628,7 @@ got_commit_graph_iter_start(struct got_commit_graph *graph,
 {
 	const struct got_error *err = NULL;
 	struct got_commit_graph_node *start_node;
-	struct got_commit_object_mini *commit;
+	struct got_mini_commit_object *commit;
 	int changed;
 
 	start_node = got_object_idset_get(graph->node_ids, id);
diff --git a/lib/got_lib_object.h b/lib/got_lib_object.h
index 5eccdfb..fe430ca 100644
--- a/lib/got_lib_object.h
+++ b/lib/got_lib_object.h
@@ -50,7 +50,7 @@ struct got_blob_object {
 };
 
 /* Small version of got_commit_object. Used by commit graph. */
-struct got_commit_object_mini {
+struct got_mini_commit_object {
 	struct got_object_id *tree_id;
 	unsigned int nparents;
 	struct got_object_id_queue parent_ids;
@@ -59,9 +59,9 @@ struct got_commit_object_mini {
 };
 
 const struct got_error *
-got_object_mini_commit_open(struct got_commit_object_mini **,
+got_object_mini_commit_open(struct got_mini_commit_object **,
     struct got_repository *, struct got_object *);
-void got_object_mini_commit_close(struct got_commit_object_mini *);
+void got_object_mini_commit_close(struct got_mini_commit_object *);
 const struct got_error *got_object_open_as_mini_commit(
-    struct got_commit_object_mini **, struct got_repository *,
+    struct got_mini_commit_object **, struct got_repository *,
     struct got_object_id *);
diff --git a/lib/got_lib_object_cache.h b/lib/got_lib_object_cache.h
index 424cbaa..f54f072 100644
--- a/lib/got_lib_object_cache.h
+++ b/lib/got_lib_object_cache.h
@@ -27,7 +27,7 @@ struct got_object_cache_entry {
 		struct got_object *obj;
 		struct got_tree_object *tree;
 		struct got_commit_object *commit;
-		struct got_commit_object_mini *mini_commit;
+		struct got_mini_commit_object *mini_commit;
 	} data;
 };
 
diff --git a/lib/got_lib_object_parse.h b/lib/got_lib_object_parse.h
index 99f5e6b..0be7fad 100644
--- a/lib/got_lib_object_parse.h
+++ b/lib/got_lib_object_parse.h
@@ -16,7 +16,7 @@
 
 const struct got_error *got_object_qid_alloc_partial(struct got_object_qid **);
 struct got_commit_object *got_object_commit_alloc_partial(void);
-struct got_commit_object_mini *got_object_mini_commit_alloc_partial(void);
+struct got_mini_commit_object *got_object_mini_commit_alloc_partial(void);
 const struct got_error *got_object_commit_add_parent(struct got_commit_object *,
     const char *);
 struct got_tree_entry *got_alloc_tree_entry_partial(void);
@@ -28,7 +28,7 @@ const struct got_error *got_object_read_commit_privsep(
     struct got_commit_object **, struct got_object *, int,
     struct got_repository *);
 const struct got_error *got_object_read_mini_commit_privsep(
-    struct got_commit_object_mini **, struct got_object *, int,
+    struct got_mini_commit_object **, struct got_object *, int,
     struct got_repository *);
 const struct got_error *got_object_read_tree_privsep(struct got_tree_object **,
     struct got_object *, int, struct got_repository *);
@@ -36,7 +36,7 @@ const struct got_error *got_object_read_tree_privsep(struct got_tree_object **,
 const struct got_error *got_object_parse_commit(struct got_commit_object **,
     char *, size_t);
 const struct got_error *got_object_parse_mini_commit(
-    struct got_commit_object_mini **, char *, size_t);
+    struct got_mini_commit_object **, char *, size_t);
 const struct got_error *got_object_parse_tree(struct got_tree_object **,
     uint8_t *, size_t);
 const struct got_error *got_read_file_to_mem(uint8_t **, size_t *, FILE *);
@@ -52,6 +52,6 @@ const struct got_error *got_object_packed_read_privsep(struct got_object **,
 const struct got_error *got_object_read_packed_commit_privsep(
     struct got_commit_object **, struct got_object *, struct got_pack *);
 const struct got_error *got_object_read_packed_mini_commit_privsep(
-    struct got_commit_object_mini **, struct got_object *, struct got_pack *);
+    struct got_mini_commit_object **, struct got_object *, struct got_pack *);
 const struct got_error *got_object_read_packed_tree_privsep(
     struct got_tree_object **, struct got_object *, struct got_pack *);
diff --git a/lib/got_lib_privsep.h b/lib/got_lib_privsep.h
index e343c37..bd18a5b 100644
--- a/lib/got_lib_privsep.h
+++ b/lib/got_lib_privsep.h
@@ -213,11 +213,11 @@ const struct got_error *got_privsep_recv_obj(struct got_object **,
 const struct got_error *got_privsep_send_commit(struct imsgbuf *,
     struct got_commit_object *);
 const struct got_error *got_privsep_send_mini_commit(struct imsgbuf *,
-    struct got_commit_object_mini *);
+    struct got_mini_commit_object *);
 const struct got_error *got_privsep_recv_commit(struct got_commit_object **,
     struct imsgbuf *);
 const struct got_error *got_privsep_recv_mini_commit(
-    struct got_commit_object_mini **, struct imsgbuf *);
+    struct got_mini_commit_object **, struct imsgbuf *);
 const struct got_error *got_privsep_recv_tree(struct got_tree_object **,
     struct imsgbuf *);
 const struct got_error *got_privsep_send_tree(struct imsgbuf *,
diff --git a/lib/got_lib_repository.h b/lib/got_lib_repository.h
index 3eb7a0d..5211dc1 100644
--- a/lib/got_lib_repository.h
+++ b/lib/got_lib_repository.h
@@ -54,8 +54,8 @@ const struct got_error*got_repo_cache_commit(struct got_repository *,
 struct got_commit_object *got_repo_get_cached_commit(struct got_repository *,
     struct got_object_id *);
 const struct got_error*got_repo_cache_mini_commit(struct got_repository *,
-    struct got_object_id *, struct got_commit_object_mini *);
-struct got_commit_object_mini *got_repo_get_cached_mini_commit(
+    struct got_object_id *, struct got_mini_commit_object *);
+struct got_mini_commit_object *got_repo_get_cached_mini_commit(
     struct got_repository *, struct got_object_id *);
 const struct got_error *got_repo_cache_packidx(struct got_repository *,
     struct got_packidx *);
diff --git a/lib/object.c b/lib/object.c
index cdf4028..fff88ff 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -351,7 +351,7 @@ got_object_commit_open(struct got_commit_object **commit,
 }
 
 static const struct got_error *
-open_mini_commit(struct got_commit_object_mini **commit,
+open_mini_commit(struct got_mini_commit_object **commit,
     struct got_repository *repo, struct got_object *obj, int check_cache)
 {
 	const struct got_error *err = NULL;
@@ -398,7 +398,7 @@ open_mini_commit(struct got_commit_object_mini **commit,
 }
 
 const struct got_error *
-got_object_open_as_mini_commit(struct got_commit_object_mini **commit,
+got_object_open_as_mini_commit(struct got_mini_commit_object **commit,
     struct got_repository *repo, struct got_object_id *id)
 {
 	const struct got_error *err;
@@ -425,7 +425,7 @@ done:
 }
 
 const struct got_error *
-got_object_mini_commit_open(struct got_commit_object_mini **commit,
+got_object_mini_commit_open(struct got_mini_commit_object **commit,
     struct got_repository *repo, struct got_object *obj)
 {
 	return open_mini_commit(commit, repo, obj, 1);
@@ -1172,7 +1172,7 @@ request_commit(struct got_commit_object **commit, struct got_repository *repo,
 }
 
 static const struct got_error *
-request_mini_commit(struct got_commit_object_mini **commit,
+request_mini_commit(struct got_mini_commit_object **commit,
     struct got_repository *repo, struct got_object *obj, int fd)
 {
 	const struct got_error *err = NULL;
@@ -1201,7 +1201,7 @@ got_object_read_packed_commit_privsep(struct got_commit_object **commit,
 }
 
 const struct got_error *
-got_object_read_packed_mini_commit_privsep(struct got_commit_object_mini **commit,
+got_object_read_packed_mini_commit_privsep(struct got_mini_commit_object **commit,
     struct got_object *obj, struct got_pack *pack)
 {
 	const struct got_error *err = NULL;
@@ -1252,7 +1252,7 @@ got_object_read_commit_privsep(struct got_commit_object **commit,
 }
 
 const struct got_error *
-got_object_read_mini_commit_privsep(struct got_commit_object_mini **commit,
+got_object_read_mini_commit_privsep(struct got_mini_commit_object **commit,
     struct got_object *obj, int obj_fd, struct got_repository *repo)
 {
 	int imsg_fds[2];
diff --git a/lib/object_cache.c b/lib/object_cache.c
index 883a84a..6d49541 100644
--- a/lib/object_cache.c
+++ b/lib/object_cache.c
@@ -112,7 +112,7 @@ got_object_cache_add(struct got_object_cache *cache, struct got_object_id *id, v
 		ce->data.commit = (struct got_commit_object *)item;
 		break;
 	case GOT_OBJECT_CACHE_TYPE_MINI_COMMIT:
-		ce->data.mini_commit = (struct got_commit_object_mini *)item;
+		ce->data.mini_commit = (struct got_mini_commit_object *)item;
 		break;
 	}
 
@@ -169,7 +169,7 @@ void check_refcount(struct got_object_id *id, void *data, void *arg)
 	struct got_object *obj;
 	struct got_tree_object *tree;
 	struct got_commit_object *commit;
-	struct got_commit_object_mini *mini_commit;
+	struct got_mini_commit_object *mini_commit;
 	char *id_str;
 
 	if (got_object_id_str(&id_str, id) != NULL)
diff --git a/lib/object_parse.c b/lib/object_parse.c
index ce15a31..834b928 100644
--- a/lib/object_parse.c
+++ b/lib/object_parse.c
@@ -146,10 +146,10 @@ got_object_commit_alloc_partial(void)
 	return commit;
 }
 
-struct got_commit_object_mini *
+struct got_mini_commit_object *
 got_object_mini_commit_alloc_partial(void)
 {
-	struct got_commit_object_mini *commit;
+	struct got_mini_commit_object *commit;
 
 	commit = calloc(1, sizeof(*commit));
 	if (commit == NULL)
@@ -190,7 +190,7 @@ got_object_commit_add_parent(struct got_commit_object *commit,
 }
 
 const struct got_error *
-got_object_mini_commit_add_parent(struct got_commit_object_mini *commit,
+got_object_mini_commit_add_parent(struct got_mini_commit_object *commit,
     const char *id_str)
 {
 	const struct got_error *err = NULL;
@@ -310,7 +310,7 @@ got_object_commit_close(struct got_commit_object *commit)
 }
 
 void
-got_object_mini_commit_close(struct got_commit_object_mini *commit)
+got_object_mini_commit_close(struct got_mini_commit_object *commit)
 {
 	struct got_object_qid *qid;
 
@@ -452,7 +452,7 @@ done:
 }
 
 const struct got_error *
-got_object_parse_mini_commit(struct got_commit_object_mini **commit, char *buf,
+got_object_parse_mini_commit(struct got_mini_commit_object **commit, char *buf,
     size_t len)
 {
 	const struct got_error *err = NULL;
diff --git a/lib/privsep.c b/lib/privsep.c
index e0d4a53..d5e0f72 100644
--- a/lib/privsep.c
+++ b/lib/privsep.c
@@ -488,7 +488,7 @@ done:
 
 const struct got_error *
 got_privsep_send_mini_commit(struct imsgbuf *ibuf,
-    struct got_commit_object_mini *commit)
+    struct got_mini_commit_object *commit)
 {
 	const struct got_error *err = NULL;
 	struct got_imsg_commit_object_mini icommit;
@@ -681,7 +681,7 @@ got_privsep_recv_commit(struct got_commit_object **commit, struct imsgbuf *ibuf)
 }
 
 const struct got_error *
-got_privsep_recv_mini_commit(struct got_commit_object_mini **commit,
+got_privsep_recv_mini_commit(struct got_mini_commit_object **commit,
     struct imsgbuf *ibuf)
 {
 	const struct got_error *err = NULL;
diff --git a/lib/repository.c b/lib/repository.c
index 751a7ce..968cec4 100644
--- a/lib/repository.c
+++ b/lib/repository.c
@@ -233,7 +233,7 @@ got_repo_get_cached_commit(struct got_repository *repo,
 
 const struct got_error *
 got_repo_cache_mini_commit(struct got_repository *repo,
-    struct got_object_id *id, struct got_commit_object_mini *commit)
+    struct got_object_id *id, struct got_mini_commit_object *commit)
 {
 #ifndef GOT_NO_OBJ_CACHE
 	const struct got_error *err = NULL;
@@ -245,11 +245,11 @@ got_repo_cache_mini_commit(struct got_repository *repo,
 	return NULL;
 }
 
-struct got_commit_object_mini *
+struct got_mini_commit_object *
 got_repo_get_cached_mini_commit(struct got_repository *repo,
     struct got_object_id *id)
 {
-	return (struct got_commit_object_mini *)got_object_cache_get(
+	return (struct got_mini_commit_object *)got_object_cache_get(
 	    &repo->minicommitcache, id);
 }
 
diff --git a/libexec/got-read-commit/got-read-commit.c b/libexec/got-read-commit/got-read-commit.c
index 49187ef..b662f7b 100644
--- a/libexec/got-read-commit/got-read-commit.c
+++ b/libexec/got-read-commit/got-read-commit.c
@@ -80,7 +80,7 @@ read_commit_object(struct got_commit_object **commit, struct got_object *obj,
 }
 
 static const struct got_error *
-read_commit_object_mini(struct got_commit_object_mini **commit,
+read_commit_object_mini(struct got_mini_commit_object **commit,
     struct got_object *obj, FILE *f)
 {
 	const struct got_error *err;
@@ -177,7 +177,7 @@ main(int argc, char *argv[])
 		}
 
 		if (mini) {
-			struct got_commit_object_mini *commit;
+			struct got_mini_commit_object *commit;
 			err = read_commit_object_mini(&commit, obj, f);
 			if (err)
 				goto done;
diff --git a/libexec/got-read-pack/got-read-pack.c b/libexec/got-read-pack/got-read-pack.c
index 1a4046e..f9e2970 100644
--- a/libexec/got-read-pack/got-read-pack.c
+++ b/libexec/got-read-pack/got-read-pack.c
@@ -151,7 +151,7 @@ mini_commit_request(struct imsg *imsg, struct imsgbuf *ibuf,
 {
 	const struct got_error *err = NULL;
 	struct got_object *obj = NULL;
-	struct got_commit_object_mini *commit = NULL;
+	struct got_mini_commit_object *commit = NULL;
 	uint8_t *buf;
 	size_t len;