Minor code fix [CI SKIP]
This commit is contained in:
		
							parent
							
								
									152e715999
								
							
						
					
					
						commit
						c2afdf2192
					
				
					 3 changed files with 10 additions and 4 deletions
				
			
		|  | @ -73,8 +73,13 @@ func checkVersion() { | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		log.Fatal(4, "Fail to read 'templates/.VERSION': %v", err) | 		log.Fatal(4, "Fail to read 'templates/.VERSION': %v", err) | ||||||
| 	} | 	} | ||||||
| 	if string(data) != setting.AppVer { | 	tplVer := string(data) | ||||||
| 		log.Fatal(4, "Binary and template file version does not match, did you forget to recompile?") | 	if tplVer != setting.AppVer { | ||||||
|  | 		if version.Compare(tplVer, setting.AppVer, ">") { | ||||||
|  | 			log.Fatal(4, "Binary version is lower than template file version, did you forget to recompile Gogs?") | ||||||
|  | 		} else { | ||||||
|  | 			log.Fatal(4, "Binary version is higher than template file version, did you forget to update template files?") | ||||||
|  | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	// Check dependency version.
 | 	// Check dependency version.
 | ||||||
|  |  | ||||||
|  | @ -59,6 +59,7 @@ type Version struct { | ||||||
| // If you want to "retire" a migration, remove it from the top of the list and
 | // If you want to "retire" a migration, remove it from the top of the list and
 | ||||||
| // update _MIN_VER_DB accordingly
 | // update _MIN_VER_DB accordingly
 | ||||||
| var migrations = []Migration{ | var migrations = []Migration{ | ||||||
|  | 	// v0 -> v4: before 0.6.0 -> 0.7.33
 | ||||||
| 	NewMigration("fix locale file load panic", fixLocaleFileLoadPanic),                           // V4 -> V5:v0.6.0
 | 	NewMigration("fix locale file load panic", fixLocaleFileLoadPanic),                           // V4 -> V5:v0.6.0
 | ||||||
| 	NewMigration("trim action compare URL prefix", trimCommitActionAppUrlPrefix),                 // V5 -> V6:v0.6.3
 | 	NewMigration("trim action compare URL prefix", trimCommitActionAppUrlPrefix),                 // V5 -> V6:v0.6.3
 | ||||||
| 	NewMigration("generate issue-label from issue", issueToIssueLabel),                           // V6 -> V7:v0.6.4
 | 	NewMigration("generate issue-label from issue", issueToIssueLabel),                           // V6 -> V7:v0.6.4
 | ||||||
|  |  | ||||||
|  | @ -133,7 +133,7 @@ func (m *Mirror) runSync() bool { | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if _, stderr, err := process.ExecDir( | 	if _, stderr, err := process.ExecDir( | ||||||
| 		timeout, repoPath, fmt.Sprintf("runSync: %s", repoPath), | 		timeout, repoPath, fmt.Sprintf("Mirror.runSync: %s", repoPath), | ||||||
| 		"git", gitArgs...); err != nil { | 		"git", gitArgs...); err != nil { | ||||||
| 		desc := fmt.Sprintf("Fail to update mirror repository '%s': %s", repoPath, stderr) | 		desc := fmt.Sprintf("Fail to update mirror repository '%s': %s", repoPath, stderr) | ||||||
| 		log.Error(4, desc) | 		log.Error(4, desc) | ||||||
|  | @ -144,7 +144,7 @@ func (m *Mirror) runSync() bool { | ||||||
| 	} | 	} | ||||||
| 	if m.Repo.HasWiki() { | 	if m.Repo.HasWiki() { | ||||||
| 		if _, stderr, err := process.ExecDir( | 		if _, stderr, err := process.ExecDir( | ||||||
| 			timeout, wikiPath, fmt.Sprintf("runSync: %s", wikiPath), | 			timeout, wikiPath, fmt.Sprintf("Mirror.runSync: %s", wikiPath), | ||||||
| 			"git", "remote", "update", "--prune"); err != nil { | 			"git", "remote", "update", "--prune"); err != nil { | ||||||
| 			desc := fmt.Sprintf("Fail to update mirror wiki repository '%s': %s", wikiPath, stderr) | 			desc := fmt.Sprintf("Fail to update mirror wiki repository '%s': %s", wikiPath, stderr) | ||||||
| 			log.Error(4, desc) | 			log.Error(4, desc) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue