Thread (85 messages) 85 messages, 6 authors, 2024-06-06

Re: [PATCH v4 06/12] refs/files: extract function to iterate through root refs

From: Patrick Steinhardt <hidden>
Date: 2024-06-06 04:51:04

On Wed, Jun 05, 2024 at 06:07:28AM -0400, Jeff King wrote:
On Mon, Jun 03, 2024 at 11:30:35AM +0200, Patrick Steinhardt wrote:
quoted
+static int for_each_root_ref(struct files_ref_store *refs,
+			     int (*cb)(const char *refname, void *cb_data),
+			     void *cb_data)
 {
 	struct strbuf path = STRBUF_INIT, refname = STRBUF_INIT;
 	const char *dirname = refs->loose->root->name;
 	struct dirent *de;
 	size_t dirnamelen;
+	int ret;
 	DIR *d;
Should we initialize ret to 0 here?
Yeah, we should. Or rather, I'll set `ret = 0;` on the successful path.

Patrick

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help