commit - 69efd4c49901a7b626009976256a4b3af8de7c4e
commit + c9beca569c9356828c551fa4cb0a1ea5496a4fbd
blob - 990602888133f25a73e5e50b15b231c68f9df59f
blob + 0f6ba4928b06a4b9383c7ed7a1043c8866c8a283
--- tog/tog.c
+++ tog/tog.c
err = got_blame_incremental(ta->path, a->commit_id, ta->repo,
blame_cb, ta->cb_args);
- got_repo_close(ta->repo);
- ta->repo = NULL;
- *ta->complete = 1;
- if (err)
- return (void *)err;
if (pthread_mutex_lock(a->mutex) != 0)
return (void *)got_error_from_errno();
- err = draw_blame(tog_blame_view.window, a->commit_id, a->f, a->path,
- a->lines, a->nlines, 1, *a->selected_line, a->first_displayed_line,
- a->last_displayed_line, &eof, LINES);
+ got_repo_close(ta->repo);
+ ta->repo = NULL;
+ *ta->complete = 1;
+ if (!err)
+ err = draw_blame(tog_blame_view.window, a->commit_id, a->f,
+ a->path, a->lines, a->nlines, 1, *a->selected_line,
+ a->first_displayed_line, a->last_displayed_line, &eof,
+ LINES);
if (pthread_mutex_unlock(a->mutex) != 0 && err == NULL)
err = got_error_from_errno();
struct got_object *obj = NULL, *pobj = NULL;
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
struct tog_blame blame;
- int blame_running = 0;
struct got_object_id_queue blamed_commits;
struct got_object_qid *blamed_commit = NULL;
goto done;
}
thread_err = stop_blame(&blame);
- blame_running = 0;
done = 0;
if (pthread_mutex_lock(&mutex) != 0) {
err = got_error_from_errno();
&done, path, blamed_commit->id, repo);
if (err)
break;
- blame_running = 1;
break;
}
case 'B': {
goto done;
}
thread_err = stop_blame(&blame);
- blame_running = 0;
done = 0;
if (pthread_mutex_lock(&mutex) != 0) {
err = got_error_from_errno();
&done, path, blamed_commit->id, repo);
if (err)
break;
- blame_running = 1;
break;
}
case KEY_ENTER:
done:
if (pobj)
got_object_close(pobj);
- if (blame_running)
+ if (blame.thread)
thread_err = stop_blame(&blame);
while (!SIMPLEQ_EMPTY(&blamed_commits)) {
blamed_commit = SIMPLEQ_FIRST(&blamed_commits);