free_array_item(item);
}
- for (i = 0; i < old_nr; i++)
- clear_commit_marks(to_clear[i], ALL_REV_FLAGS);
+ clear_commit_marks_many(old_nr, to_clear, ALL_REV_FLAGS);
clear_commit_marks(filter->merge_commit, ALL_REV_FLAGS);
free(to_clear);
}
+int add_str_to_commit_list(struct string_list_item *item, void *commit_list)
+{
+ struct object_id oid;
+ struct commit *commit;
+
+ if (get_oid(item->string, &oid)) {
+ error(_("malformed object name %s"), item->string);
+ exit(1);
+ }
+ commit = lookup_commit_reference(&oid);
+ if (!commit) {
+ error(_("no such commit %s"), item->string);
+ exit(1);
+ }
+ commit_list_insert(commit, commit_list);
+
+ return 0;
+}
+
/*
* API for filtering a set of refs. Based on the type of refs the user
* has requested, we iterate through those refs and apply filters
int ret = 0;
unsigned int broken = 0;
+ /* Convert string representation and add to commit list. */
+ for_each_string_list(&filter->with_commit_strs, add_str_to_commit_list, &filter->with_commit);
+ for_each_string_list(&filter->no_commit_strs, add_str_to_commit_list, &filter->no_commit);
+
ref_cbdata.array = array;
ref_cbdata.filter = filter;