Commit Diff


commit - 0d4100bb4ef1929c700f627d1e0c5b099e61fa11
commit + 9343a5fb1e6985acd066cde03dc94e19d44df9a9
blob - d439851a006530e08a5537c343fb098176316abc
blob + a2a4b43e23a5eb4b570c789e9440d322b348f162
--- tog/tog.c
+++ tog/tog.c
@@ -569,6 +569,21 @@ done:
 }
 
 static const struct got_error *
+browse_commit(struct commit_queue_entry *entry, struct got_repository *repo)
+{
+	const struct got_error *err = NULL;
+	struct got_tree_object *tree;
+
+	err = got_object_open_as_tree(&tree, repo, entry->commit->tree_id);
+	if (err)
+		return err;
+
+	err = show_tree_view(tree, entry->id, repo);
+	got_object_tree_close(tree);
+	return err;
+}
+
+static const struct got_error *
 show_log_view(struct got_object_id *start_id, struct got_repository *repo)
 {
 	const struct got_error *err = NULL;
@@ -706,6 +721,12 @@ show_log_view(struct got_object_id *start_id, struct g
 			case KEY_ENTER:
 			case '\r':
 				err = show_commit(selected_entry, repo);
+				if (err)
+					goto done;
+				show_panel(tog_log_view.panel);
+				break;
+			case 't':
+				err = browse_commit(selected_entry, repo);
 				if (err)
 					goto done;
 				show_panel(tog_log_view.panel);