aboutsummaryrefslogtreecommitdiffstats
path: root/services/gitdiff/gitdiff.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/gitdiff/gitdiff.go')
-rw-r--r--services/gitdiff/gitdiff.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/services/gitdiff/gitdiff.go b/services/gitdiff/gitdiff.go
index c50e8137ab..73474cf248 100644
--- a/services/gitdiff/gitdiff.go
+++ b/services/gitdiff/gitdiff.go
@@ -104,6 +104,19 @@ func (d *DiffLine) GetType() int {
return int(d.Type)
}
+// GetHTMLDiffLineType returns the diff line type name for HTML
+func (d *DiffLine) GetHTMLDiffLineType() string {
+ switch d.Type {
+ case DiffLineAdd:
+ return "add"
+ case DiffLineDel:
+ return "del"
+ case DiffLineSection:
+ return "tag"
+ }
+ return "same"
+}
+
// CanComment returns whether a line can get commented
func (d *DiffLine) CanComment() bool {
return len(d.Comments) == 0 && d.Type != DiffLineSection