Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Show a renamed file's diff as the rename
A diff limited to the new name cannot see the old one, so the diffstat's link for a renamed file, the commit page reached from that file's log, and the file's rawdiff and patch all showed every line as added. A path the old tree lacks is now diffed across the whole commit with rename detection aimed at it alone, the way git blame looks for a rename, so it is compared with the commit's deleted files and nothing else. Doing it in cgit_diff_tree keeps the log's counts for that commit in step with the page they link to. The rawdiff and patch pages leave the diff to git's own output, so for them that search finds the old name, and both names go into the limit with rename detection on.
Diffstat (limited to 'source')
-rw-r--r--source/shared.c79
-rw-r--r--source/shared.h24
-rw-r--r--source/ui-diff.c11
-rw-r--r--source/ui-patch.c13
4 files changed, 116 insertions, 11 deletions