diff-parseopt: convert --inter-hunk-context
[gitweb.git] / parse-options-cb.c
index ec01ef722bdc951bb038653de8b24d662efe9d38..6e2e8d6273a2b3c35248a956f77a19925ded3e7d 100644 (file)
@@ -22,8 +22,8 @@ int parse_opt_abbrev_cb(const struct option *opt, const char *arg, int unset)
                                     opt->long_name);
                if (v && v < MINIMUM_ABBREV)
                        v = MINIMUM_ABBREV;
-               else if (v > 40)
-                       v = 40;
+               else if (v > the_hash_algo->hexsz)
+                       v = the_hash_algo->hexsz;
        }
        *(int *)(opt->value) = v;
        return 0;
@@ -171,8 +171,10 @@ int parse_opt_noop_cb(const struct option *opt, const char *arg, int unset)
  * parse_options().
  */
 enum parse_opt_result parse_opt_unknown_cb(struct parse_opt_ctx_t *ctx,
-                                          const struct option *opt, int unset)
+                                          const struct option *opt,
+                                          const char *arg, int unset)
 {
+       BUG_ON_OPT_ARG(arg);
        return PARSE_OPT_UNKNOWN;
 }