···143143 if err != nil {
144144 return err
145145 }
146146- fi.WriteString("#!/usr/bin/env bash\n")
147147- fi.WriteString(fmt.Sprintf("%s pre-receive-hook\n", bin))
148148- fi.WriteString(fmt.Sprintf(`for hook in %s.d/*; do
146146+ fmt.Fprintln(fi, "#!/usr/bin/env bash")
147147+ fmt.Fprintf(fi, "%s pre-receive-hook\n", bin)
148148+ fmt.Fprintf(fi, `for hook in %s.d/*; do
149149 test -x "${hook}" && test -f "${hook}" || continue
150150 "${hook}"
151151-done`, fp))
151151+done`, fp)
152152 fi.Close()
153153154154 return os.Chmod(fp, 0o755)
···162162163163 opts := make([]*packp.Option, 0)
164164 if pushCount, err := strconv.Atoi(os.Getenv("GIT_PUSH_OPTION_COUNT")); err == nil {
165165- for idx := 0; idx < pushCount; idx++ {
165165+ for idx := range pushCount {
166166 opt := os.Getenv(fmt.Sprintf("GIT_PUSH_OPTION_%d", idx))
167167 kv := strings.SplitN(opt, "=", 2)
168168 if len(kv) == 2 {
+2-2
internal/git/grep.go
···18181919// Grep performs a naive "code search" via git grep
2020func (r Repo) Grep(search string) ([]GrepResult, error) {
2121- if strings.HasPrefix(search, "=") {
2222- search = regexp.QuoteMeta(strings.TrimPrefix(search, "="))
2121+ if after, ok := strings.CutPrefix(search, "="); ok {
2222+ search = regexp.QuoteMeta(after)
2323 }
2424 re, err := regexp.Compile(search)
2525 if err != nil {
+1-1
internal/ssh/ssh.go
···48484949type noopLogger struct{}
50505151-func (n noopLogger) Printf(format string, v ...interface{}) {}
5151+func (n noopLogger) Printf(format string, v ...any) {}
+1-1
internal/ssh/wish.go
···168168}
169169170170// Fatal prints to the session's STDOUT as a git response and exit 1.
171171-func Fatal(s ssh.Session, v ...interface{}) {
171171+func Fatal(s ssh.Session, v ...any) {
172172 msg := fmt.Sprint(v...)
173173 // hex length includes 4 byte length prefix and ending newline
174174 pktLine := fmt.Sprintf("%04x%s\n", len(msg)+5, msg)