- struct object *object;
-
- if (!is_null_sha1(osha1)) {
- object = get_reference(cb->all_revs, cb->name_for_errormsg,
- osha1, cb->all_flags);
- add_pending_object(cb->all_revs, object, "");
+ if (!is_null_sha1(sha1)) {
+ struct object *o = parse_object(sha1);
+ if (o) {
+ o->flags |= cb->all_flags;
+ add_pending_object(cb->all_revs, o, "");
+ }
+ else if (!cb->warned_bad_reflog) {
+ warn("reflog of '%s' references pruned commits",
+ cb->name_for_errormsg);
+ cb->warned_bad_reflog = 1;
+ }