|
| 1 | +// Package git provides Git repository handling functionality for the SSH server. |
1 | 2 | package git |
2 | 3 |
|
3 | 4 | // This file just contains the Git-specific portions of sshd. |
@@ -45,8 +46,8 @@ var preReceiveHookTpl = template.Must(template.New("hooks").Parse(preReceiveHook |
45 | 46 | func Receive( |
46 | 47 | repo, operation, gitHome string, |
47 | 48 | channel ssh.Channel, |
48 | | - fingerprint, username, conndata, receivetype string) error { |
49 | | - |
| 49 | + fingerprint, username, conndata, receivetype string, |
| 50 | +) error { |
50 | 51 | log.Info("receiving git repo name: %s, operation: %s, fingerprint: %s, user: %s", repo, operation, fingerprint, username) |
51 | 52 |
|
52 | 53 | if receivetype == "mock" { |
@@ -138,7 +139,7 @@ func createRepo(repoPath string) (bool, error) { |
138 | 139 | } else if os.IsNotExist(err) { |
139 | 140 | log.Debug("Creating new directory at %s", repoPath) |
140 | 141 | // Create directory |
141 | | - if err := os.MkdirAll(repoPath, 0755); err != nil { |
| 142 | + if err := os.MkdirAll(repoPath, 0o755); err != nil { |
142 | 143 | log.Err("Failed to create repository: %s", err) |
143 | 144 | return false, err |
144 | 145 | } |
@@ -169,7 +170,7 @@ func createPreReceiveHook(gitHome, repoPath string) error { |
169 | 170 | if err := preReceiveHookTpl.Execute(fd, map[string]string{"GitHome": gitHome}); err != nil { |
170 | 171 | return fmt.Errorf("cannot write pre-receive hook to %s (%s)", writePath, err) |
171 | 172 | } |
172 | | - if err := os.Chmod(writePath, 0755); err != nil { |
| 173 | + if err := os.Chmod(writePath, 0o755); err != nil { |
173 | 174 | return fmt.Errorf("cannot change pre-receive hook script permissions (%s)", err) |
174 | 175 | } |
175 | 176 |
|
|
0 commit comments