~edwargix/git.sr.ht

ae9cf39a525e09077165a906c0d0a384d027dad9 — Ian Moody 6 years ago 84203a8
Include funcname in hunk header in commit view if available

pygit2 unfortunately doesn't make the function name output directly available
as a property on the hunk like it does for the line info, but we can extract it
from the raw hunk header by splitting on the '@@'.  The function name will be
the last element and will be terminated by a '\n', so we strip that out. (If
there is no function name the string will only be the '\n')
1 files changed, 1 insertions(+), 1 deletions(-)

M gitsrht/templates/utils.html
M gitsrht/templates/utils.html => gitsrht/templates/utils.html +1 -1
@@ 159,7 159,7 @@ endif %}{% endfor %}
  target="_blank"
  {% endif %}
>{{hunk.new_start}}</a>,{{hunk.new_lines}} {#
#}@@</strong>
#}@@{{hunk.header.split('@@')[-1][:-1]}}</strong>
{% for line in hunk.lines
%}<span class="{{({
  "+":"text-success",