|
@@ -7,6 +7,8 @@ import (
|
7
|
7
|
"os"
|
8
|
8
|
"time"
|
9
|
9
|
|
|
10
|
+ "config"
|
|
11
|
+
|
10
|
12
|
gogit "gopkg.in/src-d/go-git.v4"
|
11
|
13
|
"gopkg.in/src-d/go-git.v4/plumbing/object"
|
12
|
14
|
)
|
|
@@ -71,9 +73,9 @@ func writeVersions(
|
71
|
73
|
// file, adding it to the index or creating the commit.
|
72
|
74
|
func commitNewVersions(
|
73
|
75
|
versions map[string]int, dv map[string]diffVersion, worktree *gogit.Worktree,
|
74
|
|
- clonePath string,
|
|
76
|
+ cfg *config.Config,
|
75
|
77
|
) (err error) {
|
76
|
|
- if err = writeVersions(versions, dv, clonePath); err != nil {
|
|
78
|
+ if err = writeVersions(versions, dv, cfg.Git.ClonePath); err != nil {
|
77
|
79
|
return err
|
78
|
80
|
}
|
79
|
81
|
|
|
@@ -83,8 +85,8 @@ func commitNewVersions(
|
83
|
85
|
|
84
|
86
|
_, err = worktree.Commit(getCommitMessage(dv), &gogit.CommitOptions{
|
85
|
87
|
Author: &object.Signature{
|
86
|
|
- Name: "Grafana Dashboard Manager",
|
87
|
|
- Email: "grafana@cozycloud.cc",
|
|
88
|
+ Name: cfg.Git.CommitsAuthor.Name,
|
|
89
|
+ Email: cfg.Git.CommitsAuthor.Email,
|
88
|
90
|
When: time.Now(),
|
89
|
91
|
},
|
90
|
92
|
})
|