فهرست منبع

Repair the plugin example

Vadim Markovtsev 7 سال پیش
والد
کامیت
871621f262
1فایلهای تغییر یافته به همراه11 افزوده شده و 6 حذف شده
  1. 11 6
      contrib/_plugin_example/churn_analysis.go

+ 11 - 6
contrib/_plugin_example/churn_analysis.go

@@ -68,7 +68,12 @@ func (churn *ChurnAnalysis) Provides() []string {
 // day - number of days since start for each commit
 // author - author of the commit
 func (churn *ChurnAnalysis) Requires() []string {
-	arr := [...]string{DependencyFileDiff, DependencyTreeChanges, DependencyBlobCache, DependencyDay, DependencyAuthor}
+	arr := [...]string{
+		hercules.DependencyFileDiff,
+		hercules.DependencyTreeChanges,
+		hercules.DependencyBlobCache,
+		hercules.DependencyDay,
+		hercules.DependencyAuthor}
 	return arr[:]
 }
 
@@ -107,11 +112,11 @@ func (churn *ChurnAnalysis) Initialize(repository *git.Repository) {
 }
 
 func (churn *ChurnAnalysis) Consume(deps map[string]interface{}) (map[string]interface{}, error) {
-	fileDiffs := deps[DependencyFileDiff].(map[string]hercules.FileDiffData)
-	treeDiffs := deps[DependencyTreeChanges].(object.Changes)
-	cache := deps[DependencyBlobCache].(map[plumbing.Hash]*object.Blob)
-	day := deps[DependencyDay].(int)
-	author := deps[DependencyAuthor].(int)
+	fileDiffs := deps[hercules.DependencyFileDiff].(map[string]hercules.FileDiffData)
+	treeDiffs := deps[hercules.DependencyTreeChanges].(object.Changes)
+	cache := deps[hercules.DependencyBlobCache].(map[plumbing.Hash]*object.Blob)
+	day := deps[hercules.DependencyDay].(int)
+	author := deps[hercules.DependencyAuthor].(int)
 	for _, change := range treeDiffs {
 		action, err := change.Action()
 		if err != nil {