Commit 10d47faf5c11c961d79e0f78da4219dd9f785a97

Tracey Emery 2020-01-31T17:22:43

add link to blame hash for blob of that commit

diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index 0278c5f..ae3db86 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -2353,9 +2353,10 @@ gw_blame_cb(void *arg, int nlines, int lineno, struct got_object_id *id)
 		else
 			line_escape = strdup("");
 
-		asprintf(&blame_row, blame_line, a->nlines_prec,
-		    a->lineno_cur, bline->id_str, bline->datebuf, committer,
-		    line_escape);
+		asprintf(&blame_row, blame_line, a->nlines_prec, a->lineno_cur,
+		    a->gw_trans->repo_name, bline->id_str,
+		    a->gw_trans->repo_file, a->gw_trans->repo_folder,
+		    bline->id_str, bline->datebuf, committer, line_escape);
 		a->lineno_cur++;
 		err = buf_puts(&newsize, a->blamebuf, blame_row);
 		if (err)
diff --git a/gotweb/gotweb_ui.h b/gotweb/gotweb_ui.h
index 7f02105..de5ce6d 100644
--- a/gotweb/gotweb_ui.h
+++ b/gotweb/gotweb_ui.h
@@ -226,7 +226,9 @@ char *blame_header =
 char *blame_line =
 	"<div id='blame_wrapper'>" \
 	"<div id='blame_number'>%.*d</div>" \
-	"<div id='blame_hash'>%.8s</div>" \
+	"<div id='blame_hash'>" \
+	"<a href='?path=%s&action=blob&commit=%s&file=%s&folder=%s'>%.8s</a>" \
+	"</div>" \
 	"<div id='blame_date'>%s</div>" \
 	"<div id='blame_author'>%-8s</div>" \
 	"<div id='blame_code'>%s</div>" \