diff options
author | Unknwon <u@gogs.io> | 2016-02-15 23:11:22 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-02-15 23:11:22 -0500 |
commit | 9cf4fe043b2698c1a03ab7f04ebdd11591831d15 (patch) | |
tree | 9580df361903816dfc353f0a3aaac6d97c6ba276 /cmd/update.go | |
parent | 2765b5c7cf6fa234fd86a14ee50597f8ed841c18 (diff) | |
download | gitea-9cf4fe043b2698c1a03ab7f04ebdd11591831d15.tar.gz gitea-9cf4fe043b2698c1a03ab7f04ebdd11591831d15.zip |
Add env var check for update
Diffstat (limited to 'cmd/update.go')
-rw-r--r-- | cmd/update.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cmd/update.go b/cmd/update.go index 4cd62a7f54..1d27fb3e7b 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -28,8 +28,9 @@ func runUpdate(c *cli.Context) { if c.IsSet("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 } @@ -37,9 +38,9 @@ func runUpdate(c *cli.Context) { args := c.Args() if len(args) != 3 { - log.GitLogger.Fatal(2, "received less 3 parameters") - } else if args[0] == "" { - log.GitLogger.Fatal(2, "refName is empty, shouldn't use") + log.GitLogger.Fatal(2, "Arguments received are not equal to three") + } else if len(args[0]) == 0 { + log.GitLogger.Fatal(2, "First argument 'refName' is empty, shouldn't use") } task := models.UpdateTask{ |