commit - 6f04a9f3014abece8f6e4cecccc3d7e7e35c9984
commit + ce631d355cc5c9d10e40a7d35b331afba2f3d964
blob - c8c1fee8278da6aa0241a91d1b28affaf190a9c2
blob + ead293d381171fe6a5cefeb397cc88b5de8b9910
--- tog/tog.c
+++ tog/tog.c
int obj_type;
struct got_diff_line *lines = NULL;
struct got_pathlist_head changed_paths;
+ struct got_commit_object *commit2 = NULL;
TAILQ_INIT(&changed_paths);
case GOT_OBJ_TYPE_COMMIT: {
const struct got_object_id_queue *parent_ids;
struct got_object_qid *pid;
- struct got_commit_object *commit2;
struct got_reflist_head *refs;
size_t nlines = 0;
struct got_diffstat_cb_arg dsa = {
if (err)
break;
- err = got_object_open_as_commit(&commit2, s->repo, s->id2);
- if (err)
- goto done;
refs = got_reflist_object_id_map_lookup(tog_refs_idmap, s->id2);
/* Show commit info if we're diffing to a parent/root commit. */
if (s->id1 == NULL) {
if (err)
goto done;
} else {
+ err = got_object_open_as_commit(&commit2, s->repo,
+ s->id2);
+ if (err)
+ goto done;
+
parent_ids = got_object_commit_get_parent_ids(commit2);
STAILQ_FOREACH(pid, parent_ids, entry) {
if (got_object_id_cmp(s->id1, &pid->id) == 0) {
}
}
}
- got_object_commit_close(commit2);
err = cat_diff(s->f, tmp_diff_file, &s->lines, &s->nlines,
lines, nlines);
}
done:
free(lines);
+ if (commit2 != NULL)
+ got_object_commit_close(commit2);
got_pathlist_free(&changed_paths, GOT_PATHLIST_FREE_ALL);
if (s->f && fflush(s->f) != 0 && err == NULL)
err = got_error_from_errno("fflush");