From: Mark Jamsek Subject: tog: zap duplicate s->repo assignment To: gameoftrees@openbsd.org Date: Tue, 03 Dec 2024 17:12:04 +1100 This is 1 of 4 trivial fixes spotted while implementing support for work tree diffs in tog: remove a duplicate s->repo assignment and while here, group all the diff state assignments together. commit c40fae9ea3e7b382c6cae97d3bf7c0dfe32d4c75 from: Mark Jamsek date: Tue Dec 3 05:53:49 2024 UTC tog: group state assignments and zap dup repo assignment M tog/tog.c | 5+ 6- 1 file changed, 5 insertions(+), 6 deletions(-) commit - 31edaabd1e26d490a3027877ed29eb5e10a8e72a commit + c40fae9ea3e7b382c6cae97d3bf7c0dfe32d4c75 blob - 6a3ab601e381f4509dc6b047a59a9213328afbc9 blob + d1ed335b36437f59534fbfd1126cc20d0b74507f --- tog/tog.c +++ tog/tog.c @@ -5712,12 +5712,6 @@ open_diff_view(struct tog_view *view, struct got_objec goto done; } } - s->first_displayed_line = 1; - s->last_displayed_line = view->nlines; - s->selected_line = 1; - s->repo = repo; - s->label1 = label1; - s->label2 = label2; if (id1) { s->id1 = got_object_id_dup(id1); @@ -5758,6 +5752,11 @@ open_diff_view(struct tog_view *view, struct got_objec goto done; } + s->first_displayed_line = 1; + s->last_displayed_line = view->nlines; + s->selected_line = 1; + s->label1 = label1; + s->label2 = label2; s->diff_context = diff_context; s->ignore_whitespace = ignore_whitespace; s->force_text_diff = force_text_diff; -- Mark Jamsek GPG: F2FF 13DE 6A06 C471 CA80 E6E2 2930 DC66 86EE CF68