Author | Jakob Wakeling <[email protected]> |
Date | 2023-12-17 00:42:14 |
Commit | 6b13ddb62458c060b3fe9db08e470f30d1a7b550 |
Parent | fc3cc2ff51e7d7a6131587eb40f96215adb3a428 |
Prevent segfault during diffstat calculation
Diffstat
M | src/goit/git.go | | | 4 | +++- |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/goit/git.go b/src/goit/git.go index 75b779f..6db44a9 100644 --- a/src/goit/git.go +++ b/src/goit/git.go @@ -263,7 +263,9 @@ func DiffStats(c *object.Commit) ([]DiffStat, error) { } from, to := fp.Files() - if from == nil /* Added */ { + if from == nil && to == nil { + continue + } else if from == nil /* Added */ { stat.Name = to.Path() stat.Status = "A" } else if to == nil /* Deleted */ {