aboutsummaryrefslogtreecommitdiff
path: root/submodule.h
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2011-10-31 00:36:20 +0100
committerJunio C Hamano <gitster@pobox.com>2011-10-31 15:22:55 -0700
commit20a864cd835d5d3f559c3cddf5ac5c259bd61171 (patch)
tree587ea0b94985ee7561ff4326feea53a99114e07e /submodule.h
parentbe3fa9125e708348c7baf04ebe9507a72a9d1800 (diff)
downloadgit-20a864cd835d5d3f559c3cddf5ac5c259bd61171.tar.gz
git-20a864cd835d5d3f559c3cddf5ac5c259bd61171.tar.xz
gitweb: Refactor diff body line classification
Simplify classification of diff line body in format_diff_line(), replacing two long if-elsif chains (one for ordinary diff and one for combined diff of a merge commit) with a single regexp match. Refactor this code into diff_line_class() function. While at it: * Fix an artifact in that $diff_class included leading space to be able to compose classes like this "class=\"diff$diff_class\"', even when $diff_class was an empty string. This made code unnecessary ugly: $diff_class is now just class name or an empty string. * Introduce "ctx" class for context lines ($diff_class was set to "" in this case before this commit). Idea and initial code by Junio C Hamano, polish and testing by Jakub Narebski. Inspired by patch adding side-by-side diff by Kato Kazuyoshi, which required $diff_class to be name of class without extra space. Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.h')
0 files changed, 0 insertions, 0 deletions