Lightweight and easily self-hostable Git forge. git.poy.ooo
git-forge selfhosting homebrew
Something went wrong. Try again.
12345678910111213141516171819202122232425package ssh
import ( "errors" "regexp")
var gitCommandRx = regexp.MustCompile(`^(git-upload-pack|git-receive-pack|git-upload-archive) '(.+)'$`)
type GitCommand struct { Command string Args string}
func parseGitCommand(raw string) (GitCommand, error) { matches := gitCommandRx.FindStringSubmatch(raw) if matches == nil { return GitCommand{}, errors.New("unrecognized command") } return GitCommand{ Command: matches[1], Args: matches[2], }, nil}