mirror of
https://github.com/taigrr/gitomatic.git
synced 2026-04-02 03:09:10 -07:00
Don't keep repository & worktree open
This commit is contained in:
6
main.go
6
main.go
@@ -125,6 +125,9 @@ func main() {
|
||||
}
|
||||
|
||||
path := flag.Args()[0]
|
||||
|
||||
for {
|
||||
log.Println("Checking repository:", path)
|
||||
r, err := git.PlainOpen(path)
|
||||
if err != nil {
|
||||
fatal("cannot open repository: %s\n", err)
|
||||
@@ -134,12 +137,11 @@ func main() {
|
||||
fatal("cannot access repository: %s\n", err)
|
||||
}
|
||||
|
||||
for {
|
||||
log.Println("Checking repository:", path)
|
||||
err = gitPull(r, w, auth)
|
||||
if err != nil {
|
||||
fatal("cannot pull from repository: %s\n", err)
|
||||
}
|
||||
|
||||
status, err := w.Status()
|
||||
if err != nil {
|
||||
fatal("cannot retrieve git status: %s\n", err)
|
||||
|
||||
Reference in New Issue
Block a user