MCPcopy Create free account
hub / github.com/git/git / read_ref_at_ent

Function read_ref_at_ent

refs.c:1107–1147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1105}
1106
1107static int read_ref_at_ent(const char *refname,
1108 struct object_id *ooid, struct object_id *noid,
1109 const char *email UNUSED,
1110 timestamp_t timestamp, int tz,
1111 const char *message, void *cb_data)
1112{
1113 struct read_ref_at_cb *cb = cb_data;
1114
1115 cb->tz = tz;
1116 cb->date = timestamp;
1117
1118 if (timestamp <= cb->at_time || cb->cnt == 0) {
1119 set_read_ref_cutoffs(cb, timestamp, tz, message);
1120 /*
1121 * we have not yet updated cb->[n|o]oid so they still
1122 * hold the values for the previous record.
1123 */
1124 if (!is_null_oid(&cb->ooid)) {
1125 oidcpy(cb->oid, noid);
1126 if (!oideq(&cb->ooid, noid))
1127 warning(_("log for ref %s has gap after %s"),
1128 refname, show_date(cb->date, cb->tz, DATE_MODE(RFC2822)));
1129 }
1130 else if (cb->date == cb->at_time)
1131 oidcpy(cb->oid, noid);
1132 else if (!oideq(noid, cb->oid))
1133 warning(_("log for ref %s unexpectedly ended on %s"),
1134 refname, show_date(cb->date, cb->tz, DATE_MODE(RFC2822)));
1135 cb->reccnt++;
1136 oidcpy(&cb->ooid, ooid);
1137 oidcpy(&cb->noid, noid);
1138 cb->found_it = 1;
1139 return 1;
1140 }
1141 cb->reccnt++;
1142 oidcpy(&cb->ooid, ooid);
1143 oidcpy(&cb->noid, noid);
1144 if (cb->cnt > 0)
1145 cb->cnt--;
1146 return 0;
1147}
1148
1149static int read_ref_at_ent_oldest(const char *refname UNUSED,
1150 struct object_id *ooid, struct object_id *noid,

Callers

nothing calls this directly

Calls 6

set_read_ref_cutoffsFunction · 0.85
is_null_oidFunction · 0.85
oidcpyFunction · 0.85
oideqFunction · 0.85
warningFunction · 0.85
show_dateFunction · 0.85

Tested by

no test coverage detected