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

merged
opened by willdot.net targeting master from willdot.net/tangled-core: feat/pr-creation-descrption
Changed files
+7 -3
appview
pulls
+7 -3
appview/pulls/pulls.go
··· 1093 1093 1094 1094 // We've already checked earlier if it's diff-based and title is empty, 1095 1095 // so if it's still empty now, it's intentionally skipped owing to format-patch. 1096 - if title == "" { 1096 + if title == "" || body == "" { 1097 1097 formatPatches, err := patchutil.ExtractPatches(patch) 1098 1098 if err != nil { 1099 1099 s.pages.Notice(w, "pull", fmt.Sprintf("Failed to extract patches: %v", err)) ··· 1104 1104 return 1105 1105 } 1106 1106 1107 - title = formatPatches[0].Title 1108 - body = formatPatches[0].Body 1107 + if title == "" { 1108 + title = formatPatches[0].Title 1109 + } 1110 + if body == "" { 1111 + body = formatPatches[0].Body 1112 + } 1109 1113 } 1110 1114 1111 1115 rkey := tid.TID()