mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 10:27:29 -04:00 
			
		
		
		
	Add env var check for update
This commit is contained in:
		| @@ -28,8 +28,9 @@ func runUpdate(c *cli.Context) { | |||||||
| 	if c.IsSet("config") { | 	if c.IsSet("config") { | ||||||
| 		setting.CustomConf = c.String("config") | 		setting.CustomConf = c.String("config") | ||||||
| 	} | 	} | ||||||
| 	cmd := os.Getenv("SSH_ORIGINAL_COMMAND") |  | ||||||
| 	if cmd == "" { | 	if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 { | ||||||
|  | 		log.GitLogger.Trace("SSH_ORIGINAL_COMMAND is empty") | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| @@ -37,9 +38,9 @@ func runUpdate(c *cli.Context) { | |||||||
|  |  | ||||||
| 	args := c.Args() | 	args := c.Args() | ||||||
| 	if len(args) != 3 { | 	if len(args) != 3 { | ||||||
| 		log.GitLogger.Fatal(2, "received less 3 parameters") | 		log.GitLogger.Fatal(2, "Arguments received are not equal to three") | ||||||
| 	} else if args[0] == "" { | 	} else if len(args[0]) == 0 { | ||||||
| 		log.GitLogger.Fatal(2, "refName is empty, shouldn't use") | 		log.GitLogger.Fatal(2, "First argument 'refName' is empty, shouldn't use") | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	task := models.UpdateTask{ | 	task := models.UpdateTask{ | ||||||
|   | |||||||
| @@ -37,6 +37,7 @@ func NewLogger(bufLen int64, mode, config string) { | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
|  | // FIXME: use same log level as other loggers. | ||||||
| func NewGitLogger(logPath string) { | func NewGitLogger(logPath string) { | ||||||
| 	os.MkdirAll(path.Dir(logPath), os.ModePerm) | 	os.MkdirAll(path.Dir(logPath), os.ModePerm) | ||||||
| 	GitLogger = newLogger(0) | 	GitLogger = newLogger(0) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user