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

[PATCH] Remove unused variable in receive-pack.

From
Shawn Pearce <spearce@spearce.org>
Date
Oct 30, 2006, 22:34 UTC
Message-ID
<20061030223450.GE5775@spearce.org>

We aren't using this return code variable for anything so lets just get rid of it to keep this section of code clean.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 receive-pack.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/receive-pack.c b/receive-pack.c
index 7e4e510..f6f1729 100644
--- a/receive-pack.c
+++ b/receive-pack.c
@@ -219,7 +219,7 @@ static void read_head_info(void)
 	}
 }
 
-static const char *unpack(int *error_code)
+static const char *unpack()
 {
 	int code;
 
@@ -230,7 +230,6 @@ static const char *unpack(int *error_cod
 		code = run_command_v_opt(ARRAY_SIZE(unpacker) - 1,
 					 unpacker, RUN_GIT_CMD);
 
-	*error_code = 0;
 	switch (code) {
 	case 0:
 		return NULL;
@@ -247,7 +246,6 @@ static const char *unpack(int *error_cod
 	case -ERR_RUN_COMMAND_WAITPID_NOEXIT:
 		return "unpacker died strangely";
 	default:
-		*error_code = -code;
 		return "unpacker exited with error code";
 	}
 }
@@ -301,8 +299,7 @@ int main(int argc, char **argv)
 
 	read_head_info();
 	if (commands) {
-		int code;
-		const char *unpack_status = unpack(&code);
+		const char *unpack_status = unpack();
 		if (!unpack_status)
 			execute_commands();
 		if (report_status)
-- 
1.4.3.3.g7d63
Message 1 of 1 in “Remove unused variable in receive-pack.”
  1. Remove unused variable in receive-pack.Shawn Pearce, Oct 30, 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.