Replace Gogs with Gitea (#520)
This commit is contained in:
parent
f686a32eac
commit
331316894e
8 changed files with 29 additions and 29 deletions
|
@ -103,13 +103,13 @@ func Migrate(x *xorm.Engine) error {
|
|||
|
||||
v := currentVersion.Version
|
||||
if minDBVersion > v {
|
||||
log.Fatal(4, `Gogs no longer supports auto-migration from your previously installed version.
|
||||
log.Fatal(4, `Gitea no longer supports auto-migration from your previously installed version.
|
||||
Please try to upgrade to a lower version (>= v0.6.0) first, then upgrade to current version.`)
|
||||
return nil
|
||||
}
|
||||
|
||||
if int(v-minDBVersion) > len(migrations) {
|
||||
// User downgraded Gogs.
|
||||
// User downgraded Gitea.
|
||||
currentVersion.Version = int64(len(migrations) + minDBVersion)
|
||||
_, err = x.Id(1).Update(currentVersion)
|
||||
return err
|
||||
|
|
|
@ -141,11 +141,11 @@ func NewRepoContext() {
|
|||
|
||||
log.Info("Git Version: %s", gitVer)
|
||||
if version.Compare("1.7.1", gitVer, ">") {
|
||||
log.Fatal(4, "Gogs requires Git version greater or equal to 1.7.1")
|
||||
log.Fatal(4, "Gitea requires Git version greater or equal to 1.7.1")
|
||||
}
|
||||
|
||||
// Git requires setting user.name and user.email in order to commit changes.
|
||||
for configKey, defaultValue := range map[string]string{"user.name": "Gogs", "user.email": "gogs@fake.local"} {
|
||||
for configKey, defaultValue := range map[string]string{"user.name": "Gitea", "user.email": "gitea@fake.local"} {
|
||||
if stdout, stderr, err := process.Exec("NewRepoContext(get setting)", "git", "config", "--get", configKey); err != nil || strings.TrimSpace(stdout) == "" {
|
||||
// ExitError indicates this config is not set
|
||||
if _, ok := err.(*exec.ExitError); ok || strings.TrimSpace(stdout) == "" {
|
||||
|
@ -926,7 +926,7 @@ func initRepository(e Engine, repoPath string, u *User, repo *Repository, opts C
|
|||
return fmt.Errorf("createUpdateHook: %v", err)
|
||||
}
|
||||
|
||||
tmpDir := filepath.Join(os.TempDir(), "gogs-"+repo.Name+"-"+com.ToStr(time.Now().Nanosecond()))
|
||||
tmpDir := filepath.Join(os.TempDir(), "gitea-"+repo.Name+"-"+com.ToStr(time.Now().Nanosecond()))
|
||||
|
||||
// Initialize repository according to user's choice.
|
||||
if opts.AutoInit {
|
||||
|
|
|
@ -172,7 +172,7 @@ func parseKeyString(content string) (string, error) {
|
|||
// writeTmpKeyFile writes key content to a temporary file
|
||||
// and returns the name of that file, along with any possible errors.
|
||||
func writeTmpKeyFile(content string) (string, error) {
|
||||
tmpFile, err := ioutil.TempFile(setting.SSH.KeyTestPath, "gogs_keytest")
|
||||
tmpFile, err := ioutil.TempFile(setting.SSH.KeyTestPath, "gitea_keytest")
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("TempFile: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue