tag: fix formatting
[gitweb.git] / builtin / update-index.c
index 21c84e559065213fe3ae9fa88533bb7e72432dec..1b6c42f748fd52ece4cf5f109f92a50bc2a87be3 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "lockfile.h"
@@ -848,13 +849,15 @@ static int parse_new_style_cacheinfo(const char *arg,
 }
 
 static enum parse_opt_result cacheinfo_callback(
-       struct parse_opt_ctx_t *ctx, const struct option *opt, int unset)
+       struct parse_opt_ctx_t *ctx, const struct option *opt,
+       const char *arg, int unset)
 {
        struct object_id oid;
        unsigned int mode;
        const char *path;
 
        BUG_ON_OPT_NEG(unset);
+       BUG_ON_OPT_ARG(arg);
 
        if (!parse_new_style_cacheinfo(ctx->argv[1], &mode, &oid, &path)) {
                if (add_cacheinfo(mode, &oid, path, 0))
@@ -874,11 +877,13 @@ static enum parse_opt_result cacheinfo_callback(
 }
 
 static enum parse_opt_result stdin_cacheinfo_callback(
-       struct parse_opt_ctx_t *ctx, const struct option *opt, int unset)
+       struct parse_opt_ctx_t *ctx, const struct option *opt,
+       const char *arg, int unset)
 {
        int *nul_term_line = opt->value;
 
        BUG_ON_OPT_NEG(unset);
+       BUG_ON_OPT_ARG(arg);
 
        if (ctx->argc != 1)
                return error("option '%s' must be the last argument", opt->long_name);
@@ -888,11 +893,13 @@ static enum parse_opt_result stdin_cacheinfo_callback(
 }
 
 static enum parse_opt_result stdin_callback(
-       struct parse_opt_ctx_t *ctx, const struct option *opt, int unset)
+       struct parse_opt_ctx_t *ctx, const struct option *opt,
+       const char *arg, int unset)
 {
        int *read_from_stdin = opt->value;
 
        BUG_ON_OPT_NEG(unset);
+       BUG_ON_OPT_ARG(arg);
 
        if (ctx->argc != 1)
                return error("option '%s' must be the last argument", opt->long_name);
@@ -901,12 +908,14 @@ static enum parse_opt_result stdin_callback(
 }
 
 static enum parse_opt_result unresolve_callback(
-       struct parse_opt_ctx_t *ctx, const struct option *opt, int unset)
+       struct parse_opt_ctx_t *ctx, const struct option *opt,
+       const char *arg, int unset)
 {
        int *has_errors = opt->value;
        const char *prefix = startup_info->prefix;
 
        BUG_ON_OPT_NEG(unset);
+       BUG_ON_OPT_ARG(arg);
 
        /* consume remaining arguments. */
        *has_errors = do_unresolve(ctx->argc, ctx->argv,
@@ -920,12 +929,14 @@ static enum parse_opt_result unresolve_callback(
 }
 
 static enum parse_opt_result reupdate_callback(
-       struct parse_opt_ctx_t *ctx, const struct option *opt, int unset)
+       struct parse_opt_ctx_t *ctx, const struct option *opt,
+       const char *arg, int unset)
 {
        int *has_errors = opt->value;
        const char *prefix = startup_info->prefix;
 
        BUG_ON_OPT_NEG(unset);
+       BUG_ON_OPT_ARG(arg);
 
        /* consume remaining arguments. */
        setup_work_tree();