Skip to content

Commit

Permalink
fix(#61): diff panic when file removed
Browse files Browse the repository at this point in the history
  • Loading branch information
williamfzc committed Sep 16, 2023
1 parent 823f076 commit 03a4b97
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/srctx/diff/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ func collectTotalLineCountMap(opts *Options, src string, lineMap diff.ImpactLine
for eachPath := range lineMap {
totalLineCountMap[eachPath], err = lineCounter(filepath.Join(src, eachPath))
if err != nil {
return nil, err
// ignore this err, files can be removed/moved
log.Infof("file has been removed: %s, set line counter to 0", eachPath)
}
}

Expand Down

0 comments on commit 03a4b97

Please sign in to comment.