diff options
-rw-r--r-- | cmd/hook.go | 6 | ||||
-rw-r--r-- | gogs.go | 2 | ||||
-rw-r--r-- | templates/.VERSION | 2 | ||||
-rw-r--r-- | vendor/github.com/gogits/minwinsvc/LICENSE (renamed from vendor/github.com/kardianos/minwinsvc/LICENSE) | 0 | ||||
-rw-r--r-- | vendor/github.com/gogits/minwinsvc/README.md (renamed from vendor/github.com/kardianos/minwinsvc/README.md) | 0 | ||||
-rw-r--r-- | vendor/github.com/gogits/minwinsvc/minwinsvc.go (renamed from vendor/github.com/kardianos/minwinsvc/minwinsvc.go) | 0 | ||||
-rw-r--r-- | vendor/github.com/gogits/minwinsvc/svc_other.go (renamed from vendor/github.com/kardianos/minwinsvc/svc_other.go) | 0 | ||||
-rw-r--r-- | vendor/github.com/gogits/minwinsvc/svc_windows.go (renamed from vendor/github.com/kardianos/minwinsvc/svc_windows.go) | 4 | ||||
-rw-r--r-- | vendor/vendor.json | 12 |
9 files changed, 16 insertions, 10 deletions
diff --git a/cmd/hook.go b/cmd/hook.go index fede8649..95db18f0 100644 --- a/cmd/hook.go +++ b/cmd/hook.go @@ -117,7 +117,8 @@ func runHookPreReceive(c *cli.Context) error { } // Check force push - output, err := git.NewCommand("rev-list", oldCommitID, "^"+newCommitID).Run() + output, err := git.NewCommand("rev-list", oldCommitID, "^"+newCommitID). + RunInDir(models.RepoPath(os.Getenv(http.ENV_REPO_OWNER_NAME), os.Getenv(http.ENV_REPO_NAME))) if err != nil { fail("Internal error", "Fail to detect force push: %v", err) } else if len(output) > 0 { @@ -131,6 +132,7 @@ func runHookPreReceive(c *cli.Context) error { } hookCmd := exec.Command(customHooksPath) + hookCmd.Dir = models.RepoPath(os.Getenv(http.ENV_REPO_OWNER_NAME), os.Getenv(http.ENV_REPO_NAME)) hookCmd.Stdout = os.Stdout hookCmd.Stdin = buf hookCmd.Stderr = os.Stderr @@ -159,6 +161,7 @@ func runHookUpdate(c *cli.Context) error { } hookCmd := exec.Command(customHooksPath, args...) + hookCmd.Dir = models.RepoPath(os.Getenv(http.ENV_REPO_OWNER_NAME), os.Getenv(http.ENV_REPO_NAME)) hookCmd.Stdout = os.Stdout hookCmd.Stdin = os.Stdin hookCmd.Stderr = os.Stderr @@ -231,6 +234,7 @@ func runHookPostReceive(c *cli.Context) error { } hookCmd := exec.Command(customHooksPath) + hookCmd.Dir = models.RepoPath(os.Getenv(http.ENV_REPO_OWNER_NAME), os.Getenv(http.ENV_REPO_NAME)) hookCmd.Stdout = os.Stdout hookCmd.Stdin = buf hookCmd.Stderr = os.Stderr @@ -16,7 +16,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.10.2.0228" +const APP_VER = "0.10.3.0228" func init() { setting.AppVer = APP_VER diff --git a/templates/.VERSION b/templates/.VERSION index 3762da78..59bae7e5 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.10.2.0228
\ No newline at end of file +0.10.3.0228
\ No newline at end of file diff --git a/vendor/github.com/kardianos/minwinsvc/LICENSE b/vendor/github.com/gogits/minwinsvc/LICENSE index fce91b4e..fce91b4e 100644 --- a/vendor/github.com/kardianos/minwinsvc/LICENSE +++ b/vendor/github.com/gogits/minwinsvc/LICENSE diff --git a/vendor/github.com/kardianos/minwinsvc/README.md b/vendor/github.com/gogits/minwinsvc/README.md index 260dceea..260dceea 100644 --- a/vendor/github.com/kardianos/minwinsvc/README.md +++ b/vendor/github.com/gogits/minwinsvc/README.md diff --git a/vendor/github.com/kardianos/minwinsvc/minwinsvc.go b/vendor/github.com/gogits/minwinsvc/minwinsvc.go index 057ba7f9..057ba7f9 100644 --- a/vendor/github.com/kardianos/minwinsvc/minwinsvc.go +++ b/vendor/github.com/gogits/minwinsvc/minwinsvc.go diff --git a/vendor/github.com/kardianos/minwinsvc/svc_other.go b/vendor/github.com/gogits/minwinsvc/svc_other.go index 197d3002..197d3002 100644 --- a/vendor/github.com/kardianos/minwinsvc/svc_other.go +++ b/vendor/github.com/gogits/minwinsvc/svc_other.go diff --git a/vendor/github.com/kardianos/minwinsvc/svc_windows.go b/vendor/github.com/gogits/minwinsvc/svc_windows.go index 91e2b6a4..e79755fa 100644 --- a/vendor/github.com/kardianos/minwinsvc/svc_windows.go +++ b/vendor/github.com/gogits/minwinsvc/svc_windows.go @@ -23,7 +23,9 @@ func init() { if err != nil { panic(err) } - if interactive { + // While run as Windows service, it is not an interactive session, + // but we don't want hook execute to be treated as service, e.g. gogs.exe hook pre-receive. + if interactive || len(os.Getenv("SSH_ORIGINAL_COMMAND")) > 0 { return } go func() { diff --git a/vendor/vendor.json b/vendor/vendor.json index 32b0465a..0e4cf311 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -177,6 +177,12 @@ "revisionTime": "2016-11-20T02:51:54Z" }, { + "checksumSHA1": "cccKtXG5TiCiCT9JA85slbJokfw=", + "path": "github.com/gogits/minwinsvc", + "revision": "95be6356811a6fbd4c2981713236971a3ccbb33a", + "revisionTime": "2017-03-01T03:54:11Z" + }, + { "checksumSHA1": "MLO0PyrK2MUO6A7Z9PxWuu43C/A=", "path": "github.com/issue9/identicon", "revision": "d36b54562f4cf70c83653e13dc95c220c79ef521", @@ -195,12 +201,6 @@ "revisionTime": "2016-01-05T22:08:40Z" }, { - "checksumSHA1": "/dBJ2h8Jo359deiC5GQ8ZYzX8M8=", - "path": "github.com/kardianos/minwinsvc", - "revision": "cad6b2b879b0970e4245a20ebf1a81a756e2bb70", - "revisionTime": "2015-11-22T16:33:09Z" - }, - { "checksumSHA1": "vfzz7zTL9TZLpFO7NC1H6/Du3+s=", "path": "github.com/klauspost/compress/flate", "revision": "e3b7981a12dd3cab49afa1d3a50e715846f23732", |