git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 09/28] makes prune_dir void

From
DRDavid Rientjes <rientjes@google.com>
Date
Aug 14, 2006, 20:26 UTC
Message-ID
<Pine.LNX.4.63.0608141325350.19383@chino.corp.google.com>
Makes prune_dir void and cleans up function calls.
		David
Signed-off-by: David Rientjes <rientjes@google.com>
---
 builtin-prune.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/builtin-prune.c b/builtin-prune.c
index 89ec7f1..f01f275 100644
--- a/builtin-prune.c
+++ b/builtin-prune.c
@@ -14,24 +14,24 @@ static const char prune_usage[] = "git-p
 static int show_only = 0;
 static struct rev_info revs;
 
-static int prune_object(char *path, const char *filename, const unsigned char *sha1)
+static void prune_object(char *path, const char *filename,
+			 const unsigned char *sha1)
 {
 	if (show_only) {
 		printf("would prune %s/%s\n", path, filename);
-		return 0;
+	} else {
+		unlink(mkpath("%s/%s", path, filename));
+		rmdir(path);
 	}
-	unlink(mkpath("%s/%s", path, filename));
-	rmdir(path);
-	return 0;
 }
 
-static int prune_dir(int i, char *path)
+static void prune_dir(int i, char *path)
 {
 	DIR *dir = opendir(path);
 	struct dirent *de;
 
 	if (!dir)
-		return 0;
+		return;
 
 	while ((de = readdir(dir)) != NULL) {
 		char name[100];
@@ -65,7 +65,6 @@ static int prune_dir(int i, char *path)
 		fprintf(stderr, "bad sha1 file: %s/%s\n", path, de->d_name);
 	}
 	closedir(dir);
-	return 0;
 }
 
 static void prune_object_dir(const char *path)
-- 
1.4.2.g89bb-dirty
Message 1 of 1 in “makes prune_dir void”
  1. 09/28 makes prune_dir voidDavid Rientjes, Aug 14, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.