-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdriver_local.go
More file actions
51 lines (41 loc) · 873 Bytes
/
driver_local.go
File metadata and controls
51 lines (41 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package gitdb
import (
"errors"
"os"
"time"
"github.com/bouggo/log"
)
type localDriver struct {
config Config
absDBPath string
}
func (d *localDriver) name() string {
return "local"
}
func (d *localDriver) setup(db *gitdb) error {
d.config = db.config
d.absDBPath = db.dbDir()
// create db directory
if err := os.MkdirAll(db.dbDir(), 0755); err != nil {
return err
}
return nil
}
func (d *localDriver) sync() error {
return nil
}
func (d *localDriver) commit(filePath string, msg string, user *User) error {
log.Info("new changes committed")
return nil
}
func (d *localDriver) undo() error {
log.Info("changes reverted")
return nil
}
func (d *localDriver) changedFiles() []string {
var files []string
return files
}
func (d *localDriver) lastCommitTime() (time.Time, error) {
return time.Now(), errors.New("no commit history in repo")
}