Skip to content

Commit 62d3cfa

Browse files
committed
test: debug log
1 parent 4fb19f7 commit 62d3cfa

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

routers/private/hook_post_receive.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88
"net/http"
99
"strconv"
10+
"time"
1011

1112
issues_model "code.gitea.io/gitea/models/issues"
1213
repo_model "code.gitea.io/gitea/models/repo"
@@ -24,6 +25,9 @@ import (
2425

2526
// HookPostReceive updates services and users
2627
func HookPostReceive(ctx *gitea_context.PrivateContext) {
28+
// TODO: remove debug code
29+
log.Info("Debug git hook, HookPostReceive: %v", time.Now().Format(time.RFC3339Nano))
30+
2731
opts := web.GetForm(ctx).(*private.HookOptions)
2832

2933
// We don't rely on RepoAssignment here because:
@@ -93,6 +97,8 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) {
9397
})
9498
return
9599
}
100+
// TODO: remove debug code
101+
log.Info("Debug git hook, before sync %v branches: %v", len(updates), time.Now().Format(time.RFC3339Nano))
96102

97103
for _, update := range updates {
98104
if !update.RefFullName.IsBranch() {
@@ -133,6 +139,9 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) {
133139
}
134140
}
135141
}
142+
143+
// TODO: remove debug code
144+
log.Info("Debug git hook, after sync %v branches: %v", len(updates), time.Now().Format(time.RFC3339Nano))
136145
}
137146

138147
// Handle Push Options

routers/private/hook_pre_receive.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88
"net/http"
99
"os"
10+
"time"
1011

1112
"code.gitea.io/gitea/models"
1213
asymkey_model "code.gitea.io/gitea/models/asymkey"
@@ -103,6 +104,9 @@ func (ctx *preReceiveContext) AssertCreatePullRequest() bool {
103104

104105
// HookPreReceive checks whether a individual commit is acceptable
105106
func HookPreReceive(ctx *gitea_context.PrivateContext) {
107+
// TODO: remove debug code
108+
log.Info("Debug git hook, HookPreReceive: %v", time.Now().Format(time.RFC3339Nano))
109+
106110
opts := web.GetForm(ctx).(*private.HookOptions)
107111

108112
ourCtx := &preReceiveContext{

0 commit comments

Comments
 (0)