server.go

 1package git
 2
 3import (
 4	"context"
 5
 6	"github.com/aymanbagabas/git-module"
 7)
 8
 9// UpdateServerInfo updates the server info file for the given repo path.
10func UpdateServerInfo(ctx context.Context, path string) error {
11	if !isGitDir(path) {
12		return ErrNotAGitRepository
13	}
14
15	cmd := git.NewCommand("update-server-info").WithContext(ctx).WithTimeout(-1)
16	_, err := cmd.RunInDir(path)
17	return err //nolint:wrapcheck
18}