s->data.marked[idnum] = oe;
}
-static struct object_entry *find_mark(uintmax_t idnum)
+static void *find_mark(struct mark_set *s, uintmax_t idnum)
{
uintmax_t orig_idnum = idnum;
- struct mark_set *s = marks;
struct object_entry *oe = NULL;
if ((idnum >> s->shift) < 1024) {
while (s && s->shift) {
}
if (*p == ':') {
- oe = find_mark(parse_mark_ref_space(&p));
+ oe = find_mark(marks, parse_mark_ref_space(&p));
oidcpy(&oid, &oe->idx.oid);
} else if (skip_prefix(p, "inline ", &p)) {
inline_data = 1;
/* Now parse the notemodify command. */
/* <dataref> or 'inline' */
if (*p == ':') {
- oe = find_mark(parse_mark_ref_space(&p));
+ oe = find_mark(marks, parse_mark_ref_space(&p));
oidcpy(&oid, &oe->idx.oid);
} else if (skip_prefix(p, "inline ", &p)) {
inline_data = 1;
oidcpy(&commit_oid, &s->oid);
} else if (*p == ':') {
uintmax_t commit_mark = parse_mark_ref_eol(p);
- struct object_entry *commit_oe = find_mark(commit_mark);
+ struct object_entry *commit_oe = find_mark(marks, commit_mark);
if (commit_oe->type != OBJ_COMMIT)
die("Mark :%" PRIuMAX " not a commit", commit_mark);
oidcpy(&commit_oid, &commit_oe->idx.oid);
oidcpy(&b->branch_tree.versions[1].oid, t);
} else if (*objectish == ':') {
uintmax_t idnum = parse_mark_ref_eol(objectish);
- struct object_entry *oe = find_mark(idnum);
+ struct object_entry *oe = find_mark(marks, idnum);
if (oe->type != OBJ_COMMIT)
die("Mark :%" PRIuMAX " not a commit", idnum);
if (!oideq(&b->oid, &oe->idx.oid)) {
oidcpy(&n->oid, &s->oid);
else if (*from == ':') {
uintmax_t idnum = parse_mark_ref_eol(from);
- struct object_entry *oe = find_mark(idnum);
+ struct object_entry *oe = find_mark(marks, idnum);
if (oe->type != OBJ_COMMIT)
die("Mark :%" PRIuMAX " not a commit", idnum);
oidcpy(&n->oid, &oe->idx.oid);
} else if (*from == ':') {
struct object_entry *oe;
from_mark = parse_mark_ref_eol(from);
- oe = find_mark(from_mark);
+ oe = find_mark(marks, from_mark);
type = oe->type;
oidcpy(&oid, &oe->idx.oid);
} else if (!get_oid(from, &oid)) {
if (*p != ':')
die("Not a mark: %s", p);
- oe = find_mark(parse_mark_ref_eol(p));
+ oe = find_mark(marks, parse_mark_ref_eol(p));
if (!oe)
die("Unknown mark: %s", command_buf.buf);
/* cat-blob SP <object> LF */
if (*p == ':') {
- oe = find_mark(parse_mark_ref_eol(p));
+ oe = find_mark(marks, parse_mark_ref_eol(p));
if (!oe)
die("Unknown mark: %s", command_buf.buf);
oidcpy(&oid, &oe->idx.oid);
struct object_entry *e;
if (**p == ':') { /* <mark> */
- e = find_mark(parse_mark_ref_space(p));
+ e = find_mark(marks, parse_mark_ref_space(p));
if (!e)
die("Unknown mark: %s", command_buf.buf);
oidcpy(&oid, &e->idx.oid);