forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

appview/pulls: only fill in description from commit if description was left blank

Signed-off-by: Will Andrews <did:plc:dadhhalkfcq3gucaq25hjqon>

Changed files
+7 -3
appview
pulls
+7 -3
appview/pulls/pulls.go
···
// We've already checked earlier if it's diff-based and title is empty,
// so if it's still empty now, it's intentionally skipped owing to format-patch.
-
if title == "" {
formatPatches, err := patchutil.ExtractPatches(patch)
if err != nil {
s.pages.Notice(w, "pull", fmt.Sprintf("Failed to extract patches: %v", err))
···
return
}
-
title = formatPatches[0].Title
-
body = formatPatches[0].Body
}
rkey := tid.TID()
···
// We've already checked earlier if it's diff-based and title is empty,
// so if it's still empty now, it's intentionally skipped owing to format-patch.
+
if title == "" || body == "" {
formatPatches, err := patchutil.ExtractPatches(patch)
if err != nil {
s.pages.Notice(w, "pull", fmt.Sprintf("Failed to extract patches: %v", err))
···
return
}
+
if title == "" {
+
title = formatPatches[0].Title
+
}
+
if body == "" {
+
body = formatPatches[0].Body
+
}
}
rkey := tid.TID()