commit - 75c3234010be6c6e1e48ed26894773b5f3c91808
commit + c8f60bffbe10a8ddb0e951e2a9d884663c946e8f
blob - db7cd78480ab95d45d3163ddb9490ff30a3d886f
blob + 050df20309f8ea292c70f9ab2a3c42a5ceb53d16
--- tog/tog.c
+++ tog/tog.c
struct got_object_id *id;
struct commit_queue_entry *entry;
int nfetched, nqueued = 0, found_obj = 0;
+ int is_root_path = strcmp(path, "/") == 0;
err = got_commit_graph_iter_start(graph, start_id);
if (err)
if (err)
break;
- if (path) {
+ if (!is_root_path) {
struct got_object *obj;
struct got_object_qid *pid;
int changed = 0;
err = got_object_open_by_path(&obj, repo, id, path);
if (err) {
+ got_object_commit_close(commit);
if (err->code == GOT_ERR_NO_OBJ &&
(found_obj || !init)) {
/* History stops here. */
if (err) {
if (err->code != GOT_ERR_NO_OBJ) {
got_object_close(obj);
+ got_object_commit_close(commit);
break;
}
err = NULL;
id = got_object_get_id(obj);
if (id == NULL) {
err = got_error_from_errno();
+ got_object_close(obj);
+ got_object_close(pobj);
break;
}
pid = got_object_get_id(pobj);
if (pid == NULL) {
err = got_error_from_errno();
free(id);
+ got_object_close(obj);
+ got_object_close(pobj);
break;
}
changed =
free(pid);
}
}
+ got_object_close(obj);
if (!changed) {
got_object_commit_close(commit);
continue;