git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Soffian <jaysoffian@gmail.com>
To: git@vger.kernel.org
Cc: Jay Soffian <jaysoffian@gmail.com>, Jeff King <peff@peff.net>,
	Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 1/2] builtin-remote: make rm() use properly named variable to hold return value
Date: Tue,  3 Feb 2009 12:51:12 -0500	[thread overview]
Message-ID: <1233683473-87893-1-git-send-email-jaysoffian@gmail.com> (raw)
In-Reply-To: <76718490902030638y36299191i1fcc2ab8646b9593@mail.gmail.com>

"i" is a loop counter and should not be used to hold a return value; use
"result" instead which is consistent with the rest of builtin-remote.c.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
---
I'm not sure this minor change needed to be broken out into its own commit,
so squash with 2/2 if that's appropriate.

 builtin-remote.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/builtin-remote.c b/builtin-remote.c
index abc8dd8..21885fb 100644
--- a/builtin-remote.c
+++ b/builtin-remote.c
@@ -543,7 +543,7 @@ static int rm(int argc, const char **argv)
 	struct known_remotes known_remotes = { NULL, NULL };
 	struct string_list branches = { NULL, 0, 0, 1 };
 	struct branches_for_remote cb_data = { NULL, &branches, &known_remotes };
-	int i;
+	int i, result;
 
 	if (argc != 2)
 		usage_with_options(builtin_remote_usage, options);
@@ -583,14 +583,14 @@ static int rm(int argc, const char **argv)
 	 * refs, which are invalidated when deleting a branch.
 	 */
 	cb_data.remote = remote;
-	i = for_each_ref(add_branch_for_removal, &cb_data);
+	result = for_each_ref(add_branch_for_removal, &cb_data);
 	strbuf_release(&buf);
 
-	if (!i)
-		i = remove_branches(&branches);
+	if (!result)
+		result = remove_branches(&branches);
 	string_list_clear(&branches, 1);
 
-	return i;
+	return result;
 }
 
 static void show_list(const char *title, struct string_list *list,
-- 
1.6.1.2.311.g2d7f3

  parent reply	other threads:[~2009-02-03 17:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-01 14:52 git remote rm considered harmful? Jay Soffian
2009-02-01 15:48 ` [PATCH] builtin-remote: make rm operation safer in mirrored repository Jay Soffian
2009-02-02 13:29   ` Jeff King
2009-02-02 13:36     ` Jay Soffian
2009-02-02 18:40       ` Jay Soffian
2009-02-03  7:24         ` Jeff King
2009-02-03  7:54           ` Junio C Hamano
2009-02-03 14:38             ` Jay Soffian
2009-02-03 14:53               ` Johannes Schindelin
2009-02-03 17:51               ` Jay Soffian [this message]
2009-02-04 15:34                 ` [PATCH 1/2] builtin-remote: make rm() use properly named variable to hold return value Jeff King
2009-02-03 17:51               ` [PATCH 2/2] builtin-remote: make rm operation safer in mirrored repository Jay Soffian
2009-02-04 15:42                 ` Jeff King
2009-02-04 15:56                   ` Jay Soffian
2009-02-04 16:06                     ` [PATCH] " Jay Soffian
2009-02-04 16:18                       ` Jeff King
2009-02-04 16:16                     ` [PATCH 2/2] " Jeff King

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=1233683473-87893-1-git-send-email-jaysoffian@gmail.com \
    --to=jaysoffian@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.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).