git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elia Pinto <gitter.spiros@gmail.com>
To: git@vger.kernel.org
Cc: Elia Pinto <gitter.spiros@gmail.com>
Subject: [PATCH] archive.c: reduce scope of variables
Date: Wed, 29 Jan 2014 05:18:35 -0800	[thread overview]
Message-ID: <1391001515-5672-1-git-send-email-gitter.spiros@gmail.com> (raw)

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 archive.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/archive.c b/archive.c
index 346f3b2..49b79f8 100644
--- a/archive.c
+++ b/archive.c
@@ -112,7 +112,6 @@ static int write_archive_entry(const unsigned char *sha1, const char *base,
 	write_archive_entry_fn_t write_entry = c->write_entry;
 	struct git_attr_check check[2];
 	const char *path_without_prefix;
-	int err;
 
 	args->convert = 0;
 	strbuf_reset(&path);
@@ -132,6 +131,7 @@ static int write_archive_entry(const unsigned char *sha1, const char *base,
 	}
 
 	if (S_ISDIR(mode) || S_ISGITLINK(mode)) {
+                int err;
 		if (args->verbose)
 			fprintf(stderr, "%.*s\n", (int)path.len, path.buf);
 		err = write_entry(args, sha1, path.buf, path.len, mode);
@@ -319,7 +319,6 @@ static int parse_archive_args(int argc, const char **argv,
 	const char *output = NULL;
 	int compression_level = -1;
 	int verbose = 0;
-	int i;
 	int list = 0;
 	int worktree_attributes = 0;
 	struct option opts[] = {
@@ -366,6 +365,7 @@ static int parse_archive_args(int argc, const char **argv,
 		base = "";
 
 	if (list) {
+                int i;
 		for (i = 0; i < nr_archivers; i++)
 			if (!is_remote || archivers[i]->flags & ARCHIVER_REMOTE)
 				printf("%s\n", archivers[i]->name);
-- 
1.7.10.4

             reply	other threads:[~2014-01-29 13:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-29 13:18 Elia Pinto [this message]
2014-01-29 18:28 ` [PATCH] archive.c: reduce scope of variables Junio C Hamano

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=1391001515-5672-1-git-send-email-gitter.spiros@gmail.com \
    --to=gitter.spiros@gmail.com \
    --cc=git@vger.kernel.org \
    /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).