commit - 30e77f6ad14985d6db8d179b7ed73dc4c8cab68a
commit + 6f6c25d65e82e60c44877d2aa05bcbdbc48e65b3
blob - cb676e08ed97b46d2255d4e5b79240ed2b64d571
blob + 19f043e1c43b4b21c3b19d764f34a7575df5b7a7
--- include/got_object.h
+++ include/got_object.h
const char *, struct got_object_id *, const char *,
time_t, const char *, const char *, struct got_repository *, int verbosity);
-const struct got_error *got_object_commit_dup(struct got_commit_object **,
- struct got_commit_object *);
+/* Increment commit object reference counter. */
+void got_object_commit_retain(struct got_commit_object *);
blob - f485d23a6aac717ea3e25da068cf4cea73c1de88
blob + 053eb0ba5b9cf91bc1ea8f179cf16d57da981f43
--- lib/object.c
+++ lib/object.c
return err;
}
-const struct got_error *
-got_object_commit_dup(struct got_commit_object **ret,
- struct got_commit_object *commit)
+void
+got_object_commit_retain(struct got_commit_object *commit)
{
- *ret = commit;
commit->refcnt++;
- return NULL;
}
blob - a2ad8c27009958805e6bb47498c2f321dd725a1a
blob + ee792d2677cda12344066e20f5d3356624a8a091
--- tog/tog.c
+++ tog/tog.c
"alloc_commit_queue_entry");
break;
}
-
- err = got_object_commit_dup(&matched->commit,
- entry->commit);
- if (err)
- break;
+ matched->commit = entry->commit;
+ got_object_commit_retain(entry->commit);
matched->idx = a->limit_commits->ncommits;
TAILQ_INSERT_TAIL(&a->limit_commits->head,
"alloc_commit_queue_entry");
break;
}
-
- err = got_object_commit_dup(&matched->commit,
- entry->commit);
- if (err) {
- free(matched);
- return err;
- }
+ matched->commit = entry->commit;
+ got_object_commit_retain(entry->commit);
matched->idx = s->limit_commits.ncommits;
TAILQ_INSERT_TAIL(&s->limit_commits.head,