Respond to a successful push with a URL to create a PR pointing to the default branch. This behavior is made to mimic other Git forges.
Signed-off-by: Samuel Shuert me@thecoded.prof
Respond to a successful push with a URL to create a PR pointing to the default branch. This behavior is made to mimic other Git forges.
Signed-off-by: Samuel Shuert me@thecoded.prof
······-fmt.Fprintf(os.Stderr, "\thttps://tangled.org/@%s/%s/compare/%s...%s\n", userIdent.Handle.String(), repoName, defaultBranch, strings.TrimPrefix(line.Ref, "refs/heads/"))req, err := http.NewRequest("POST", "http://"+endpoint+"/hooks/post-receive", strings.NewReader(payload))
·········+if (line.NewSha.String() != line.OldSha.String()) && line.OldSha.IsZero() && (line.Ref != fmt.Sprint("refs/heads/", defaultBranch)) {+resp.Messages = append(resp.Messages, fmt.Sprintf("Create a PR pointing to %s", defaultBranch))+resp.Messages = append(resp.Messages, fmt.Sprintf("\t%s/@%s/%s/compare/%s...%s", h.c.AppViewEndpoint, user, repoName, defaultBranch, strings.TrimPrefix(line.Ref, "refs/heads/")))