Commit b0dd8d2728f3fece5d4c5a57511203e0f9d56ed5

Stefan Sperling 2022-06-16T11:40:20

fix a recent regression where tog segfaults if Ctrl+l is used in the log view

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/tog/tog.c b/tog/tog.c
index a973c4a..61e731b 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -2781,6 +2781,11 @@ input_log_view(struct tog_view **new_view, struct tog_view *view, int ch)
 		} else /* 'B' */
 			s->log_branches = !s->log_branches;
 
+		if (s->thread_args.pack_fds == NULL) {
+			err = got_repo_pack_fds_open(&s->thread_args.pack_fds);
+			if (err)
+				return err;
+		}
 		err = got_repo_open(&s->thread_args.repo,
 		    got_repo_get_path(s->repo), NULL,
 		    s->thread_args.pack_fds);