Browse Source

Fix Git hooks not being executed on Windows when running as a service (#1149)

Closes #1139
Andrey Nering 3 years ago
parent
commit
d2b2881306
1 changed files with 2 additions and 1 deletions
  1. 2 1
      modules/minwinsvc/svc_windows.go

+ 2 - 1
modules/minwinsvc/svc_windows.go

@@ -18,10 +18,11 @@ var (
18 18
 	onExit  func()
19 19
 	guard   sync.Mutex
20 20
 	skip, _ = strconv.ParseBool(os.Getenv("SKIP_MINWINSVC"))
21
+	isSSH   = os.Getenv("SSH_ORIGINAL_COMMAND") != ""
21 22
 )
22 23
 
23 24
 func init() {
24
-	if skip {
25
+	if skip || isSSH {
25 26
 		return
26 27
 	}
27 28
 	interactive, err := svc.IsAnInteractiveSession()