parse-options: remove the unused parse_opt_commits() function
authorRamsay Jones <ramsay@ramsayjones.plus.com>
Fri, 2 Mar 2018 02:56:05 +0000 (02:56 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 2 Mar 2018 17:18:32 +0000 (09:18 -0800)
Commit fcfba37337 ('ref-filter: make "--contains <id>" less chatty if
<id> is invalid', 2018-02-23), removed the last use of the callback
function parse_opt_commits(). Remove this function declaration and
definition, since it is now dead code.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse-options-cb.c
parse-options.h
index c6679cb2cdee15981ee9ef31c402c358a3727d1e..c7320a73f48d48469ee2c4fd02096b6f96005c0b 100644 (file)
@@ -78,22 +78,6 @@ int parse_opt_verbosity_cb(const struct option *opt, const char *arg,
        return 0;
 }
 
-int parse_opt_commits(const struct option *opt, const char *arg, int unset)
-{
-       struct object_id oid;
-       struct commit *commit;
-
-       if (!arg)
-               return -1;
-       if (get_oid(arg, &oid))
-               return error("malformed object name %s", arg);
-       commit = lookup_commit_reference(&oid);
-       if (!commit)
-               return error("no such commit %s", arg);
-       commit_list_insert(commit, opt->value);
-       return 0;
-}
-
 int parse_opt_object_name(const struct option *opt, const char *arg, int unset)
 {
        struct object_id oid;
index 4b4734f2e7e4e67a4ef1f1cf59655b7e7b2d7705..2b8378ac1aa3013fcc28b22ae833bbaf23fadef5 100644 (file)
@@ -224,7 +224,6 @@ extern int parse_opt_expiry_date_cb(const struct option *, const char *, int);
 extern int parse_opt_color_flag_cb(const struct option *, const char *, int);
 extern int parse_opt_verbosity_cb(const struct option *, const char *, int);
 extern int parse_opt_object_name(const struct option *, const char *, int);
-extern int parse_opt_commits(const struct option *, const char *, int);
 extern int parse_opt_tertiary(const struct option *, const char *, int);
 extern int parse_opt_string_list(const struct option *, const char *, int);
 extern int parse_opt_noop_cb(const struct option *, const char *, int);