59
59
)
60
60
61
61
func runHookPreReceive (c * cli.Context ) error {
62
+ setup ("hooks/pre-receive.log" , false )
63
+
62
64
if len (os .Getenv ("SSH_ORIGINAL_COMMAND" )) == 0 {
63
65
if setting .OnlyAllowPushIfGiteaEnvironmentSet {
64
66
fail (`Rejecting changes as Gitea environment not set.
@@ -69,8 +71,6 @@ Gitea or set your environment appropriately.`, "")
69
71
}
70
72
}
71
73
72
- setup ("hooks/pre-receive.log" , false )
73
-
74
74
// the environment setted on serv command
75
75
isWiki := (os .Getenv (models .EnvRepoIsWiki ) == "true" )
76
76
username := os .Getenv (models .EnvRepoUsername )
@@ -197,6 +197,8 @@ Gitea or set your environment appropriately.`, "")
197
197
}
198
198
199
199
func runHookPostReceive (c * cli.Context ) error {
200
+ setup ("hooks/post-receive.log" , false )
201
+
200
202
if len (os .Getenv ("SSH_ORIGINAL_COMMAND" )) == 0 {
201
203
if setting .OnlyAllowPushIfGiteaEnvironmentSet {
202
204
fail (`Rejecting changes as Gitea environment not set.
@@ -207,8 +209,6 @@ Gitea or set your environment appropriately.`, "")
207
209
}
208
210
}
209
211
210
- setup ("hooks/post-receive.log" , false )
211
-
212
212
// the environment setted on serv command
213
213
repoUser := os .Getenv (models .EnvRepoUsername )
214
214
isWiki := (os .Getenv (models .EnvRepoIsWiki ) == "true" )
0 commit comments