commit 3a333429726b35ea339647d2b857047a8a1998e5 from: Mark Jamsek via: Thomas Adam date: Wed Jul 26 19:15:43 2023 UTC fix occasional test failure in test_log_show_base_commit Patch by jamsek with a request to commit. Thanks! commit - e2a79cf900ad48826685edea49a88c8f72d2e75f commit + 3a333429726b35ea339647d2b857047a8a1998e5 blob - 5b0d0805104fc83a7d6cf6fbb127e9db3cedf4de blob + 3ae5dcd00f4ad172487b60b4703ae8ff8a9ecbe6 --- tog/tog.c +++ tog/tog.c @@ -2433,6 +2433,13 @@ draw_commit(struct tog_view *view, struct commit_queue if (tog_base_commit.id != NULL && tog_base_commit.idx == -1 && got_object_id_cmp(id, tog_base_commit.id) == 0) tog_base_commit.idx = entry->idx; + if (tog_io.wait_for_ui && s->thread_args.need_commit_marker) { + int rc; + + rc = pthread_cond_wait(&s->thread_args.log_loaded, &tog_mutex); + if (rc) + return got_error_set_errno(rc, "pthread_cond_wait"); + } committer_time = got_object_commit_get_committer_time(commit); if (gmtime_r(&committer_time, &tm) == NULL) @@ -3914,16 +3921,6 @@ show_log_view(struct tog_view *view) err = trigger_log_thread(view, 1); if (err) return err; - if (tog_io.wait_for_ui) { - int rc; - - rc = pthread_cond_wait(&s->thread_args.log_loaded, - &tog_mutex); - if (rc) - return got_error_set_errno(rc, - "pthread_cond_wait"); - tog_io.wait_for_ui = 0; - } } }