From 263a1509dbd79b1df3abe1bd42e2cd5d45448dea Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Mon, 19 Dec 2022 18:07:13 +0530 Subject: diff: show diff type --- git/diff.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'git') diff --git a/git/diff.go b/git/diff.go index 063ac87..93c823a 100644 --- a/git/diff.go +++ b/git/diff.go @@ -21,6 +21,8 @@ type Diff struct { } TextFragments []TextFragment IsBinary bool + IsNew bool + IsDelete bool } // A nicer git diff representation. @@ -90,6 +92,8 @@ func (g *GitRepo) Diff() (*NiceDiff, error) { ndiff.Name.New = d.NewName ndiff.Name.Old = d.OldName ndiff.IsBinary = d.IsBinary + ndiff.IsNew = d.IsNew + ndiff.IsDelete = d.IsDelete for _, tf := range d.TextFragments { ndiff.TextFragments = append(ndiff.TextFragments, TextFragment{ -- cgit