aboutsummaryrefslogtreecommitdiff
path: root/cmd/kdev/record_extractor.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2024-10-15 10:04:05 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2024-10-15 10:04:05 +0200
commitc1ae71251a2b23170a5d42c6acd37cad8675c5f0 (patch)
treee12b827fb7c9c64f56ca972ac0502b6cd3bdd362 /cmd/kdev/record_extractor.go
parenta738ebc86c6dc6243d19833441d6d3819bd80377 (diff)
feat(kdev): Config files
Diffstat (limited to 'cmd/kdev/record_extractor.go')
-rw-r--r--cmd/kdev/record_extractor.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmd/kdev/record_extractor.go b/cmd/kdev/record_extractor.go
index 2dc079e..5781077 100644
--- a/cmd/kdev/record_extractor.go
+++ b/cmd/kdev/record_extractor.go
@@ -55,12 +55,16 @@ func NewGoGitRecordExtractor(head *object.Commit, path string) *GoGitRecordExtra
}
func (re *GoGitRecordExtractor) Extract(keyword string, path string, line int) Record {
- return Record{
+ record := Record{
keyword: keyword,
path: path,
line: line,
- date: re.blame.Lines[line-1].Date,
}
+ if re != nil {
+ record.date = re.blame.Lines[line-1].Date
+ }
+
+ return record
}
type GitRecordExtractor struct {