update-index: move 'uc' var declaration
authorChristian Couder <christian.couder@gmail.com>
Sun, 24 Jan 2016 15:28:18 +0000 (16:28 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Jan 2016 20:39:46 +0000 (12:39 -0800)
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/update-index.c
index 369c20731255afee16428b8e654d9788f2f5b3b5..fe7aaa34a418916adb522a3df3bee47ecb2ff669 100644 (file)
@@ -1116,8 +1116,6 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
                the_index.cache_changed |= SOMETHING_CHANGED;
        }
        if (untracked_cache > UC_DISABLE) {
-               struct untracked_cache *uc;
-
                if (untracked_cache < UC_FORCE) {
                        setup_work_tree();
                        if (!test_if_untracked_cache_is_supported())
@@ -1126,7 +1124,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
                                return 0;
                }
                if (!the_index.untracked) {
-                       uc = xcalloc(1, sizeof(*uc));
+                       struct untracked_cache *uc = xcalloc(1, sizeof(*uc));
                        strbuf_init(&uc->ident, 100);
                        uc->exclude_per_dir = ".gitignore";
                        /* should be the same flags used by git-status */