Skip to content

Commit 152ed63

Browse files
authored
Merge pull request #44 from nikpivkin/check-hooks
fix panic if hooks are not passed
2 parents 8fe4d96 + 4a9710e commit 152ed63

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (c *Config) Setup() error {
7272
}
7373
}
7474

75-
if c.AutoHooks == true {
75+
if c.AutoHooks && c.Hooks != nil {
7676
return c.setupHooks()
7777
}
7878

ssh.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func (s *SSH) handleConnection(keyID string, chans <-chan ssh.NewChannel) {
137137
return
138138
}
139139

140-
if !repoExists(filepath.Join(s.config.Dir, gitcmd.Repo)) && s.config.AutoCreate == true {
140+
if !repoExists(filepath.Join(s.config.Dir, gitcmd.Repo)) && s.config.AutoCreate {
141141
err := initRepo(gitcmd.Repo, s.config)
142142
if err != nil {
143143
logError("repo-init", err)

0 commit comments

Comments
 (0)