mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
refactor: reuse the existing service and rendering helpers
services.IsNotFound replaces the hand-rolled 404 checks, convertPage the copied page conversions and lastPathNumber the comment's own number parser. The List wrappers around ListPage of releases, branches, wiki pages, secrets and variables go, pull request filters resolve milestones through Milestones.FindOne like issues, and localFlagsChanged, boolOrder, Cell.Render, stateBadge and dueText replace their copies. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
33 files changed
+85
-212
No files matched your search
@@ -307,9 +307,11 @@ func argumentName(cmd *cobra.Command, argument string) string {
|
||||
return noun + " " + text
|
||||
}
|
||||
|
||||
// localFlagsChanged reports whether any command-specific flag was supplied.
|
||||
func localFlagsChanged(cmd *cobra.Command) bool {
|
||||
// localFlagsChanged reports whether a command-specific flag other than those in except was supplied.
|
||||
func localFlagsChanged(cmd *cobra.Command, except ...string) bool {
|
||||
changed := false
|
||||
cmd.LocalNonPersistentFlags().VisitAll(func(flag *pflag.Flag) { changed = changed || flag.Changed })
|
||||
cmd.LocalNonPersistentFlags().VisitAll(func(flag *pflag.Flag) {
|
||||
changed = changed || flag.Changed && !slices.Contains(except, flag.Name)
|
||||
})
|
||||
return changed
|
||||
}
|
||||
Reference in new issue
Block a user