From: Junio C Hamano Date: Tue, 6 Mar 2018 21:29:24 +0000 (-0800) Subject: Revert "Merge branch 'ps/contains-id-error-message' into next" X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/1fa2de948a864a0132591e99a0ac99a447ad05d8?ds=sidebyside Revert "Merge branch 'ps/contains-id-error-message' into next" This reverts commit a2c8e1f0510403956f3eb488235cbc552503236b, reversing changes made to cb683e0bf615cfbbe729b561a6ca9484c4bf4596. --- diff --git a/parse-options-cb.c b/parse-options-cb.c index c7320a73f4..c6679cb2cd 100644 --- a/parse-options-cb.c +++ b/parse-options-cb.c @@ -78,6 +78,22 @@ 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; diff --git a/parse-options.h b/parse-options.h index a912d6ae28..7258fe1c2d 100644 --- a/parse-options.h +++ b/parse-options.h @@ -236,6 +236,7 @@ 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); diff --git a/ref-filter.c b/ref-filter.c index fb57964c37..c4a98281fb 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -1997,7 +1997,7 @@ static void do_merge_filter(struct ref_filter_cbdata *ref_cbdata) free(to_clear); } -static int add_str_to_commit_list(struct string_list_item *item, void *commit_list) +int add_str_to_commit_list(struct string_list_item *item, void *commit_list) { struct object_id oid; struct commit *commit;