]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/describe.c
Merge branch 'la/strvec-comment-fix' into maint-2.43
[thirdparty/git.git] / builtin / describe.c
index a9e375882bf2545736b2d38e65bc744c7d7b3497..d6c77a714f46194faca18739d0118294bc233f81 100644 (file)
@@ -7,9 +7,7 @@
 #include "lockfile.h"
 #include "commit.h"
 #include "tag.h"
-#include "blob.h"
 #include "refs.h"
-#include "exec-cmd.h"
 #include "object-name.h"
 #include "parse-options.h"
 #include "read-cache-ll.h"
@@ -561,9 +559,11 @@ static void describe(const char *arg, int last_one)
 static int option_parse_exact_match(const struct option *opt, const char *arg,
                                    int unset)
 {
+       int *val = opt->value;
+
        BUG_ON_OPT_ARG(arg);
 
-       max_candidates = unset ? DEFAULT_CANDIDATES : 0;
+       *val = unset ? DEFAULT_CANDIDATES : 0;
        return 0;
 }
 
@@ -578,7 +578,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
                OPT_BOOL(0, "long",       &longformat, N_("always use long format")),
                OPT_BOOL(0, "first-parent", &first_parent, N_("only follow first parent")),
                OPT__ABBREV(&abbrev),
-               OPT_CALLBACK_F(0, "exact-match", NULL, NULL,
+               OPT_CALLBACK_F(0, "exact-match", &max_candidates, NULL,
                               N_("only output exact matches"),
                               PARSE_OPT_NOARG, option_parse_exact_match),
                OPT_INTEGER(0, "candidates", &max_candidates,