git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Pearce <spearce@spearce.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: [PATCH] Remove unused variable in receive-pack.
Date: Mon, 30 Oct 2006 17:34:50 -0500	[thread overview]
Message-ID: <20061030223450.GE5775@spearce.org> (raw)

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

                 reply	other threads:[~2006-10-30 22:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061030223450.GE5775@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).