]> git.ipfire.org Git - thirdparty/git.git/commitdiff
builtin/apply: move 'read_stdin' global into cmd_apply()
authorChristian Couder <christian.couder@gmail.com>
Wed, 11 May 2016 13:16:18 +0000 (15:16 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 May 2016 19:21:24 +0000 (12:21 -0700)
The 'read_stdin' variable doesn't need to be static and global to the
file. It can be local to cmd_apply(), so let's move it there.

This will make it easier to libify the apply functionality.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/apply.c

index 5a1d65a69536ce899e4e51b00f65316805a0bd44..c911e4ec8245ff06d9be4460b5041dee4428ec12 100644 (file)
@@ -78,7 +78,6 @@ static enum ws_ignore {
 
 static const char *patch_input_file;
 static struct strbuf root = STRBUF_INIT;
-static int read_stdin = 1;
 
 static void parse_whitespace_option(const char *option)
 {
@@ -4517,6 +4516,7 @@ int cmd_apply(int argc, const char **argv, const char *prefix_)
        int is_not_gitdir = !startup_info->have_repository;
        int force_apply = 0;
        int options = 0;
+       int read_stdin = 1;
 
        const char *whitespace_option = NULL;