Re: [PATCH 5/5] builtin/commit.c: reduce scope of variables
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jan 29, 2014, 20:17 UTC
- Message-ID
- <CAPig+cR3DdPS3W_FNPnXG+NO0gUG2PSLH0qNmFUsoxJcy0MVsQ@mail.gmail.com>
- In-Reply-To
- <1391003311-11126-1-git-send-email-gitter.spiros@gmail.com>
On Wed, Jan 29, 2014 at 8:48 AM, Elia Pinto <gitter.spiros@gmail.com> wrote:
Show 17 quoted lines
> diff --git a/builtin/commit.c b/builtin/commit.c > index 3767478..eea4421 100644 > --- a/builtin/commit.c > +++ b/builtin/commit.c > @@ -1510,7 +1511,6 @@ int cmd_commit(int argc, const char **argv, const char *prefix) > struct ref_lock *ref_lock; > struct commit_list *parents = NULL, **pptr = &parents; > struct stat statbuf; > - int allow_fast_forward = 1; > struct commit *current_head = NULL; > struct commit_extra_header *extra = NULL; > > @@ -1576,6 +1576,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix) > } > fclose(fp); > strbuf_release(&m); > + int allow_fast_forward = 1;
This introduces a declaration-after-statement, which is frowned upon in this project.
Show 5 quoted lines
> if (!stat(git_path("MERGE_MODE"), &statbuf)) {
> if (strbuf_read_file(&sb, git_path("MERGE_MODE"), 0) < 0)
> die_errno(_("could not read MERGE_MODE"));
> --
> 1.7.10.4