You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/modules/doctor
Xinyu Zhou f321cdced7
Add HEAD fix to gitea doctor (#21352) (#21751)
Backport #21352

Due to a bug in presumably an older version of Gitea, multiple of my
repositories still have their HEADs pointing to a `master` branch while
the default branch on the UI is listed as `main`. This adds a `gitea
doctor` command that will fix all of the HEAD references for repos when
they're not synchronized with the default branch in the DB.

This will help with cloning to ensure that git automatically checks out
the right branch, instead of a nonexistent one.

Note: I'm not sure if I actually need to do more other than add a file
here. Will try testing this out on my server soon.

Co-authored-by: Clar Fon <15850505+clarfonthey@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago
..
authorizedkeys.go Move almost all functions' parameter db.Engine to context.Context (#19748) 3 years ago
breaking.go Add username check to doctor (#20140) (#20671) 3 years ago
checkOldArchives.go Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 3 years ago
dbconsistency.go Backtick table name in generic orphan check (#20019) (#20037) 3 years ago
dbversion.go Propagate context and ensure git commands run in request context (#17868) 3 years ago
doctor.go Fix git.Init for doctor sub-command (#20782) (#20783) 3 years ago
fix16961.go Fix inconsistency in doctor output (#19836) 3 years ago
fix16961_test.go Move repository model into models/repo (#17933) 3 years ago
heads.go Add HEAD fix to gitea doctor (#21352) (#21751) 2 years ago
mergebase.go Move issues related files into models/issues (#19931) 3 years ago
misc.go [doctor] do not update User Stars numbers unless --fix (#19750) 3 years ago
paths.go format with gofumpt (#18184) 3 years ago
storage.go Propagate context and ensure git commands run in request context (#17868) 3 years ago
usertype.go Propagate context and ensure git commands run in request context (#17868) 3 years ago